This is an archive of the discontinued LLVM Phabricator instance.

[TSan][Darwin] Add integration tests for dyld interposition
ClosedPublic

Authored by yln on Sep 6 2021, 12:06 PM.

Details

Summary

Add integration tests for dyld interposition: DYLD_LIBRARY_PATH and
DYLD_INSERT_LIBRARIES.

DYLD_INSERT_LIBRARIES is also relevant for TSan thread
finalization/destruction sequence in the presence of additional pthread
introspection hooks (libBacktraceRecording.dylib for Xcode 'Queue
Debugging' feature).

rdar://78739125

Diff Detail

Event Timeline

yln requested review of this revision.Sep 6 2021, 12:06 PM
yln created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2021, 12:06 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
kubamracek accepted this revision.Sep 7 2021, 12:49 PM
This revision is now accepted and ready to land.Sep 7 2021, 12:49 PM
delcypher added inline comments.Sep 7 2021, 7:34 PM
compiler-rt/test/tsan/Darwin/dyld-insert-libraries.c
46

Maybe note that the "injected library constructor" that you're talking about is __library_initializer?

47

Maybe

constructors (DYLD_INSERT_LIBRARIES) run after the TSan initializer, which replaces and forwards to the previous pthread_introspection hook.

?

delcypher accepted this revision.Sep 7 2021, 7:35 PM

LGTM with some very minor nits.

yln updated this revision to Diff 371339.Sep 8 2021, 8:01 AM

Improve comments and commit message.

yln marked 2 inline comments as done.Sep 8 2021, 8:04 AM
This revision was automatically updated to reflect the committed changes.