[Lldb-commits] [lldb] [lldb/aarch64] Fix unwinding when signal interrupts a leaf function (PR #91321)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Fri May 10 16:05:17 PDT 2024


jasonmolenda wrote:

> I have fixed/worked around the mach exception issue in a [followup commit](https://github.com/llvm/llvm-project/commit/b903badd73a2467fdd4e363231f2bf9b0704b546) with a `settings set platform.plugin.darwin.ignored-exceptions EXC_BAD_INSTRUCTION`. Now the process gets a SIGILL as expected, but it still fails at the backtrace step (the second one, after stopping inside the handler).

Oh, that's a clever idea, I forgot about that setting.

If you add `process handle -p true -s false SIGILL` (lldb was stopping on the SIGILL signal before sigtramp / the registered handler ran), then sigill_handler is called,

```
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x0000000100003f4c a.out`sigill_handler(signo=4) + 20 at signal-in-leaf-function-aarch64.c:10
    frame #1: 0x0000000197f93584 libsystem_platform.dylib`_sigtramp + 56
    frame #2: 0x0000000100003f7c a.out`main + 44 at signal-in-leaf-function-aarch64.c:14
    frame #3: 0x0000000197bda0e0 dyld`start + 2360
```

https://github.com/llvm/llvm-project/pull/91321


More information about the lldb-commits mailing list