tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: stopfork trick (was: radiusd: Error detected by libpthread: Invalid mutex.)



In article <20130508224529.GD21387%trav.math.uni-bonn.de@localhost>,
Edgar Fuß  <ef%math.uni-bonn.de@localhost> wrote:
>> You can do the stopfork trick with sysctl in the proc tree and then attach
>> to the child before it dumps.
>Can you elaborate how this is done?
>
>I gdb'd radiusd, set a breakpoint on main and let it run.
>When it hit the breakpoint, I looked up the debugged radiusd's PID and did
>       sysctl -w proc.XXXX.stopfork=1
>and let gdb continue. The main process exited, but I would expect to find a
>child in ps output. Or are these stopped childs hidden from ps? If yes, how
>do I learn their PID to attach to them?

That sounds right to me. ps -x should show you a child too. Perhaps
add stopexit too to return to the debugger before the parent exits.
Then you should be able to attach to the child via pid.

christos



Home | Main Index | Thread Index | Old Index