Closed
Description
Here is a working reproducer for a segfault in lld.
I tested 17.0.6 and 18.1.2. Both are crashing. I don't know if this has been reported upstream before.
The crash goes away when I remove either line from the CMakeLists.txt
add_link_options(-Wl,--gc-sections)
add_compile_options(-ffunction-sections -fdata-sections)
It also does not crash when building in release mode without -g
git clone --recursive https://github.com/nidefawl/vst3-lld-crash.git
C:\dev\vst3-lld-crash>cmake -G"Ninja Multi-Config" -S . -Bbuild
-- The C compiler identification is Clang 18.1.2
-- The CXX compiler identification is Clang 18.1.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/dev/bin/llvm-mingw-20240320-ucrt-x86_64/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/dev/bin/llvm-mingw-20240320-ucrt-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [SMTG] SMTG_AAX_SDK_PATH is not set. If you need it, please download the AAX SDK!
-- Could NOT find LIBJACK (missing: LIBJACK_LIBRARIES LIBJACK_INCLUDE_DIR)
-- Performing Test SMTG_USE_STDATOMIC_H
-- Performing Test SMTG_USE_STDATOMIC_H - Success
-- Configuring done (1.6s)
-- Generating done (0.2s)
-- Build files have been written to: C:/dev/vst3-lld-crash/build
C:\dev\vst3-lld-crash>cmake --build build --config Debug --target test_vst3sdk
...
5 warnings generated.
[38/38 100% :: 4.379] Linking CXX executable Debug\test_vst3sdk.exe
FAILED: Debug/test_vst3sdk.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\dev\bin\llvm-mingw-20240320-ucrt-x86_64\bin\clang++.exe -g -Wl,--gc-sections CMakeFiles/test_vst3sdk.dir/Debug/main.cpp.obj -o Debug\test_vst3sdk.exe -Wl,--out-implib,Debug\libtest_vst3sdk.dll.a -Wl,--major-image-version,0,--minor-image-version,0 lib/Debug/libsdk_hosting.a lib/Debug/libsdk_common.a lib/Debug/libbase.a lib/Debug/libpluginterfaces.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Exception Code: 0xC0000005
#0 0x00007ff7df950145 (C:\dev\bin\llvm-mingw-20240320-ucrt-x86_64\bin\ld.lld.exe+0x2d0145)
#1 0x00007ff95a6d3efd std::__1::deque<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()>>>::__add_back_capacity() (C:\dev\bin\llvm-mingw-20240320-ucrt-x86_64\bin\libLLVM-18.dll+0xd3efd)
#2 0x00007ff95a6d3e0c std::__1::deque<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()>>>::__add_back_capacity() (C:\dev\bin\llvm-mingw-20240320-ucrt-x86_64\bin\libLLVM-18.dll+0xd3e0c)
#3 0x00007ff95a6d27f5 std::__1::vector<std::__1::thread, std::__1::allocator<std::__1::thread>>::__append(unsigned long long) (C:\dev\bin\llvm-mingw-20240320-ucrt-x86_64\bin\libLLVM-18.dll+0xd27f5)
#4 0x00007ff95a6d29b0 std::__1::vector<std::__1::thread, std::__1::allocator<std::__1::thread>>::__append(unsigned long long) (C:\dev\bi
ninja: build stopped: subcommand failed.
n\llvm-mingw-20240320-ucrt-x86_64\bin\libLLVM-18.dll+0xd29b0)
#5 0x00007ff99df81bb2 (C:\WINDOWS\System32\ucrtbase.dll+0x21bb2)
#6 0x00007ff99e377344 (C:\WINDOWS\System32\KERNEL32.DLL+0x17344)
#7 0x00007ff9a00826b1 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x526b1)
clang-18: error: linker command failed due to signal (use -v to see invocation)
Metadata
Metadata
Assignees
Labels
No labels