Skip to content

Commit 28e7f5d

Browse files
KJTsanaktsidisrocallahan
authored andcommitted
Schedule tasks where we've seen but not processed PTRACE_EVENT_EXIT
If we see the PTRACE_EVENT_EXIT for a task while running a different task in unlimited-ticks mode in `Scheduler::reschedule`, it looks like nothing ever actually calls `handle_ptrace_exit_event` on it, and so nothing ever PTRACE_CONT's the task out of the exit-stop and into the zombie state. This seems to manifest itself as rr not reaping processes properly when they receive asynchronous core-dumping signals (e.g. SIGSEGV sent by `raise` or `kill`). Fix this issue by checking if there's a pending PTRACE_EVENT_EXIT to deal with on the task in `Scheduler::is_task_runnable`, and allowing the task to be executed if so. Fixes #3882
1 parent ccb0905 commit 28e7f5d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Scheduler.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ bool Scheduler::is_task_runnable(RecordTask* t, WaitAggregator& wait_aggregator,
349349
}
350350
}
351351

352-
if (t->waiting_for_ptrace_exit && !t->was_reaped()) {
352+
if (t->seen_ptrace_exit_event() && !t->handled_ptrace_exit_event()) {
353+
LOGM(debug) << " " << t->tid << " has a pending PTRACE_EVENT_EXIT to process; we can run it";
354+
return true;
355+
} else if (t->waiting_for_ptrace_exit && !t->was_reaped()) {
353356
LOGM(debug) << " " << t->tid << " is waiting to exit; checking status ...";
354357
} else if (t->is_stopped() || t->was_reaped()) {
355358
LOGM(debug) << " " << t->tid << " was already stopped with status " << t->status();

0 commit comments

Comments
 (0)