Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug #37900: Semaphore::wait() gets interrupted on Posix #45

Closed
pstanczyk opened this issue Jan 23, 2013 · 2 comments
Closed

bug #37900: Semaphore::wait() gets interrupted on Posix #45

pstanczyk opened this issue Jan 23, 2013 · 2 comments
Assignees

Comments

@pstanczyk
Copy link
Contributor

Bringing over from Savannah:
https://savannah.nongnu.org/bugs/?37900

Tue 11 Dec 2012 01:39:32 PM UTC, original submission:

In ilmbase-1.0.2/IlmThread/IlmThreadSemaphorePosix.cpp, the implementation of Semaphore::wait() does not check for interrupt. As a result, the ThreadPool does not always wait until all threads are finished before deleting the task group, leading to accessing of deleted memory.

The fix is to change Semaphore::wait() from

::sem_wait( &_semaphore );

to

while( ::sem_wait( &_semaphore ) == -1 && errno == EINTR )
{
}

@pstanczyk
Copy link
Contributor Author

Testing in a local build

@ghost ghost assigned pstanczyk Jan 23, 2013
@pstanczyk
Copy link
Contributor Author

Fixed in : cb66c20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant