Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Ulrich Drepper
On 8/1/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > I'm not quite sure you are right Ulrich. Given this little bit from > SUSv3 about SA_RESTART in the page describing sigaction ( > http://www.opengroup.org/onlinepubs/009695399/functions/sigaction.html > ) : It's not an official SA_RESTART since t

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Jesper Juhl
On 8/1/05, Dave Airlie <[EMAIL PROTECTED]> wrote: > > > > However, there is in fact no bug here. The test program is just wrong. > > sigwait returns zero or an error number, as POSIX specifies. Conversely, > > sigtimedwait and sigwaitinfo either return 0 or set errno and return -1. > > It is odd

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Roland McGrath
> But sigwait is not a function specified with an EINTR error number. > As I said before, this does not mean that EINTR cannot be returned. > But it will create havoc among programs and it causes undefined > behavior wrt to SA_RESTART. I think it is best to not have any > function for which EINT

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Ulrich Drepper
On 7/31/05, Roland McGrath <[EMAIL PROTECTED]> wrote: > However, there is in fact no bug here. The test program is just wrong. > sigwait returns zero or an error number, as POSIX specifies. No question, no error is detected incorrectly. But sigwait is not a function specified with an EINTR error

Re: Fw: sigwait() breaks when straced

2005-07-31 Thread Dave Airlie
> > However, there is in fact no bug here. The test program is just wrong. > sigwait returns zero or an error number, as POSIX specifies. Conversely, > sigtimedwait and sigwaitinfo either return 0 or set errno and return -1. > It is odd that the interfaces of related functions differ in this way

Re: Fw: sigwait() breaks when straced

2005-07-31 Thread Roland McGrath
The problem is not really "when straced", but when strace attaches. In fact, it's not even "when PTRACE_ATTACH'd". It's actually the implicit SIGSTOP that PTRACE_ATTACH causes. If you simply suspend and resume the program (with SIGSTOP or C-z), you get the same result. So this report is more pr

Re: sigwait() breaks when straced

2005-07-31 Thread Ulrich Drepper
On 7/30/05, Sanjoy Mahajan <[EMAIL PROTECTED]> wrote: > so the return value should not be 4 (or the docs are not right). This return value simply indicated EINTR (sigwait does not set errno, read the docs). The kernel simply doesn't restart the function in case of a signal. It should do this, th

sigwait() breaks when straced

2005-07-30 Thread Sanjoy Mahajan
Pavel Machek wrote: > If you think it is a linux bug, can you produce small test case doing > just the sigwait, and post it on l-k with big title "sigwait() breaks > when straced, and on suspend"? Here it is. I haven't tested the sigwait()+suspend lately, since suspen