This is an archive of the discontinued LLVM Phabricator instance.

tsan: remove real func check from interceptors
ClosedPublic

Authored by dvyukov on Oct 26 2021, 7:57 AM.

Details

Summary

If the real function is not intercepted,
we are going to crash one way or another.
The question is just in the failure mode:
error message vs NULL deref. But the message
costs us a check in every interceptor and
they are not observed to be failing in real life
for a long time, also other sanitizers don't
have this check as well (also crash on
NULL deref if that happens).
Remove the check from non-debug mode.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Oct 26 2021, 7:57 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2021, 7:57 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Oct 26 2021, 8:02 AM
This revision is now accepted and ready to land.Oct 26 2021, 8:02 AM
This revision was automatically updated to reflect the committed changes.
amyk added a subscriber: amyk.Oct 27 2021, 3:00 PM

Hello,

It looks like this patch is causing the following LIT test failure (https://lab.llvm.org/buildbot/#/builders/105/builds/16777/steps/7/logs/FAIL__SanitizerCommon-tsan-powerpc64le-Linux__ptra):

SanitizerCommon-tsan-powerpc64le-Linux :: Linux/ptrace.cpp

On the following PPC LE buildbots:

https://lab.llvm.org/buildbot/#/builders/105
https://lab.llvm.org/buildbot/#/builders/121
https://lab.llvm.org/buildbot/#/builders/57

Would you be able to take a look at this failure and resolve it, or pull this patch accordingly?
Thank you in advance.

Hi Amy,

I am completely puzzled how this change can cause such failure mode...
It looks like some latent bugs (stack corruption) on powerpc. I don't have access to powerpc machines, so I can only offer this:
https://reviews.llvm.org/D112703