Page MenuHomePhabricator

[Sanitizer] Fix segfaults during unwinding on SystemZ
ClosedPublic

Authored by iii on Aug 12 2020, 2:23 AM.

Details

Summary

Every now and then SystemZ programs built with ASan crash with

ERROR: AddressSanitizer: stack-overflow on address 0x040000000000

for no apparent reason. The problem is that
BufferedStackTrace::UnwindFast() is specialized for SystemZ: it takes
register 14 from the frame, however, IsValidFrame() is not
specialized, and does not guarantee that frame[14] is going to be a
valid memory access.

Fix by introducing per-arch kFrameSize and using it in IsValidFrame().

Diff Detail

Event Timeline

iii created this revision.Aug 12 2020, 2:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2020, 2:23 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
iii requested review of this revision.Aug 12 2020, 2:23 AM
uweigand accepted this revision.Aug 12 2020, 11:43 AM

Yes, this makes sense to me as well. Patch LGTM.

This revision is now accepted and ready to land.Aug 12 2020, 11:43 AM
This revision was automatically updated to reflect the committed changes.