#1460 SSSD thread issue can cause the application to not get any identity information
Closed: Fixed None Opened 11 years ago by werkt.

Cancelling a pthread which is in the midst of any sss client usage (we exhbited with getpwuid_r) can leave sss_nss_mutex or sss_pam_mutex locked with an owner thread which does not exist. The next call to any sss function will hang forever waiting for that mutex to unlock.

The attached program exhibits the problem reliably in my environment (I cannot guarantee that it will do so everywhere, but it's a good guess for anything with pthreads and an external ldap source). With the macro 'DISABLE_CANCEL' set, it also demonstrates the effectiveness of a workaround - I've included the pthread_testcancel to force a cancellation point to occur after we've reenabled pthread cancellation, and in good faith I believe it should be in the solution as well, to ensure that queued cancels are honored at the end of the locked region.


hang reproducer and proposed solution (compile with -DDISABLE_CANCEL to observe effect)
sss_client_hang.c

hang reproducer and proposed solution (compile with -DDISABLE_CANCEL to observe effect)
sss_client_hang.2.c

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.9.0 RC1
priority: major => blocker
summary: sssd-client hang after pthread_cancel => SSSD thread issue can cause the application to not get any identity information

Fields changed

owner: somebody => jhrozek
status: new => assigned

Fields changed

patch: 0 => 1

master: 86b6115

proposed_priority: => Undefined
resolution: => fixed
status: assigned => closed

Metadata Update from @werkt:
- Issue assigned to jhrozek
- Issue set to the milestone: SSSD 1.9.0 beta 7

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/2502

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata