Crash with emscripten when compiling C++ file
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
I noticed that clang (through emscripten) crashed when compiling a specific file and asked me to submit a bug report here, so here it is:
```sh
> ninja vtkWebAssembly
[4/6] Building CXX object Rendering/GridAxes/CMakeFiles/vtkRenderingGridAxes.dir/vtkGridAxesActor3DSerDes.cxx.o
FAILED: [code=1] Rendering/GridAxes/CMakeFiles/vtkRenderingGridAxes.dir/vtkGridAxesActor3DSerDes.cxx.o
D:\dev\vtk\.gitlab\emsdk\upstream\emscripten\em++.bat @Rendering\GridAxes\CMakeFiles\vtkRenderingGridAxes.dir\vtkGridAxesActor3DSerDes.cxx.o.rsp -MD -MT Rendering/GridAxes/CMakeFiles/vtkRenderingGridAxes.dir/vtkGridAxesActor3DSerDes.cxx.o -MF Rendering\GridAxes\CMakeFiles\vtkRenderingGridAxes.dir\vtkGridAxesActor3DSerDes.cxx.o.d -o Rendering/GridAxes/CMakeFiles/vtkRenderingGridAxes.dir/vtkGridAxesActor3DSerDes.cxx.o -c D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/GridAxes/vtkGridAxesActor3DSerDes.cxx
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: D:\\dev\\vtk\\.gitlab\\emsdk\\upstream\\bin\\clang++.exe -target wasm32-unknown-emscripten -mllvm -combiner-global-alias-analysis=false -mllvm -wasm-enable-sjlj -mllvm -wasm-use-legacy-eh -mllvm -disable-lsr --sysroot=D:\\dev\\vtk\\.gitlab\\emsdk\\upstream\\emscripten\\cache\\sysroot -DEMSCRIPTEN -Xclang -iwithsysroot/include\\fakesdl -Xclang -iwithsysroot/include\\compat -DSCN_DISABLE_FAST_FLOAT=0 -DSCN_DISABLE_REGEX=0 -DSCN_REGEX_BACKEND=0 -Dkiss_fft_scalar=double -ID:/dev/vtk/Rendering/GridAxes -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/GridAxes -ID:/dev/vtk/Charts/Core -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Charts/Core -ID:/dev/vtk/Common/Core -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Common/Core -ID:/dev/vtk/ThirdParty/fmt/vtkfmt -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/fmt/vtkfmt -ID:/dev/vtk/ThirdParty/nlohmannjson/vtknlohmannjson -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/nlohmannjson/vtknlohmannjson -ID:/dev/vtk/ThirdParty/nlohmannjson/vtknlohmannjson/include -ID:/dev/vtk/ThirdParty/scn/vtkscn -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/scn/vtkscn -ID:/dev/vtk/ThirdParty/scn/vtkscn/include -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/scn/vtkscn/include -ID:/dev/vtk/ThirdParty/token/vtktoken/token -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/token/vtktoken/token -ID:/dev/vtk/ThirdParty/token/vtktoken -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/token/vtktoken -ID:/dev/vtk/Common/DataModel -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Common/DataModel -ID:/dev/vtk/Common/Math -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Common/Math -ID:/dev/vtk/ThirdParty/kissfft/vtkkissfft -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/kissfft/vtkkissfft -ID:/dev/vtk/Common/Transforms -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Common/Transforms -ID:/dev/vtk/Filters/General -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Filters/General -ID:/dev/vtk/Common/ExecutionModel -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Common/ExecutionModel -ID:/dev/vtk/Common/Misc -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Common/Misc -ID:/dev/vtk/Filters/Core -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Filters/Core -ID:/dev/vtk/Rendering/Context2D -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/Context2D -ID:/dev/vtk/Rendering/Core -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/Core -ID:/dev/vtk/Filters/Sources -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Filters/Sources -ID:/dev/vtk/Imaging/Color -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Imaging/Color -ID:/dev/vtk/Imaging/Core -ID:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Imaging/Core -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/fast_float -isystem D:/dev/vtk/ThirdParty/fast_float -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/fmt -isystem D:/dev/vtk/ThirdParty/fmt -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Utilities/KWIML -isystem D:/dev/vtk/Utilities/KWIML -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/nlohmannjson -isystem D:/dev/vtk/ThirdParty/nlohmannjson -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/scn -isystem D:/dev/vtk/ThirdParty/scn -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/token -isystem D:/dev/vtk/ThirdParty/token -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Utilities/KWSys -isystem D:/dev/vtk/Utilities/KWSys -isystem D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/ThirdParty/kissfft -isystem D:/dev/vtk/ThirdParty/kissfft -fwasm-exceptions -O2 -g -DNDEBUG -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT Rendering/GridAxes/CMakeFiles/vtkRenderingGridAxes.dir/vtkGridAxesActor3DSerDes.cxx.o -MF Rendering\\GridAxes\\CMakeFiles\\vtkRenderingGridAxes.dir\\vtkGridAxesActor3DSerDes.cxx.o.d -oRendering/GridAxes/CMakeFiles/vtkRenderingGridAxes.dir/vtkGridAxesActor3DSerDes.cxx.o -c D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/GridAxes/vtkGridAxesActor3DSerDes.cxx
1. parser at end of file
2. Optimizer
3. Running pass "require,function(invalidate),require,cgscc(devirt<4>(inline,function-attrs,openmp-opt-cgscc,function(sroa,early-cse,speculative-execution,jump-threading,correlated-propagation,simplifycfg,instcombine,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm,loop-rotate,licm,simple-loop-unswitch),simplifycfg,instcombine,loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-deletion,loop-unroll-full),sroa,vector-combine,mldst-motion,gvn<>,sccp,bdce,instcombine,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm),coro-elide,simplifycfg,instcombine),function-attrs,function(require),coro-split,coro-annotation-elide)),function(invalidate),cgscc(devirt<4>())" on module "D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/GridAxes/vtkGridAxesActor3DSerDes.cxx"
4. Running pass "cgscc(devirt<4>(inline,function-attrs,openmp-opt-cgscc,function(sroa,early-cse,speculative-execution,jump-threading,correlated-propagation,simplifycfg,instcombine,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm,loop-rotate,licm,simple-loop-unswitch),simplifycfg,instcombine,loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-deletion,loop-unroll-full),sroa,vector-combine,mldst-motion,gvn<>,sccp,bdce,instcombine,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm),coro-elide,simplifycfg,instcombine),function-attrs,function(require),coro-split,coro-annotation-elide))" on module "D:/dev/vtk/out/build/wasmSerDesSync/RelWithDebInfo/Rendering/GridAxes/vtkGridAxesActor3DSerDes.cxx"
5. Running pass "correlated-propagation" on function "_ZL38Invoke_vtkGridAxesActor3D_SetYNotationP10vtkInvokerP18vtkGridAxesActor3DRKN11vtknlohmann16json_abi_v3_11_310basic_jsonINSt3__23mapENS6_6vectorENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEbxydSC_NS4_14adl_serializerENS8_IhNSC_IhEEEEvEERSI_"
Exception Code: 0xC000001D
#0 0x00007ff6358908e4 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x1708e4)
#1 0x00007ff63589292a (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x17292a)
#2 0x00007ff63588db31 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x16db31)
#3 0x00007ff635898a42 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x178a42)
#4 0x00007ff63589ac22 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x17ac22)
#5 0x00007ff63911d188 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x39fd188)
#6 0x00007ff63911c932 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x39fc932)
#7 0x00007ff635e4a05b (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x72a05b)
#8 0x00007ff63737f2e1 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x1c5f2e1)
#9 0x00007ff63737b68e (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x1c5b68e)
#10 0x00007ff63737dc54 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x1c5dc54)
#11 0x00007ff63737d26e (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x1c5d26e)
#12 0x00007ff635e48f47 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x728f47)
#13 0x00007ff638fb0c74 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x3890c74)
#14 0x00007ff635e48f47 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x728f47)
#15 0x00007ff6368a6ee2 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x1186ee2)
#16 0x00007ff63689d6a7 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x117d6a7)
#17 0x00007ff636c472cf (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x15272cf)
#18 0x00007ff63858a077 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x2e6a077)
#19 0x00007ff636b7cbf2 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x145cbf2)
#20 0x00007ff635c5304d (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x53304d)
#21 0x00007ff635d022b4 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x5e22b4)
#22 0x00007ff6357280b3 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x80b3)
#23 0x00007ff6357239ec (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x39ec)
#24 0x00007ff6357261eb (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x61eb)
#25 0x00007ff6368c9f3d (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x11a9f3d)
#26 0x00007ff6368c9659 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x11a9659)
#27 0x00007ff635c3a177 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x51a177)
#28 0x00007ff635c3a41d (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x51a41d)
#29 0x00007ff635c1933b (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x4f933b)
#30 0x00007ff63572316e (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x316e)
#31 0x00007ff635738cc7 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x18cc7)
#32 0x00007ff639d0a670 (D:\dev\vtk\.gitlab\emsdk\upstream\bin\clang++.exe+0x45ea670)
#33 0x00007ff897c4e8d7 (C:\WINDOWS\System32\KERNEL32.DLL+0x2e8d7)
#34 0x00007ff898fac48c (C:\WINDOWS\SYSTEM32\ntdll.dll+0x8c48c)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 22.0.0git (https:/github.com/llvm/llvm-project d163988dd2833f28fbca8c144265108d25ae7bd2)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\dev\vtk\.gitlab\emsdk\upstream\bin
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: C:\Users\JASWAN~1.PAN\AppData\Local\Temp\vtkGridAxesActor3DSerDes-080608.cpp
clang++: note: diagnostic msg: C:\Users\JASWAN~1.PAN\AppData\Local\Temp\vtkGridAxesActor3DSerDes-080608.sh
clang++: note: diagnostic msg:
********************
ninja: build stopped: subcommand failed.
```
The .cpp file is 11.9 MB and github fails to upload it. Here is a compressed zip with both the .cpp and .sh files
[vtkGridAxesActor3DSerDes-080608.zip](https://github.com/user-attachments/files/26726928/vtkGridAxesActor3DSerDes-080608.zip)
Contributor guide
Assessment
This issue has not been assessed yet.