From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 2 Jan 2014 17:47:46 -0500 To: 9fans@9fans.net Message-ID: <6095eb4244b068d7bcdaec4ed6a65f2a@mikro> In-Reply-To: <14d36fdb195faa18bbf2f6b28553cdaa@mikro> References: <14d36fdb195faa18bbf2f6b28553cdaa@mikro> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] devproc noteid changing for none Topicbox-Message-UUID: ab68e336-ead8-11e9-9d60-3106f5b1d025 On Thu Jan 2 17:32:08 EST 2014, quanstro@quanstro.net wrote: > On Thu Jan 2 16:55:59 EST 2014, cinap_lenrek@felloff.net wrote: > > i was investigating all callers of postnote() for bugs that could > > lead to spurious notes like the alarm race i described before. btw > > this has been fixed too. the key is to recheck p->alarm while holding > > p->debug qlock. once you have it, the process cannot exit under you. > > cool. if that's the protocol, doesn't the debug lock need to be held whenever > up->alarm is modified? checkalarms will hang during rollover. suppose sys->ticks = 1<<31, then (long)((1<<31) - 0) = -2147483648. this will stay negative for a 2147483648/HZ seconds. i think this is necessary: void checkalarms(void) { Proc *p; ulong now; p = alarms.head; now = sys->ticks; if(p != nil) if(p->alarm == 0 || (long)(now - p->alarm) >= 0) wakeup(&alarmr); } - erik