Project

General

Profile

Actions

Bug #2852

open

mdb -o nostop -p <pid> hangs forked children forever

Added by Adam Leventhal about 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2012-06-08
Due date:
% Done:

0%

Estimated time:
Difficulty:
Hard
Tags:
needs-triage
Gerrit CR:

Description

shell 1:
$ echo $$
196398
shell 2:
$ mdb -o nostop -p 196398

shell 1:
$ sleep 1
<hangs forever>
shell 2:
<exit mdb>
shell 2:
<still hung>

Turns out the child process is hung in stop():

0t196398::pid2proc | ::walk thread | ::findstack

stack pointer for thread ffffff01fbad1880: ffffff00082b0c60
[ ffffff00082b0c60 _resume_from_idle+0xf1() ]
ffffff00082b0c90 swtch+0x1e6()
ffffff00082b0cf0 cv_wait_sig_swap_core+0x183()
ffffff00082b0d10 cv_wait_sig_swap+0x18()
ffffff00082b0db0 waitid+0x2a0()
ffffff00082b0eb0 waitsys32+0x30()
ffffff00082b0f00 _sys_sysenter_post_swapgs+0x237()

0t196398::pid2proc | ::ptree

fffffffffbc3c2b0 sched
ffffff01dae510d8 init
ffffff01fb2e60d8 sshd
fffffffcc47080d8 sshd
fffffffcc470c0d8 sshd
fffffffcc47680d8 sudo
fffffffcc47c90d8 bash
fffffffcc51540d8 bash

fffffffcc51540d8::walk thread | ::findstack -v

stack pointer for thread ffffff01e4e6e400: ffffff000891ad70
[ ffffff000891ad70 _resume_from_idle+0xf1() ]
ffffff000891ada0 swtch+0x1e6()
ffffff000891ae10 stop+0x84c(4, 8e)
ffffff000891aef0 post_syscall+0x314(2ff2e, 1)
ffffff000891af00 lwp_rtt+0xb5()

The problem is that we set PR_FORK on the parent process, and never take control of the child to either manage it as it hits traced system calls, signals, etc. or remove the instrumentation. With o nostop, mdb should behave as normal - it just shouldn't stop the victim process initially.

No data to display

Actions

Also available in: Atom PDF