This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Suppress one unittest on macOS.
ClosedPublic

Authored by NoQ on Jul 23 2020, 11:48 AM.

Details

Summary

It's failing on macOS under AddressSanitizer for no obvious reason - i.e., no report is produced, just the code isn't working correctly. Might possibly be a bug in ASan but I want to silence an internal buildbot before a deeper investigation. I didn't try platforms other than macOS.

The failure can be reproduced somewhere around rG0b2a92224630f6e177d091b8391cfa943764aba5 by self-hosting. The unittest has to be compiled as -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER="Address" in order to reproduce the issue (RelWithDebInfo works too, but not Debug).

Diff Detail

Event Timeline

NoQ created this revision.Jul 23 2020, 11:48 AM
vsavchenko accepted this revision.Jul 23 2020, 12:02 PM

LGTM, thanks for taking care of this!

This revision is now accepted and ready to land.Jul 23 2020, 12:02 PM
njames93 added a subscriber: njames93.EditedJul 24 2020, 1:39 AM

I was having issues with this test case under macos in D82188.
It would fail for seemingly no apparent reason until I disable a test in a different translation unit.
This made me think there is a subtle bug in the linker used on macos. That could also explain why asan is having a hard time with this as well.
I got as far as seeing that runCheckOnCode was called, the check was instantiated but its matchers never got registered effectively meaning it didn't run.

martong removed a subscriber: martong.Jul 27 2020, 9:11 AM
NoQ added a comment.Jul 27 2020, 10:15 PM

I was having issues with this test case under macos in D82188.
It would fail for seemingly no apparent reason until I disable a test in a different translation unit.
This made me think there is a subtle bug in the linker used on macos. That could also explain why asan is having a hard time with this as well.
I got as far as seeing that runCheckOnCode was called, the check was instantiated but its matchers never got registered effectively meaning it didn't run.

Damn, i'm very glad you showed up. I can reproduce your problem as well, so ASan is probably not at fault. I'll try to talk to linker folks to see if they can fix this.

I guess i'll still commit this patch so that to unbreak the buildbots but i'll keep an eye on this issue.

NoQ updated this revision to Diff 281112.Jul 27 2020, 10:38 PM
NoQ retitled this revision from [clang-tidy] Suppress one unittest under ASan. to [clang-tidy] Suppress one unittest on macOS..

Update comments with the updated investigation details.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2020, 10:39 PM
In D84453#2177665, @NoQ wrote:

I was having issues with this test case under macos in D82188.
It would fail for seemingly no apparent reason until I disable a test in a different translation unit.
This made me think there is a subtle bug in the linker used on macos. That could also explain why asan is having a hard time with this as well.
I got as far as seeing that runCheckOnCode was called, the check was instantiated but its matchers never got registered effectively meaning it didn't run.

Damn, i'm very glad you showed up. I can reproduce your problem as well, so ASan is probably not at fault. I'll try to talk to linker folks to see if they can fix this.

I guess i'll still commit this patch so that to unbreak the buildbots but i'll keep an eye on this issue.

If it is an issue with the linking and the issue lies within the system ld binary on mac os then we really can't do much here apart from raise an issue with apple folks.
Be interesting to see if this bug is present when using lld on mac os, however I don't have a mac so its kind of hard for me to test.