Skip to content

Segfault on hsimple.C in user-mode qemu cross-platform linux/arm64/v8 docker installation #13845

@wdconinc

Description

@wdconinc

Check duplicate issues.

  • Checked for duplicates

Description

As of e9d264e, building ROOT inside a docker container for arm64 architectures on a x86_64 host system using qemu emulation fails on the hsimple.C test:

Consolidate compiler generated dependencies of target GeomBuilder
make[2]: Entering directory '/mnt/root-build-ubuntu'
make[2]: Leaving directory '/mnt/root-build-ubuntu'
[100%] Generating etc/allDict.cxx.pch
make[2]: Entering directory '/mnt/root-build-ubuntu'
[100%] Linking CXX shared library ../../lib/libGeomBuilder.so

Generating PCH for core core/clingutils core/imt core/multiproc core/rint core/thread graf2d/gpad graf2d/graf graf2d/postscript graf3d/g3d gui/fitpanel gui/gui hist/hist hist/histpainter io/io math/genvector math/mathcore math/matrix math/minuit math/physics math/smatrix math/vecops net/net tree/tree tree/treeplayer tree/treeviewer

make[2]: Leaving directory '/mnt/root-build-ubuntu'
[100%] Built target GeomBuilder
make[2]: Leaving directory '/mnt/root-build-ubuntu'
[100%] Built target onepcm
make[2]: Entering directory '/mnt/root-build-ubuntu'
make[2]: Leaving directory '/mnt/root-build-ubuntu'
make[2]: Entering directory '/mnt/root-build-ubuntu'
[100%] Generating tutorials/hsimple.root

Processing hsimple.C...

 *** Break *** segmentation violation
 Generating stack trace...
 0x000000550424be2c in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x000000550424c598 in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x000000550432bef4 in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x0000005504338200 in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x000000550433a1d4 in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x00000055043253ec in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x000000550415c38c in <unknown> from /mnt/root-build-ubuntu/lib/libCling.so
 0x0000005504174cf4 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) + 0xdb4 from /mnt/root-build-ubuntu/lib/libCling.so
 0x000000550417514c in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) + 0xe8 from /mnt/root-build-ubuntu/lib/libCling.so
 0x0000005502a31224 in TApplication::ExecuteFile(char const*, int*, bool) at TApplication.cxx:? from /mnt/root-build-ubuntu/lib/libCore.so
 0x00000055028712f0 in TRint::ProcessLineNr(char const*, char const*, int*) + 0x7c from /mnt/root-build-ubuntu/lib/libRint.so
 0x00000055028731ec in TRint::Run(bool) + 0x2d8 from /mnt/root-build-ubuntu/lib/libRint.so
 0x0000005500000fe8 in main + 0x54 from /mnt/root-build-ubuntu/bin/root.exe
 0x00000055030c73fc in <unknown> from /lib/aarch64-linux-gnu/libc.so.6
 0x00000055030c74cc in __libc_start_main + 0x98 from /lib/aarch64-linux-gnu/libc.so.6
 0x0000005500001070 in _start + 0x30 from /mnt/root-build-ubuntu/bin/root.exe
Root > make[2]: *** [CMakeFiles/hsimple.dir/build.make:79: tutorials/hsimple.root] Error 129
make[2]: Target 'CMakeFiles/hsimple.dir/build' not remade because of errors.
make[2]: Leaving directory '/mnt/root-build-ubuntu'
make[1]: *** [CMakeFiles/Makefile2:7589: CMakeFiles/hsimple.dir/all] Error 2
make[1]: Target 'all' not remade because of errors.
make[1]: Leaving directory '/mnt/root-build-ubuntu'
make: *** [Makefile:156: all] Error 2
make: Target 'default_target' not remade because of errors.
make: Leaving directory '/mnt/root-build-ubuntu'

Reproducer

# Enable multiarch support for docker (https://hub.docker.com/r/multiarch/qemu-user-static/)
docker run --privileged --rm multiarch/qemu-user-static --reset --persistent yes
# Start ubuntu docker container 
docker run --platform linux/arm64/v8 --rm -it ubuntu:latest
# Install minimal dependencies
apt-get update
apt-get install build-essential git cmake python3
# Clone ROOT to commit just before problem
git clone https://github.com/root-project/root
git -C root reset --hard a886646
# Apply unrelated patch (see below)
sed 's/^    \([^s].*\.cxx\)/    src\/\1/g' hist/hist/CMakeLists.txt
# Configure and build (took 10 hours)
cmake -Broot-build -Sroot -Dasimage=OFF -Dclad=OFF -Ddataframe=OFF -Ddavix=OFF -Dfftw3=OFF -Dgdml=off -Dhttp=off -Dimt=OFF -Dmathmore=OFF -Dminuit2=OFF -Dmlp=OFF -Dopengl=OFF -Dpyroot=OFF -Dpythia8=OFF -Droofit=OFF -Dwebgui=OFF -Droot7=OFF -Dspectrum=OFF -Dsqlite=OFF -Dssl=OFF -Dtmva=OFF -Dtmva-cpu=OFF -Dvdt=OFF -Dx11=OFF -Dxml=OFF -Dxrootd=OFF -DCMAKE_INSTALL_PREFIX=root-install
make -Croot-build -j7 install
# Reset ROOT to next commit, which introduced the problem 
git -C root reset --hard e9d264e
# Apply unrelated patch (see below)
sed 's/^    \([^s].*\.cxx\)/    src\/\1/g' hist/hist/CMakeLists.txt
make -Croot-build -j7 install
# This last command fails

ROOT version

e9d264e, i.e. v6-27-02~243^2~17

Installation method

git clone, cmake, make

Operating system

Linux Ubuntu 23.04

Additional context

Why would you want to do that???

A valid question is why one would want to build ROOT inside a qemu/docker environment where a foreign architecture is emulated? Well, just for this PR in fact, to make it self-contained and (somewhat) debuggable. You can also build a container natively on ARM, upload to docker, and atempt to run ROOT inside that container on a qemu/docker arm64 emulation, with the same results.

Still, why would you want to do that???

We have provided ARM containers for our users at the Electron-Ion Collider for a while now. In the absence of ARM nodes on our container build cluster, we build these using emulation. Aside from a rare major dependency recompile, this works well enough. As of ROOT v6.28 we have had to stop providing ARM images for our users because the C++20 feature of the upgrade was more important than the continued ARM support. Nevertheless, we would like to bring back ARM support.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions