This is an archive of the discontinued LLVM Phabricator instance.

[asan] Reduce flakiness in stack-overflow detection
ClosedPublic

Authored by kubamracek on Apr 10 2018, 7:47 PM.

Details

Summary

IsStackOverflow only treats accesses within 512 bytes of SP as stack-overflow. This should really be the size of a page instead.

The scariness_score_test.cc triggers stack overflow with frames that are even larger than a page, which can also trigger a fault that will not be recognized as stack-overflow. Let's just use smaller frames.

Diff Detail

Event Timeline

kubamracek created this revision.Apr 10 2018, 7:47 PM
Herald added a subscriber: Restricted Project. · View Herald TranscriptApr 10 2018, 7:47 PM

LGTM, but probably someone else would need to check this as well.

This revision is now accepted and ready to land.Apr 11 2018, 10:43 AM
eugenis accepted this revision.Apr 11 2018, 11:19 AM

Out of curiosity, how does access that far below SP happen in that test? Redzone? But that's not a leaf function.

Out of curiosity, how does access that far below SP happen in that test? Redzone? But that's not a leaf function.

This is related to stack protectors and stack probing, see https://reviews.llvm.org/D40856. When stack probing is enabled, we make an access to the end of the frame before SP is updated.

LGTM, please add a comment though

kubamracek closed this revision.Apr 12 2018, 6:09 PM

Landed in r329980.