This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Really fix zero_page_pc test for PowerPC
ClosedPublic

Authored by foad on Nov 12 2014, 2:44 AM.

Details

Summary

As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.

On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).

On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.

You can see this difference if you run the test case under gdb.

Diff Detail

Event Timeline

foad updated this revision to Diff 16080.Nov 12 2014, 2:44 AM
foad retitled this revision from to [ASan] Really fix zero_page_pc test for PowerPC.
foad updated this object.
foad edited the test plan for this revision. (Show Details)
foad added reviewers: kcc, glider, samsonov.
foad added a subscriber: Unknown Object (MLST).
samsonov added inline comments.Nov 12 2014, 4:19 PM
test/asan/TestCases/zero_page_pc.cc
11–13

Why not

(address|pc) 0x0*4

Also, it would be nice to add a comment with your discovery here.

foad updated this revision to Diff 16139.Nov 13 2014, 1:35 AM

Tweak the regular expression. Add comments.

samsonov accepted this revision.Nov 13 2014, 11:32 AM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 13 2014, 11:32 AM
foad closed this revision.Nov 13 2014, 1:53 PM