Skip to content
New issue

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

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

Already on GitHub? # to your account

Segmentation fault during compilation #1064

Open
bearbones opened this issue Dec 12, 2024 · 1 comment
Open

Segmentation fault during compilation #1064

bearbones opened this issue Dec 12, 2024 · 1 comment

Comments

@bearbones
Copy link

bearbones commented Dec 12, 2024

Possibly related to bad path resolution when compiling with PCH or file prefix maps.

[1]   #0 0x00007f08d8f10871 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xd26871)
[1]   #1 0x00007f08d8f0e9a0 llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xd249a0)
[1]   #2 0x00007f08d8f10f82 (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xd26f82)
[1]   #3 0x00007f08e0a5b420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
[1]   #4 0x00007f08d3989a84 (/usr/lib/mull-ir-frontend-12+0x113a84)
[1]   #5 0x00007f08d3989c67 (/usr/lib/mull-ir-frontend-12+0x113c67)
[1]   #6 0x00007f08d38d0c6f (/usr/lib/mull-ir-frontend-12+0x5ac6f)
[1]   #7 0x00007f08d3956cf9 (/usr/lib/mull-ir-frontend-12+0xe0cf9)
[1]   #8 0x00007f08d80dedf4 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd6df4)
[1]   #9 0x00007f08e0a4f609 start_thread /build/glibc-LcI20x/glibc-2.31/nptl/pthread_create.c:478:7
[1]  #10 0x00007f08d7dc9353 clone /build/glibc-LcI20x/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97:0
[1]  Segmentation fault (core dumped)

Can't include proprietary project info, but here are some of the compiler flags passed to clang++-12
-O0 -fexperimental-new-pass-manager -fpass-plugin=/usr/lib/mull-ir-frontend-12 -g -grecord-command-line -fvisibility=hidden -stdlib=libc++ -msse4 -fstack-protector -D_FORTIFY_SOURCE=2 -fcolor-diagnostics -O0 -DNDEBUG -D_NOOPT -std=c++17 -fcolor-diagnostics -Wrange-loop-analysis -Wimplicit-fallthrough -fno-standalone-debug -Xclang -fuse-ctor-homing -ggdb -g -fno-math-errno -ffp-contract=off -Wall -Werror -Wno-unknown-warning-option -Wno-unused-but-set-variable -faligned-allocation -DRBX_CONFIG_NOOPT -DLOVE_ALL_ACCESS -fPIC -Winvalid-pch -Xclang -include-pch -Xclang /home/.../build/ninja/common-tests/x86_64/noopt/PCH/CMakeFiles/default_pch_STATIC.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/.../build/ninja/common-tests/x86_64/noopt/PCH/CMakeFiles/default_pch_STATIC.dir/cmake_pch.hxx -MD -MT Base/CMakeFiles/Base.dir/src/***.cpp.o -MF Base/CMakeFiles/Base.dir/src/***.cpp.o.d -o Base/CMakeFiles/Base.dir/src/***.cpp.o -c /home/.../***.cpp

I had passed -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON to stop this happening to another file, and it worked, but there are still PCH-related args on this command line so I guess it didn't stick for everything.

@AlexDenisov
Copy link
Member

AlexDenisov commented Dec 14, 2024

Hi @bearbones, thanks for the report! I added a test case with PCH, but it is perhaps too simple to trigger the issue you're observing.
I'd appreciate if you can reduce the crash on your setup to a small reproducible sample, it would help a lot on fixing this specific issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants