Thread View: net.bugs
1 messages
1 total messages
Started by utzooutcsrgvgarfieldandrew
Sat, 23 Apr 1983 02:57
Bug in ptrace
Author: utzooutcsrgvgarfieldandrew
Date: Sat, 23 Apr 1983 02:57
Date: Sat, 23 Apr 1983 02:57
18 lines
1254 bytes
1254 bytes
We have recently stumbled across a minor bug involving the ptrace system
call. When ptrace is called from the parent, but the child has not called
ptrace(0), the system tries to get information from the child anyway. The
parent sleeps while waiting for this information, which is never forthcoming.
This effectively ties up the ptrace facility and all other processes (ie. sdb
adb) using ptrace will sleep forever. The sleeping priority can soon becomes
negative and then even "kill" cannot interrupt the slumbers of these processes.
Fortunately, this can be easily fixed by checking to see if the child is
being traced before actually doing the ptrace request. For 4.1bsd, change line
615 in "sys/sig.c" from:
if (p == 0 || p->p_stat != SSTOP || p->p_ppid != u.u_procp->p_pid) {
to:
if (p == 0 || p->p_stat != SSTOP || p->p_ppid != u.u_procp->p_pid
|| !(p->p_flag & STRC)) {
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads