This is an archive of the discontinued LLVM Phabricator instance.

testing for tail call optimization repression when sanitizing use-after-dtor
ClosedPublic

Authored by nmusgrave on Jul 29 2015, 4:23 PM.

Details

Summary

Verify that running in optimized mode while checking for use-after-dtor errors, does not generate tail call invocation of destructor. This avoids possible error where stack frame for the destructor is eliminated, making tracking down the errors more difficult.

Diff Detail

Event Timeline

nmusgrave updated this revision to Diff 30966.Jul 29 2015, 4:23 PM
nmusgrave retitled this revision from to testing for tail call optimization repression when sanitizing use-after-dtor.
nmusgrave updated this object.
nmusgrave added reviewers: eugenis, kcc.
nmusgrave added a subscriber: cfe-commits.
eugenis added inline comments.Jul 29 2015, 4:26 PM
test/msan/dtor-tail-call.cc
35 ↗(On Diff #30966)

Use @LINE to refer to line numbers in the test case.

37 ↗(On Diff #30966)

You don't need a 'CHECK-OPT' if it's the same as 'CHECK'

41 ↗(On Diff #30966)

Don't refer to the line numbers in other files, they will change.
In this case it would be ok to end the line after __sanitizer_dtor_callback}}

nmusgrave marked 3 inline comments as done.Jul 29 2015, 4:55 PM
nmusgrave updated this revision to Diff 30970.Jul 29 2015, 4:57 PM
  • simplified test cases
nmusgrave updated this revision to Diff 30981.Jul 29 2015, 6:59 PM
  • updated line numbering on test
eugenis accepted this revision.Jul 30 2015, 11:22 AM
eugenis edited edge metadata.

LGTM

Please rename the test to "use-after-dtor.cc". It's not really about tail calls, it's a general test of the use-after-dtor report.

test/msan/dtor-tail-call.cc
4 ↗(On Diff #30981)

Add a test at -O2

35 ↗(On Diff #30981)

Maybe remove the space after "main" to make this more robust, in case, on some other platform, the symbolizer would add () after main.

39 ↗(On Diff #30981)

Remove () for the same reason

This revision is now accepted and ready to land.Jul 30 2015, 11:22 AM
nmusgrave updated this revision to Diff 31061.Jul 30 2015, 11:34 AM
nmusgrave marked 3 inline comments as done.
nmusgrave edited edge metadata.
  • simplified test cases
  • updated line numbering on test
  • renamed test
nmusgrave closed this revision.Jul 30 2015, 3:13 PM