[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#906917: sem_timedwait could always block and returns ETIMEOUT but decrements the value on i686 architecture



I've made all sem_timedwait work. One of the libraries was missing pthread linkage but was linked to a process that links to pthread itself. Message
undefined reference to symbol 'sem_timedwait@@GLIBC_2.2'
was not shown in the project. But it is shown it the test case if I remove pthread linkage. 

The problem occurs only when using semaphores in a library that is not linked against pthread.

I've prepared minimal test suite using cmake (ctest) and Check framework. The test reproduces the problem if linkage with pthread of the library is commented out (by default). Test has the same behaviour as without separate library with ASAN enabled. Behaviour is the same compiled either with gcc, clang-3.9 or clang-6.0.

Test passes on amd64 distibutions and on Ubuntu Trusty i386 (with no pthread linkage). But it fails on Debian 9 (Stretch) i386 and Debian 10 (Testing) i386. No compilation errors happen.

Command to run test in the test-bugs directory after extraction:
cmake --build . && ctest --verbose

Attachment: test-bugs.tar.gz
Description: application/gzip


Reply to: