-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ld64.lld.darwinnew crashes linking __DWARF,__debug_ranges section #47736
Comments
assigned to @int3 |
If you set |
Symbolized stack: #0 0x00000000026a7610 in lld::macho::InputSection::getVA at ../../lld/MachO/InputSection.cpp:29 So we're trying to sort the synthetic section locations and then hit an InputSection without parent. It's a debug section: (gdb) p this->name |
Here's a small stand-alone repro: $ cat test.cc $ out/gn/bin/clang --target=x86_64-apple-macos test.cc -g -c $ out/gn/bin/ld64.lld.darwinnew -dylib test.o |
This assert finds the parent-less InputSection Location that we later crash on: $ git diff
It's hit here (with the repro in comment 8), and adding an Should we link __DWARF,__debug_ranges at all or should we just refer to the .o files like with other debug info? (I don't know the debug info handling of the linker well.) |
I used the open-source clang. The most interesting flags are probably: |
We don't emit any debug info section, including |
Extended Description
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: /Users/xxx/modules/clang/git/bin/ld64.lld.darwinnew -demangle -dynamic -arch x86_64 -platform_version macos 11.0.0 11.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o btm -L/Users/xxx/modules/clang/git/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/ lib/Support/ErrorHandling.o lib/Support/MemAlloc.o lib/Support/SmallVector.o lib/Utilities/util.o lib/Checker/checker.o lib/Transactions/GlobalTransaction.o lib/main.o -lc++ -lSystem
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var
LLVM_SYMBOLIZER_PATH
to point to it):0 ld64.lld.darwinnew 0x00000001047b6977 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1 ld64.lld.darwinnew 0x00000001047b576a llvm::sys::RunSignalHandlers() + 250
2 ld64.lld.darwinnew 0x00000001047b71d6 SignalHandler(int) + 262
3 libsystem_platform.dylib 0x00007fff20374d7d _sigtramp + 29
4 libsystem_platform.dylib 0x4a8aa596003452d8 _sigtramp + 5371146835525961080
5 ld64.lld.darwinnew 0x0000000104a96c44 unsigned int std::__1::__sort3<lld::macho::RebaseSection::finalizeContents()::$_0&, lld::macho::Location*>(lld::macho::Location*, lld::macho::Location*, lld::macho::Location*, lld::macho::RebaseSection::finalizeContents()::$_0&) + 52
6 ld64.lld.darwinnew 0x0000000104a96eb3 unsigned int std::__1::__sort4<lld::macho::RebaseSection::finalizeContents()::$_0&, lld::macho::Location*>(lld::macho::Location*, lld::macho::Location*, lld::macho::Location*, lld::macho::Location*, lld::macho::RebaseSection::finalizeContents()::$_0&) + 35
7 ld64.lld.darwinnew 0x0000000104a97077 unsigned int std::__1::__sort5<lld::macho::RebaseSection::finalizeContents()::$_0&, lld::macho::Location*>(lld::macho::Location*, lld::macho::Location*, lld::macho::Location*, lld::macho::Location*, lld::macho::Location*, lld::macho::RebaseSection::finalizeContents()::$_0&) + 39
8 ld64.lld.darwinnew 0x0000000104a9634d void std::__1::__sort<lld::macho::RebaseSection::finalizeContents()::$_0&, lld::macho::Location*>(lld::macho::Location*, lld::macho::Location*, lld::macho::RebaseSection::finalizeContents()::$_0&) + 157
9 ld64.lld.darwinnew 0x0000000104a90b64 lld::macho::RebaseSection::finalizeContents() + 180
10 ld64.lld.darwinnew 0x0000000104a9e68e lld::macho::writeResult() + 7358
11 ld64.lld.darwinnew 0x0000000104a7bdab lld::macho::link(llvm::ArrayRef<char const*>, bool, llvm::raw_ostream&, llvm::raw_ostream&) + 15291
12 ld64.lld.darwinnew 0x00000001046a522b lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) + 1163
13 ld64.lld.darwinnew 0x00000001046a4c65 main + 245
14 libdyld.dylib 0x00007fff2034b631 start + 1
clang-12: error: unable to execute command: Segmentation fault: 11
clang-12: error: linker command failed due to signal (use -v to see invocation)
make: *** [btm] Error 254
The text was updated successfully, but these errors were encountered: