This is an archive of the discontinued LLVM Phabricator instance.

hwasan: Move stack ring buffer initialization before InitStackAndTls.
ClosedPublic

Authored by pcc on Aug 16 2021, 8:42 PM.

Details

Summary

D104248 moved the call to GetThreadStackAndTls to before the
initialization of the ring buffer TLS slot. As a result, if libc
is instrumented we crash in pthread_getattr_np which is called from
__sanitizer::GetThreadStackTopAndBottom.

Fix the problem by moving the stack ring buffer initialization before
the call to InitStackAndTls.

Diff Detail

Event Timeline

pcc requested review of this revision.Aug 16 2021, 8:42 PM
pcc created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2021, 8:42 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
eugenis accepted this revision.Aug 17 2021, 8:38 AM

LGTM

This revision is now accepted and ready to land.Aug 17 2021, 8:38 AM