Page MenuHomeFreeBSD

libc, libthr: coordinate stubs for pthread_{suspend,resume}_all_np
AcceptedPublic

Authored by kevans on Thu, Oct 31, 4:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 3:36 AM
Unknown Object (File)
Fri, Nov 1, 3:36 AM
Unknown Object (File)
Fri, Nov 1, 3:35 AM
Unknown Object (File)
Fri, Nov 1, 2:43 AM
Unknown Object (File)
Thu, Oct 31, 6:17 AM
Subscribers

Details

Reviewers
kib
markj
Summary

Our sanitizer StopTheWorld implementation needs to be able to freeze the
process so that it can analyze each thread, with the additional caveat that
it needs to be able to guarantee that none of the threads were in the middle
of dl_iterate_phdr() (or have sufficient locking to block it).

Break out pthread_{suspend,resume}_all_np so that we can just wrap our
StopTheWorld implementation in thread suspension to get them all to a point
that should be relatively safe. If libthr isn't linked into the process in
the first place, then nops are perfectly fine because we won't be calling
StopTheWorld() while iterating.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60283
Build 57167: arc lint + arc unit

Event Timeline

lib/libc/gen/Symbol.map
461

This would not work; you need to export symbol with the same version both from libc and libthr.

Move libc symbols to the correct version

This revision is now accepted and ready to land.Thu, Oct 31, 6:57 PM