Re: Unexpected EINVAL from pthread_join

2015-02-25 Thread Corinna Vinschen
On Feb 24 22:20, Corinna Vinschen wrote: > Hi Lasse, > > On Feb 24 20:37, Lasse Collin wrote: > > On 2015-02-24 Corinna Vinschen wrote: > > > On Feb 24 15:54, Lasse Collin wrote: > > > > Many other pthread functions are similar in sense that they must > > > > never return EINTR. A bug similar to t

Re: Unexpected EINVAL from pthread_join

2015-02-24 Thread Corinna Vinschen
Hi Lasse, On Feb 24 20:37, Lasse Collin wrote: > On 2015-02-24 Corinna Vinschen wrote: > > On Feb 24 15:54, Lasse Collin wrote: > > > Many other pthread functions are similar in sense that they must > > > never return EINTR. A bug similar to the one in pthread::join exist > > > in pthread_mutex::l

Re: Unexpected EINVAL from pthread_join

2015-02-24 Thread Lasse Collin
On 2015-02-24 Corinna Vinschen wrote: > On Feb 24 15:54, Lasse Collin wrote: > > Many other pthread functions are similar in sense that they must > > never return EINTR. A bug similar to the one in pthread::join exist > > in pthread_mutex::lock. If SA_RESTART isn't used, signals can make > > multip

Re: Unexpected EINVAL from pthread_join

2015-02-24 Thread Corinna Vinschen
On Feb 24 15:54, Lasse Collin wrote: > On 2015-02-23 Corinna Vinschen wrote: > > On second thought, this is not the right way to handle this. The > > WAIT_SIGNALED is returned because we're in the main thread and > > SA_RESTART is not set, as you assumed above. This leads to the > > question why

Re: Unexpected EINVAL from pthread_join

2015-02-24 Thread Lasse Collin
On 2015-02-23 Corinna Vinschen wrote: > On second thought, this is not the right way to handle this. The > WAIT_SIGNALED is returned because we're in the main thread and > SA_RESTART is not set, as you assumed above. This leads to the > question why this scenario isn't handled directly in cygwait

Re: Unexpected EINVAL from pthread_join

2015-02-23 Thread Corinna Vinschen
On Feb 23 13:59, Corinna Vinschen wrote: > On Feb 23 13:14, Corinna Vinschen wrote: > > On Feb 22 22:54, Lasse Collin wrote: > > > It seems that a signal can cause pthread_join to incorrectly return > > > EINVAL. I debugged it only a little but hopefully someone finds this > > > useful: > > > > >

Re: Unexpected EINVAL from pthread_join

2015-02-23 Thread Corinna Vinschen
On Feb 23 13:14, Corinna Vinschen wrote: > On Feb 22 22:54, Lasse Collin wrote: > > It seems that a signal can cause pthread_join to incorrectly return > > EINVAL. I debugged it only a little but hopefully someone finds this > > useful: > > > > In the file thread.cc, function pthread::join, the ca

Re: Unexpected EINVAL from pthread_join

2015-02-23 Thread Corinna Vinschen
On Feb 22 22:54, Lasse Collin wrote: > It seems that a signal can cause pthread_join to incorrectly return > EINVAL. I debugged it only a little but hopefully someone finds this > useful: > > In the file thread.cc, function pthread::join, the call to cygwait may > return WAIT_SIGNALED if a signal

Unexpected EINVAL from pthread_join

2015-02-22 Thread Lasse Collin
It seems that a signal can cause pthread_join to incorrectly return EINVAL. I debugged it only a little but hopefully someone finds this useful: In the file thread.cc, function pthread::join, the call to cygwait may return WAIT_SIGNALED if a signal is sent to the process. The switch statement hand