Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 1999 13:00:02 -0700 (PDT)
From:      Chris Costello <chris@calldei.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/12141: libc_r passes negative tv_usec values to setitimer -- crash
Message-ID:  <199906112000.NAA03532@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/12141; it has been noted by GNATS.

From: Chris Costello <chris@calldei.com>
To: davids@webmaster.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/12141: libc_r passes negative tv_usec values to setitimer -- crash
Date: Fri, 11 Jun 1999 14:56:57 -0500

 On Fri, Jun 11, 1999, davids@webmaster.com wrote:
 > This is the *wrong* fix, but it does make the problem go away.
 > 
 > in uthread_kern.c:
 >                                 /*
 >                                  * Start the interval timer for the
 >                                  * calculated time interval: 
 >                                  */
 >                                 if(itimer.it_value.tv_usec<=0)
 >                                  itimer.it_value.tv_usec=1000;
 >                                 if (setitimer(_ITIMER_SCHED_TIMER, &itimer, NULL
 > ) != 0) {
 > 
 > 
 > The 'if' has been added to remove the problem. But the real problem is why it's computing negative values in the first place.
 
    Actually, that's even wrong for your wrong fix.  The hack you
 probably want is more along the lines of
 
 if (itimer.it_value.tv_usec < 0)
 	itimer.it_value.tv_usec = 1000;
 
    It's perfectly ok for tv_usec to be 0.
 
 -- 
 Chris Costello                                <chris@calldei.com>
 As far as we know, our computer has never had an undetected error.  - Weisert
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906112000.NAA03532>