-
Notifications
You must be signed in to change notification settings - Fork 13.4k
clang crashes when using pre-compiled headers and modules at the same time. #121259
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
Comments
@llvm/issue-subscribers-clang-modules Author: None (YiRanMushroom)
I was trying to compile my project using modules and PCMs simultaneously. At first, it was okay, but later, when I used too many modules in a source file, clang crashed, here is the log:
```
FAILED: CMakeFiles/sdl2_games.dir/src/application/application.cppm.obj CMakeFiles/sdl2_games.dir/application.pcm
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -IE:/code/C++/sdl2_games/src/headers -isystem E:/code/C++/sdl2_games/cmake-build-debug/vcpkg_installed/x64-windows-static/include -isystem E:/code/C++/sdl2_games/cmake-build-debug/vcpkg_installed/x64-windows-static/include/SDL2 -O0 -std=gnu++23 -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -g -Xclang -gcodeview -Xclang -include-pch -Xclang E:/code/C++/sdl2_games/cmake-build-debug/CMakeFiles/sdl2_games.dir/cmake_pch.hxx.pch -Xclang -include -Xclang E:/code/C++/sdl2_games/cmake-build-debug/CMakeFiles/sdl2_games.dir/cmake_pch.hxx -MD -MT CMakeFiles/sdl2_games.dir/src/application/application.cppm.obj -MF CMakeFiles\sdl2_games.dir\src\application\application.cppm.obj.d @CMakeFiles\sdl2_games.dir\src\application\application.cppm.obj.modmap -o CMakeFiles/sdl2_games.dir/src/application/application.cppm.obj -c E:/code/C++/sdl2_games/src/application/application.cppm
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: "C:\\Program Files\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.41.34123 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name application.cppm -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -gno-column-info -gcodeview -debug-info-kind=constructor -fdebug-compilation-dir=E:\\code\\C++\\sdl2_games\\cmake-build-debug -object-file-name=E:\\code\\C++\\sdl2_games\\cmake-build-debug\\CMakeFiles\\sdl2_games.dir\\src\\application\\application.cppm.obj -fcoverage-compilation-dir=E:\\code\\C++\\sdl2_games\\cmake-build-debug -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\19" -O0 -std=gnu++23 -fdeprecated-macro -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.41.34123 -fno-implicit-modules -fmodule-file=template_string=CMakeFiles/sdl2_games.dir/template_string.pcm -fmodule-file=SDL2_EventListener=CMakeFiles/sdl2_games.dir/SDL2_EventListener.pcm -fmodule-file=newModule=CMakeFiles/sdl2_games.dir/newModule.pcm -fmodule-file=SDL2_ImGui_VM=CMakeFiles/sdl2_games.dir/SDL2_ImGui_VM.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions --dependent-lib=msvcrtd -gcodeview -include-pch E:/code/C++/sdl2_games/cmake-build-debug/CMakeFiles/sdl2_games.dir/cmake_pch.hxx.pch -include E:/code/C++/sdl2_games/cmake-build-debug/CMakeFiles/sdl2_games.dir/cmake_pch.hxx -faddrsig -o CMakeFiles/sdl2_games.dir/src/application/application.cppm.obj -x pcm CMakeFiles/sdl2_games.dir/application.pcm
Exception Code: 0xC0000005
#0 0x00007ff65a7ad706 (C:\Program Files\LLVM\bin\clang++.exe+0x23cd706)
#1 0x00007ff65b3d59e5 (C:\Program Files\LLVM\bin\clang++.exe+0x2ff59e5)
#2 0x00007ff65b3d47eb (C:\Program Files\LLVM\bin\clang++.exe+0x2ff47eb)
#3 0x00007ff65a7d8e33 (C:\Program Files\LLVM\bin\clang++.exe+0x23f8e33)
#4 0x00007ff65a7dc0b7 (C:\Program Files\LLVM\bin\clang++.exe+0x23fc0b7)
#5 0x00007ff65a7c4bf1 (C:\Program Files\LLVM\bin\clang++.exe+0x23e4bf1)
#6 0x00007ff65b4506e7 (C:\Program Files\LLVM\bin\clang++.exe+0x30706e7)
#7 0x00007ff6589b87fb (C:\Program Files\LLVM\bin\clang++.exe+0x5d87fb)
#8 0x00007ff6589a3703 (C:\Program Files\LLVM\bin\clang++.exe+0x5c3703)
#9 0x00007ff6589a0486 (C:\Program Files\LLVM\bin\clang++.exe+0x5c0486)
#10 0x00007ff65899d445 (C:\Program Files\LLVM\bin\clang++.exe+0x5bd445)
#11 0x00007ff65899bdde (C:\Program Files\LLVM\bin\clang++.exe+0x5bbdde)
#12 0x00007ff65882348a (C:\Program Files\LLVM\bin\clang++.exe+0x44348a)
#13 0x00007ff65881fee3 (C:\Program Files\LLVM\bin\clang++.exe+0x43fee3)
#14 0x00007ff659fe2d58 (C:\Program Files\LLVM\bin\clang++.exe+0x1c02d58)
#15 0x00007ff9f8bc259d (C:\windows\System32\KERNEL32.DLL+0x1259d)
#16 0x00007ff9f91caf38 (C:\windows\SYSTEM32\ntdll.dll+0x5af38)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 19.1.6
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: ninja: build stopped: subcommand failed.
|
Can reproduce it, using pch by itself doesn't crash eg with a Happens on OS X, clang 19 from brew
here's the two files it asked to include
|
It seems, it also duplicates #122285 |
It seems, the issue is fixed in the release LLVM 20.1.2. This issue is closed as completed. In case, there are still problems, we can reopen it. |
Awesome, thank you very much for the heads up @YiRanMushroom , I'll let you know if any issues come up |
I was trying to compile my project using modules and PCMs simultaneously. At first, it was okay, but later, when I used too many modules in a source file, clang crashed, here is the log:
Compiling this file is not easy since other files are needed. However, reproducing the issue is not hard.
application-28b6b0.sh.txt
application-28b6b0.cppm.txt
The text was updated successfully, but these errors were encountered: