Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when building with the mold linker #15473

Closed
1 task done
jmcarcell opened this issue May 9, 2024 · 5 comments
Closed
1 task done

Segmentation fault when building with the mold linker #15473

jmcarcell opened this issue May 9, 2024 · 5 comments
Assignees
Labels

Comments

@jmcarcell
Copy link
Contributor

jmcarcell commented May 9, 2024

Check duplicate issues.

  • Checked for duplicates

Description

When using the mold linker there is a segmentation fault when running rootcling, like here

[7643/9449] Generating G__RHTTP.cxx, ../../lib/RHTTP.pcm
FAILED: net/http/G__RHTTP.cxx lib/RHTTP.pcm /root/builddir/net/http/G__RHTTP.cxx /root/builddir/lib/RHTTP.pcm
cd /root/builddir/net/http && /usr/bin/cmake -E env LD_LIBRARY_PATH=/root/builddir/lib:/usr/local/lib: ROOTIGNOREPREFIX=1 /root/builddir/bin/rootcling -rootbuild -v2 -f G__RHTTP.cxx -cxxmodule -s /root/builddir/lib/libRHTTP.so -m RIO.pcm -m Thread.pcm -excludePath /root -excludePath /root/builddir/ginclude -excludePath /root/builddir/externals -excludePath /root/builddir/builtins -DUSE_WEBSOCKET -DUSE_X_DOM_SOCKET -DNO_SSL -DHTTP_WITHOUT_FASTCGI -compilerI/usr/include/c++/14.1.1 -compilerI/usr/include/c++/14.1.1/x86_64-pc-linux-gnu -compilerI/usr/include/c++/14.1.1/backward -compilerI/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include -compilerI/usr/local/include -compilerI/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed -compilerI/usr/include -compilerI/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include -compilerI/usr/local/include -compilerI/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed -compilerI/usr/include -I/root/builddir/include -I/usr/include -I/root/net/http/inc -I/root/core/unix/../clib/res -I/root/core/unix/inc -I/usr/include -I/root/core/zstd/inc -I/root/core/lz4/inc -I/root/core/lzma/inc -I/root/core/zip/inc -I/root/core/thread/inc -I/root/core/textinput/src -I/root/core/textinput/inc -I/root/core/rint/inc -I/root/core/meta/inc -I/root/core/gui/inc -I/root/core/foundation/res -I/root/core/foundation/v7/inc -I/root/core/foundation/inc -I/root/core/cont/inc -I/root/core/clingutils/res -I/root/core/clingutils/inc -I/root/core/clib/inc -I/root/core/base/v7/inc -I/root/core/base/inc -I/root/builddir/ginclude -I/root/io/io/v7/inc -I/root/io/io/inc -I/root/core/clib/res THttpCallArg.h THttpEngine.h THttpServer.h THttpWSHandler.h TRootSniffer.h TRootSnifferStore.h /root/net/http/inc/LinkDef.h
Segmentation fault

I haven't tried with lld to see if it also doesn't build. This is certainly not very important, but I'm reporting here in case someone else finds this. EDIT: lld works fine for me.

Reproducer

# Install mold and have it available in PATH, for example in /usr/bin
export LDFLAGS="-fuse-ld=mold"
# from the root source
mkdir builddir
cd builddir
cmake .. DCMAKE_CXX_STANDARD=20 -Dminimal=ON -G Ninja
ninja

ROOT version

master, any recent one also doesn't work

Installation method

Build from source

Operating system

Linux (Arch)

Additional context

I'm compiling with GCC 13 and 14

@jmcarcell jmcarcell added the bug label May 9, 2024
@dpiparo
Copy link
Member

dpiparo commented May 10, 2024

Hi @jmcarcell , how is the linker related to the command that fails for you? That is the invocation of rootcling, the generator of dictionaries. Could you confirm that the problem is there also if you do not export the LDFLAGS env variable?

@jmcarcell
Copy link
Contributor Author

I have no idea why that's happening but it's definitely that because building with LDFLAGS empty (so using /usr/bin/ld) works fine. I just checked and using lld works fine, I'll add to the issue.

@jmcarcell
Copy link
Contributor Author

jmcarcell commented May 31, 2024

I reported this to mold in rui314/mold#1270 and was able to compile by using a different linker for libCling.so. However, many of the tests fail (with segmentation faults) so I think it's best not to allow compiling with mold at all.

@guitargeek guitargeek added this to Issues in Fixed in 6.32.02 via automation Jun 1, 2024
@guitargeek
Copy link
Contributor

Closed by #15689 and it's backport to 6.32.

@vgvassilev
Copy link
Member

We should apply the suggested fix in the bugreport submitted to the mold linker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

4 participants