-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
Description
Starting with LLDB 21, calling RunCommandInterpreter crashes when
the debugger's output and error streams are initialized using
lldb.SBFile.Create(..., force_io_methods=True) in Python.
The same code works correctly on LLDB 20.
Removing force_io_methods=True (or explicitly setting it to False)
avoids the crash, indicating a regression in LLDB's handling of SBFile
IO redirection.
Probably regression is introduced by:
58279d1
Affected Versions
- LLDB 20 -- OK
- LLDB 21 -- CRASH when invoking
RunCommandInterpreter
Tested on:
- Fedora 42 (lldb-20) --- works
- Fedora 43 (lldb-21) --- crashes
Install using:
dnf install lldb -yMinimal Reproduction
import lldb
import sys
lldb.SBDebugger.Initialize()
debugger = lldb.SBDebugger.Create()
debugger.SetOutputFile(lldb.SBFile.Create(sys.stdout, borrow=True, force_io_methods=True))
debugger.SetErrorFile(lldb.SBFile.Create(sys.stderr, borrow=True, force_io_methods=True))
# CRASHES on LLDB 21
debugger.RunCommandInterpreter(
True, False,
lldb.SBCommandInterpreterRunOptions(),
0, False, False
)Notes
- If
force_io_methods=Trueis removed or set toFalse, no crash occurs. - The crash happens immediately upon entering
RunCommandInterpreter.
Expected Behavior
RunCommandInterpreter should run normally, as it does in LLDB 20.
Additional context
stdout and stderr is null, crash SIGSEGV