MINGW-packages: mingw-w64-x86_64-lldb Segmentation fault

What did I do wrong that the LLDB never worked properly. I don’t know what useful thing to offer.

Administrator@WIN-6HQQN44B4H7 MINGW64 ~ $ lldb --version

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: D:\\msys64\\mingw64\\bin\\lldb.exe --version
#0 0x00007ff81d460000
#1 0x00007ff87d8535f5 (D:\msys64\mingw64\bin\liblldb.dll+0x835f5)
#2 0x00007ff87d86c9b8 (D:\msys64\mingw64\bin\liblldb.dll+0x9c9b8)
#3 0x00007ff7c416db74 (D:\msys64\mingw64\bin\lldb.exe+0xdb74)
#4 0x00007ff7c41613c1 (D:\msys64\mingw64\bin\lldb.exe+0x13c1)
#5 0x00007ff7c41614f6 (D:\msys64\mingw64\bin\lldb.exe+0x14f6)
#6 0x00007ff8c4dd7974 (C:\WINDOWS\System32\KERNEL32.DLL+0x17974)
#7 0x00007ff8c7bea2f1 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x5a2f1)
Segmentation fault

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 51 (39 by maintainers)

Commits related to this issue

Most upvoted comments

It seems plausible that this is caused by issues with the weak variables. Cross-object file TLS variables for sure use a large combination of various tricky features.

Also regarding https://sourceware.org/bugzilla/show_bug.cgi?id=26659, I think that issue can be solved more neatly if the possibly-null weak function reference is accessed via a .refptr stub (Clang does this), like for other variables that can be further away than 4 GB (for possibly autoimported variables).

You can try https://martin.st/temp/0001-WIP-lldb-Make-the-thread_local-g_global_boundary-acc.patch, which moves this variable into a static thread_local inside one single .cpp only, which should make the codegen for the variable much more straightforward.

I also made https://martin.st/temp/tlstest2.zip, which is a small easier to handle testcase for cross-object file TLS variables, that I made when I had to fix details regarding this for mingw targets in LLVM/LLD. (LLVM used to have a similar cross-object TLS variable somewhere in the Support library, which was what forced me to fix it, but that might have been reverted/restructured later.)