This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix trace tests on darwin
ClosedPublic

Authored by dvyukov on Sep 27 2021, 6:05 AM.

Details

Summary

The trace tests crashed on darwin because of some thread
initialization issues (thread initialization is somewhat
different on darwin).
Instead of starting real threads, create a new ThreadState
in the main thread. This makes the tests more unit-testy
and hopefully won't crash on darwin (there is almost no
platform-specific code involved now).
This will also help with future trace tests that will need
more than 1 thread. Creating more than 1 real thread and
dispatching test actions across multiple threads in the
required deterministic order is painful.

Depends on D110539.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Sep 27 2021, 6:05 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2021, 6:05 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
dvyukov updated this revision to Diff 375236.Sep 27 2021, 6:09 AM

fix minor build issues

melver accepted this revision.Sep 27 2021, 7:34 AM
This revision is now accepted and ready to land.Sep 27 2021, 7:34 AM
This revision was landed with ongoing or failed builds.Sep 27 2021, 7:41 AM
This revision was automatically updated to reflect the committed changes.
saghir added a subscriber: saghir.Sep 27 2021, 11:32 AM

Hi, this change seems to be breaking PowerPC buildbots:
One such bot is https://lab.llvm.org/buildbot/#/builders/57/builds/10548
Can you please take a look?

Thanks!

This was failing most of our buildbots, I reverted this change locally and the errors go away. I am reverting this change for now to get the buildbots back to green and give you a chance to look into it when you can.
Please feel free to reach out if you'd like any help with troubleshooting the issues that this patch was causing on PowerPC buildbots.

Thanks!