This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Check the return values of the pthread_* functions
ClosedPublic

Authored by cryptoad on May 25 2017, 10:49 AM.

Details

Summary

Currently we are not enforcing the success of pthread_once, and
pthread_setspecific. Errors could lead to harder to debug issues later in
the thread's life. This adds checks for a 0 return value for both.
If pthread_setspecific fails in the teardown path, opt for an immediate
teardown as opposed to a fatal failure.

Event Timeline

cryptoad created this revision.May 25 2017, 10:49 AM
cryptoad updated this revision to Diff 100272.May 25 2017, 11:07 AM

Other Sanitizers use GetPthreadDestructorIterations() instead of
PTHREAD_DESTRUCTOR_ITERATIONS, so do that here as well.

alekseyshl accepted this revision.May 25 2017, 4:43 PM
This revision is now accepted and ready to land.May 25 2017, 4:43 PM
cryptoad closed this revision.May 26 2017, 8:39 AM