Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!nysernic!itsgw!leah!uwmcsd1!bbn!gatech!galbp!bing From: bing@galbp.UUCP Newsgroups: comp.os.minix Subject: bug in alarm() system call Message-ID: <1767@galbp.LBP.HARRIS.COM> Date: Wed, 30-Sep-87 10:18:03 EDT Article-I.D.: galbp.1767 Posted: Wed Sep 30 10:18:03 1987 Date-Received: Fri, 2-Oct-87 05:45:37 EDT Reply-To: bing@galbp.UUCP (Bing Bang) Organization: Harris/Lanier, Atlanta, GA Lines: 41 there seems to be a bug in the way alarms are handled in minix. i noticed the problem only by accident. on my minix i have gotten rid of the ram disk and use my hard disk as root. this means every 30 seconds when update does a sync(), my hard disk light blinks. i was playing around with a small program that made an alarm() call when i noticed update stopped running. upon further investigation, i found out that if two processes are waiting on an alarm, under an unknown set of circumstances, the second process (the one with the longer alarm time) never receives a signal. i am trying to find the bug now, below is the test program i use. it should run forever if alarm() works ok, but now it stops after 1 or 2 itterations. ------------------------------------------------------------------------ #include int pid, catcher(); main() { pid = fork(); for( ; ; ) { signal(SIGALRM, catcher); alarm(pid?5:7); pause(); } } int catcher() { if(pid) write(1, "\nparent alarm.\n", 15); else write(1, "\nchild alarm.\n", 14); } -- Bing H. Bang +-------------------+ Harris/Lanier |MSDOS: just say no.| Atlanta GA +-------------------+