rizin icon indicating copy to clipboard operation
rizin copied to clipboard

Signal Handler Skipping Logic Issue

Open well-mannered-goat opened this issue 3 months ago • 0 comments

The current signal handling implementation incorrectly skips instructions when a signal handler is marked to be bypassed. This approach works for instruction-triggered signals (e.g., SIGSEGV from memory access) but fails for manually sent signals via kill().

Current Behavior

  • Signal marked to skip in sdb
  • Debugger skips the "triggering" instruction to avoid re-receiving signal
  • Works: Hardware exceptions (SIGSEGV, SIGFPE, etc.)
  • Fails: Manual signals (kill -SIGNAL pid) - causes debuggee to miss one instruction execution

This can cause execution flow corruption when signal is sent manually.

Related to rz_debug_continue_kill()

Signal handling should distinguish between instruction-triggered and external signals, applying instruction skipping only when appropriate.

Broken tests marked due to this are: test/db/archos/linux-ppc/dbg_sig test/db/archos/linux-x64/dbg test/db/archos/linux-x64/dbg_cont_back

well-mannered-goat avatar Sep 01 '25 16:09 well-mannered-goat