This is an archive of the discontinued LLVM Phabricator instance.

AddressSanitizer: fix for SPARC with GCC
ClosedPublic

Authored by ebotcazou on Feb 20 2019, 3:02 AM.

Details

Summary

This patch contains a fixlet for the AddressSanitizer on the SPARC with GCC, which would otherwise generate a problematic call to the intercepted memcpy routine. It was tested with GCC on SPARC/Solaris and SPARC/Linux.

Patch by Eric Botcazou.

Diff Detail

Event Timeline

ebotcazou created this revision.Feb 20 2019, 3:02 AM
ro added a subscriber: ro.Feb 20 2019, 4:20 AM
vitalybuka added inline comments.
compiler-rt/lib/asan/asan_globals.cc
115 ↗(On Diff #187539)

Could you please upload patches with "arc" tool https://llvm.org/docs/Phabricator.html#subversion-and-arcanist-deprecated
Without it we have "Context not available."

118 ↗(On Diff #187539)

sizeof(g)

119 ↗(On Diff #187539)

clang-format

ebotcazou updated this revision to Diff 187789.Feb 21 2019, 6:52 AM
ebotcazou marked 3 inline comments as done.

Changed sizeof (Global) to sizeof (g) and removed extraneous space.

ebotcazou added inline comments.Feb 21 2019, 6:54 AM
compiler-rt/lib/asan/asan_globals.cc
115 ↗(On Diff #187539)

No, sorry, I don't have arcanist handy.

118 ↗(On Diff #187539)

Changed.

119 ↗(On Diff #187539)

Fixed.

ro added inline comments.Feb 21 2019, 7:02 AM
compiler-rt/lib/asan/asan_globals.cc
119 ↗(On Diff #187789)

It would be helpful the have the explanation from the summary
as a comment in the code so it becomes immediately obvious
what's going on.

ebotcazou marked an inline comment as done.Feb 21 2019, 9:28 AM
ebotcazou added inline comments.
compiler-rt/lib/asan/asan_globals.cc
119 ↗(On Diff #187789)

Other similar uses of internal_memcpy don't have a comment, but I can add one.

Any objection to accepting this? We need it alongside D58431 to fix the Sanitizer failures in the GCC testsuite on the SPARC platforms and I'd rather not maintain it separately in the GCC tree.

vitalybuka accepted this revision.Feb 27 2019, 2:08 PM
This revision is now accepted and ready to land.Feb 27 2019, 2:08 PM
vitalybuka edited the summary of this revision. (Show Details)Mar 12 2019, 1:49 PM
This revision was automatically updated to reflect the committed changes.