Issue |
56095
|
Summary |
LLDB fails to unwind through ntdll KiUserExceptionDispatcher/RtlWalkFrameChain
|
Labels |
lldb,
platform:windows
|
Assignees |
|
Reporter |
mstorsjo
|
Unwinding through ntdll's KiUserExceptionDispatcher/RtlWalkFrameChain function seems to fail in LLDB, but works with GDB.
To reproduce, use this attached test exe,
[hello-exception.exe.zip](https://github.com/llvm/llvm-project/files/8931134/hello-exception.exe.zip), set a breakpoint at `_GCC_specific_handler` and run it, and print a back trace.
```
> lldb hello-exception.exe
(lldb) target create "hello-exception.exe"
(rrent executable set to 'C:\code\hello-exception.exe' (x86_64).
(lldb) b _GCC_specific_handler
Breakpoint 1: where = hello-exception.exe`_GCC_specific_handler, address = 0x0000000140005da0
(lldb) r
Process 1168 launched: 'C:\code\hello-exception.exe' (x86_64)
Process 1168 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x00007ff65ba55da0 hello-exception.exe`_GCC_specific_handler
hello-exception.exe`_GCC_specific_handler:
-> 0x7ff65ba55da0 <+0>: pushq %r15
0x7ff65ba55da2 <+2>: pushq %r14
0x7ff65ba55da4 <+4>: pushq %r13
0x7ff65ba55da6 <+6>: pushq %r12
(lldb) bt
* thread #1, stop reason = breakpoint 1.1
* frame #0: 0x00007ff65ba55da0 hello-exception.exe`_GCC_specific_handler
frame #1: 0x00007ff65ba53fe5 hello-exception.exe`__gxx_personality_seh0 + 21
frame #2: 0x00007ffb5af146af ntdll.dll`__chkstk + 287
frame #3: 0x00007ffb5ae74bef ntdll.dll`RtlWalkFrameChain + 5311
```
With the same sequence of commands in GDB, we get a backtrace that does include the earlier part of the call stack too:
```
> gdb hello-exception.exe
GNU gdb (GDB) 12.1
[...]
(gdb) b _GCC_specific_handler
Breakpoint 1 at 0x140005db3
(gdb) r
Starting program: C:\code\hello-exception.exe
[New Thread 5440.0x5b4]
ctor 10
ctor 9
ctor 8
ctor 7
ctor 6
ctor 5
ctor 4
ctor 3
ctor 2
ctor 1
ctor 0
Thread 1 hit Breakpoint 1, 0x00007ff65ba55db3 in _GCC_specific_handler ()
(gdb) bt
#0 0x00007ff65ba55db3 in _GCC_specific_handler ()
#1 0x00007ff65ba53fe5 in __gxx_personality_seh0 ()
#2 0x00007ffb5af146af in ntdll!.chkstk () from C:\Windows\SYSTEM32\ntdll.dll
#3 0x00007ffb5ae74bef in ntdll!RtlWalkFrameChain () from C:\Windows\SYSTEM32\ntdll.dll
#4 0x00007ffb5af1341e in ntdll!KiUserExceptionDispatcher () from C:\Windows\SYSTEM32\ntdll.dll
#5 0x00007ffb57199129 in RaiseException () from C:\Windows\System32\KernelBase.dll
#6 0x00007ff65ba5633a in _Unwind_RaiseException ()
#7 0x00007ff65ba53b23 in __cxa_throw ()
#8 0x00007ff65ba51517 in recurse (val=0) at hello-exception.cpp:59
#9 0x00007ff65ba5160f in recurse (val=1) at hello-exception.cpp:68
#10 0x00007ff65ba5160f in recurse (val=2) at hello-exception.cpp:68
#11 0x00007ff65ba5160f in recurse (val=3) at hello-exception.cpp:68
#12 0x00007ff65ba5160f in recurse (val=4) at hello-exception.cpp:68
#13 0x00007ff65ba51541 in recurse (val=5) at hello-exception.cpp:62
#14 0x00007ff65ba5160f in recurse (val=6) at hello-exception.cpp:68
#15 0x00007ff65ba5160f in recurse (val=7) at hello-exception.cpp:68
#16 0x00007ff65ba5160f in recurse (val=8) at hello-exception.cpp:68
#17 0x00007ff65ba5160f in recurse (val=9) at hello-exception.cpp:68
#18 0x00007ff65ba5160f in recurse (val=10) at hello-exception.cpp:68
#19 0x00007ff65ba51831 in main (argc=1, argv=0x1fc5b559290) at hello-exception.cpp:95
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs