debugger
debugger copied to clipboard
Crash when debugging a program headlessly on macOS after reboot
Steps to repro:
- reboot the system
- use a headless script (see below) to debug any program
- the "Developer Tools Access" dialog pops up
- Authenticate as instructed and proceed
- Observe the crash
Notes:
- This only affects headless scripts. In GUI mode, after the authentication, the debugger works normally
- The "Developer Tools Access" dialog only shows up once before the computer reboots. If anyone wants to debug this, please keep it in mind
import binaryninja
from binaryninja.debugger import DebuggerController
bv = binaryninja.load("/Users/xusheng/debugger_build/debugger/test/binaries/Darwin-arm64-signed/helloworld")
dc = DebuggerController(bv)
dc.adapter_type = 'LLDB'
# Launch the target
if dc.launch_and_wait():
print("Launch successful.")
# Resume execution and wait for the target to stop
stop_reason = dc.go_and_wait()
# After the target has stopped
print(f"Stop Reason: {dc.stop_reason_str}")
else:
print("Failed to launch the target.")
print("Done!")
I cannot seem to get a reliable repro of this -- though I definitely get it at least once