This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix crash during thread exit
ClosedPublic

Authored by dvyukov on Nov 16 2021, 5:37 AM.

Details

Summary

Use of gethostent provokes caching of some resources inside of libc.
They are freed in libc_thread_freeres very late in thread lifetime,
after our ThreadFinish.
libc_thread_freeres calls free which
previously crashed in malloc hooks.
Fix it by setting ignore_interceptors for finished threads,
which in turn prevents malloc hooks.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Nov 16 2021, 5:37 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2021, 5:37 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Nov 16 2021, 7:35 AM
This revision is now accepted and ready to land.Nov 16 2021, 7:35 AM
This revision was automatically updated to reflect the committed changes.