On Mon, Mar 14, 2011 at 11:55:44AM +0100, Denys Vlasenko wrote:
> On Fri, 2011-03-11 at 23:53 +0300, Dmitry V. Levin wrote:
> > On Thu, Mar 10, 2011 at 12:26:08PM +0100, Denys Vlasenko wrote:
> > > +                         in_job_control_stop = 0;
> > > +                         if (WSTOPSIG(status) == SIGSTOP ||
> > > +                             WSTOPSIG(status) == SIGTSTP ||
> > > +                             WSTOPSIG(status) == SIGTTIN ||
> > > +                             WSTOPSIG(status) == SIGTTOU) {
> > > +                                 /*
> > > +                                  * PTRACE_GETSIGINFO fails if this is
> > > +                                  * genuine *stop* notification,
> > > +                                  * not *signal* notification
> > > +                                  */
> > > +                                 siginfo_t si;
> > > +                                 if (ptrace(PTRACE_GETSIGINFO, pid,
> > > +                                             0, &si) != 0)
> > > +                                         in_job_control_stop = 1;
> > > +                         }
> > >                           printleader(tcp);
> > > -                         tprintf("--- %s (%s) @ %lx (%lx) ---",
> > > +                         tprintf(in_job_control_stop
> > > +                                 ? "--- stopped by %s ---"
> > > +                                 : "--- %s (%s) @ %lx (%lx) ---",
> > 
> > In addition to what I've already written in this thread, I want to point
> > out that, unfortunately, this "stopped by" wording contradicts with
> > reality.  The tracee is just trapped, and there are no means to make
> > it really stopped without detaching.
> 
> There were several active discussion threads on lkml exactly about this,
> which resulted (finally) in actual patches to fix
> long-standing problem with strace + ^Z not working properly.
> I'm CC'ing participants. If you want to read the last of these threads,
> google for "[RFC] Proposal for ptrace improvements".

It's nice that newer kernels might implement proper job control for traced
processes some day.

> During those discussions, several people, including me,
> were again puzzled by "double SIGSTOP" thing in strace.

With commits I've pushed to strace HEAD today, strace output will be
more useful:

$ pidof pause | xargs -r strace -p
Process 12345 attached - interrupt to quit
pause()                                 = ? ERESTARTNOHAND (To be restarted)
--- {si_signo=SIGTSTP, si_code=SI_KERNEL} (Stopped) ---
--- Stopped by SIGTSTP ---
pause(


-- 
ldv

Attachment: pgpmLDlP0Vu2p.pgp
Description: PGP signature

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to