As noticed in D87637, when LLDB crashes, we only print stack traces if LLDB is directly executed, not when used via Python bindings. Enabling this by default may be undesirable (libraries shouldn't be messing with signal handlers), so make this an explicit opt-in.
When adding an abort() to CommandInterpreter::HandleCommand(), this prints:
$ ninja check-lldb-api-commands-apropos-basic FAIL: lldb-api :: commands/apropos/basic/TestApropos.py (1 of 1) ******************** TEST 'lldb-api :: commands/apropos/basic/TestApropos.py' FAILED ******************** ... Command Output (stderr): -- python3.8: /home/rupprecht/src/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1655: bool lldb_private::CommandInterpreter::HandleCommand(const char *, lldb_private::LazyBool, lldb_private::CommandReturnObject &, lldb_private::ExecutionContext *, bool, bool): Assertion `false && "crash!"' failed. PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace. Stack dump: 0. HandleCommand(command = "settings clear -all") #0 0x00007f1e9a0ff4ea llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/rupprecht/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:11 #1 0x00007f1e9a0ff6bb PrintStackTraceSignalHandler(void*) /home/rupprecht/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:630:1 #2 0x00007f1e9a0fdcdb llvm::sys::RunSignalHandlers() /home/rupprecht/src/llvm-project/llvm/lib/Support/Signals.cpp:70:5 #3 0x00007f1e9a0ffded SignalHandler(int) /home/rupprecht/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:405:1 ... #9 0x00007f1e997e6228 /home/rupprecht/src/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1655:3
I'm also not sure, but I guess this should be coming after the reproducer initialization code (below).