NetBSD-Bugs archive

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

Re: kern/46522

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

From: Nat Sloss <>
Subject: Re: kern/46522
Date: Mon, 4 Jun 2012 04:07:56 +1000

 Hi I think I've fixed it (although I don't think my patch is very good).
 The trick was to add a delay (I didn't use delay :) ).
 The getty was closing but before that happens the cv was being destroyed.
 So what was needed was a wait (the only thing I thought of) so that the getty 
 or other programme would finish with the screen and then the cvs' could be 
 destroyed without crashing.
 So here is my patch:
 RCS file: /cvsroot/src/sys/kern/tty.c,v
 retrieving revision 1.250
 diff -u -r1.250 tty.c
 --- sys/kern/tty.c      12 Mar 2012 18:27:08 -0000      1.250
 +++ sys/kern/tty.c      3 Jun 2012 17:58:19 -0000
 @@ -2770,6 +2770,9 @@
         if (tp->t_sigcount != 0)
                 TAILQ_REMOVE(&tty_sigqueue, tp, t_sigqueue);
 +       ttysleep(tp, &tp->t_rawcv, true, mstohz(200));
 In my opinion I don't think this is the best way because what if a longer 
 sleep is needed?
 ...Anyway it stops the crashes for me.
 Note: This patch is my own work which I submit under the NetBSD license.
 PS: Would you agree that delay and DELAY should be re implemented as high 
 resolution sleeps?  I think that delay has no place in a 
 multitasking/multiprocess OS such as NetBSD.

Home | Main Index | Thread Index | Old Index