#283 Posix ThreadImpl::sleepImpl throws exceptions on EINTR

Platform_Specific
closed
5
2012-09-14
2009-08-21
No

In Poco 1.3.5 and 1.3.6 branches the Thread_POSIX.cpp doesn't do correct EINTR handling, leading to unwanted exceptions. If the time has run out between the EINTR-Signal and the calculation of the remainingTime, the loop terminates with remainingTime==0, rc<0 and errno=EINTR, so the following if(rc<0) does throw a Poco::SystemException saying select() failed, but it just expired and had a perfectly legal EINTR.
We had some hard to find stability issues on an embedded device due to this bug.
For a fix set rc=0 in the remainingTime=0 if-case or check errno in the throwing if.

Discussion

  • Will be fixed in 1.3.6

     
  • Fixed in 1.3.6/trunk rev. 1242