detach traced process, when tracer process terminate.

some fixes on PTRACE_DETACH.

refs #374
refs #280
This commit is contained in:
Susumu Komae
2015-02-17 16:58:29 +09:00
committed by postpeta
parent fa15f6b106
commit 99debc548f
2 changed files with 64 additions and 8 deletions

View File

@ -402,6 +402,12 @@ void ptrace_report_signal(struct process *proc, int sig)
/* Transition process state */
proc->ftn->status = PS_TRACED;
proc->ftn->ptrace &= ~PT_TRACE_SYSCALL_MASK;
if (sig == SIGSTOP || sig == SIGTSTP ||
sig == SIGTTIN || sig == SIGTTOU) {
proc->ftn->signal_flags |= SIGNAL_STOP_STOPPED;
} else {
proc->ftn->signal_flags &= ~SIGNAL_STOP_STOPPED;
}
ihk_mc_spinlock_unlock_noirq(&proc->ftn->lock);
if (proc->ftn->parent) {
/* kill SIGCHLD */