From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,e3f39d36cdf1044a X-Google-Attributes: gid111c93,public From: Roger Hill-Cottingham Subject: Re: sigsuspend() returns 111 on Alpha (repeatable, w/ source) Date: 2000/05/15 Message-ID: <391FFDB0.22A16175@bath.ac.uk>#1/1 X-Deja-AN: 623627236 X-Nntp-Posting-Host: tesla.bath.ac.uk Sender: eesrjhc@bath.ac.uk (Verified by Kerberos) Content-Transfer-Encoding: 7bit References: Content-Type: text/plain; charset=us-ascii Organization: University of Bath Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha Eric Sorton wrote: > > Hi All, > > My coworkers and I have found a case where sigsuspend() returns 111. The > condition is repeatable using the code in this message. This behavior > contradicts what is described in the manual page for sigsuspend(). According > to the manual page sigsuspend() should ALWAYS return -1; only errno should be > different. > > The following highlights our configuration: > > o) Alpha ES40, I can provide more details if necessary. > o) RedHat Linux 6.2. > o) kernel 2.2.14 (RedHat package 2.2.14-6.0smp). > o) glibc 2.1.3 (RedHat package 2.1.3-16). > o) egcs 1.1.2 (RedHat package 1.1.2-30). > > The program attached establishes a signal handler for SIGUSR2. It enters a > while loop and calls sigsuspend(). It displays a message when the signal > handler is called and displays the return value of sigsuspend(). If you are > able to get this to repeat, please let me know as I am curious to see if it is > repeatable on a platform other than the ES40. > > Depending on the location of the localtime(), the return value of sigsuspend() > will vary. If localtime() is commented out, sigsuspend() will return 111. If > localtime() is before the loop, sigsuspend() will return -1 the first time, > 111 there after. If localtime() is in the loop, sigsuspend() will always > return -1. We found it odd that calling localtime() affected the return value > of sigsuspend :-) > > For example: > > viper% cc sigbug.c -o sigbug > viper% ./sigbug & > [2] 3691 > viper% kill -USR2 %2 > in sig handler, got sig 31 > sigsuspend return is -1 > viper% kill -USR2 %2 > in sig handler, got sig 31 > sigsuspend return is 111 > viper% kill -USR2 %2 > in sig handler, got sig 31 > sigsuspend return is 111 > > Coincidentally, 111 corresponds to the syscall number for sigsuspend. > > include/asm-alpha/unistd.h:#define __NR_sigsuspend 111 > > We ran the same source on an Intel/Linux box and the return value of > sigsuspend was always -1. > > Eric Sorton > Command and Control Technologies > > ----- I also get exactly this behaviour on an Alpha EB164 (Microway Screamer 500) RH6.0, manually updated kernel 2.2.11, RH glibc-2.1.1-7, manually compiled egcs-1.1.2. Regards, Roger.