NetBSD-Bugs archive

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

Re: kern/38060: blocking TSTP is broken



The following reply was made to PR kern/38060; it has been noted by GNATS.

From: Andrew Doran <ad%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/38060: blocking TSTP is broken
Date: Tue, 4 Mar 2008 15:55:21 +0000

 On Mon, Mar 03, 2008 at 12:20:03AM +0000, YAMAMOTO Takashi wrote:
 
 >  > how about this?
 >  > 
 >  > YAMAMOTO Takashi
 >  > 
 >  > 
 >  > Index: kern_sig.c
 >  > ===================================================================
 >  > RCS file: /cvsroot/src/sys/kern/kern_sig.c,v
 >  > retrieving revision 1.272
 >  > diff -u -p -r1.272 kern_sig.c
 >  > --- kern_sig.c    20 Feb 2008 11:48:46 -0000      1.272
 >  > +++ kern_sig.c    2 Mar 2008 12:21:27 -0000
 >  > @@ -1352,23 +1352,7 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 >  >           if ((prop & SA_CONT) != 0 && action == SIG_DFL)
 >  >                   goto out;
 >  >  
 >  > -         if ((prop & SA_STOP) != 0 && action == SIG_DFL) {
 >  > -                 /*
 >  > -                  * If a child holding parent blocked, stopping could
 >  > -                  * cause deadlock: discard the signal.
 >  > -                  */
 >  > -                 if ((p->p_sflag & PS_PPWAIT) == 0) {
 >  > -                         p->p_xstat = signo;
 >  > -                         proc_stop(p, 1, signo);
 >  > -                 }
 >  > -                 goto out;
 >  > -         } else {
 >  > -                 /*
 >  > -                  * Stop signals with the default action are handled
 >  > -                  * specially in issignal(), and so are not enqueued.
 >  > -                  */
 >  > -                 sigput(&p->p_sigpend, p, kp);
 >  > -         }
 >  > +         sigput(&p->p_sigpend, p, kp);
 >  >   } else {
 >  >           /*
 >  >            * Process is stopped or stopping.  If traced, then no
 >  
 
 I think this should work. I can't remember why it stops there instead of
 deferring to issignal().
 
 There is a question over signal masking. TSTP is job control and so operates
 on the whole process, although masks are per-thread. I found nothing in the
 standards about this. I think we can be lazy and assume that if any thread
 has it unmasked, it can be taken.
 
 Andrew
 


Home | Main Index | Thread Index | Old Index