This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] More realistic setjmp test.
AbandonedPublic

Authored by fmayer on Jul 9 2021, 8:46 AM.

Details

Summary

The existing one actually failed on the int* p, not on int z (as can be
seen by the fault being 8 bytes rather than 4).

This is also needed to make sure the stack safety analysis does not
classify the alloca as safe.

Diff Detail

Event Timeline

fmayer requested review of this revision.Jul 9 2021, 8:46 AM
fmayer created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2021, 8:46 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
fmayer updated this revision to Diff 357528.Jul 9 2021, 8:47 AM

Formatting.

fmayer added a reviewer: hctim.Jul 9 2021, 8:50 AM
fmayer added a subscriber: eugenis.
fmayer edited the summary of this revision. (Show Details)Jul 9 2021, 8:54 AM
hctim added inline comments.Jul 9 2021, 11:41 AM
compiler-rt/test/hwasan/TestCases/longjmp.c
19

this relies on globals tagging. can you have p be declared in main() and passed as a parameter to f()? then no need to update the comment as well :)

20–21

the load of p[0] in main will crash.

hctim accepted this revision.Jul 9 2021, 11:46 AM

LGTM w/ comment change

compiler-rt/test/hwasan/TestCases/longjmp.c
19

nvm, as you point out this is p not &p. oops.

This revision is now accepted and ready to land.Jul 9 2021, 11:46 AM
fmayer updated this revision to Diff 357586.Jul 9 2021, 11:47 AM
fmayer marked an inline comment as done.

Fix comment.

This revision was automatically updated to reflect the committed changes.
This revision is now accepted and ready to land.Jul 12 2021, 10:18 PM
fmayer abandoned this revision.Oct 28 2021, 5:29 PM
fmayer marked 2 inline comments as done.

I realised this is already tested in longjmp-setjmp-interception.c