This is an archive of the discontinued LLVM Phabricator instance.

[asan] Prevent __attribute__((annotate)) triggering errors on Darwin
ClosedPublic

Authored by zaks.anna on Apr 17 2015, 5:17 PM.

Details

Summary
The following code triggers a fatal error in the compiler instrumentation
of ASan on Darwin because we place the attribute into llvm.metadata section,
which does not have the proper MachO section name.

void foo() __attribute__((annotate("custom")));
void foo() {;}

This commit reorders the checks so that we skip everything in llvm.metadata
first. It also removes the hard failure in case the section name does not
parse. That check will be done lower in the compilation pipeline anyway.

Diff Detail

Event Timeline

zaks.anna updated this revision to Diff 23978.Apr 17 2015, 5:17 PM
zaks.anna retitled this revision from to [asan] Prevent __attribute__((annotate)) triggering errors on Darwin.
zaks.anna updated this object.
zaks.anna edited the test plan for this revision. (Show Details)
zaks.anna added reviewers: kubamracek, samsonov.
zaks.anna added subscribers: kcc, Unknown Object (MLST).
kubamracek edited edge metadata.Apr 20 2015, 8:38 AM

Good catch. This looks like a regression caused by my commit in r223513 (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141201/247689.html).

I'm ok with the patch, but Alexey or Alexander should see it as well.

kubamracek updated this object.Apr 20 2015, 8:38 AM
kubamracek edited edge metadata.
kubamracek added a subscriber: glider.
samsonov accepted this revision.Apr 20 2015, 4:43 PM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 20 2015, 4:43 PM

Committed in r239379.

zaks.anna closed this revision.Jun 25 2015, 6:13 PM