This is an archive of the discontinued LLVM Phabricator instance.

[HWSAN] Use ThreadArgRetval in HWSAN
ClosedPublic

Authored by vitalybuka on May 8 2023, 5:10 PM.

Details

Summary

Fixes false leaks on thread arg, retval.

Diff Detail

Event Timeline

vitalybuka created this revision.May 8 2023, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 5:10 PM
Herald added a subscriber: Enna1. · View Herald Transcript
vitalybuka requested review of this revision.May 8 2023, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 5:10 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
Enna1 accepted this revision.May 8 2023, 8:48 PM
Enna1 added inline comments.
compiler-rt/lib/hwasan/hwasan_interceptors.cpp
91–97

Not related to this patch.
Just wondering why we intercept pthread_join first argument as void *, the actual type is pthread_t, is there any context about this?

This revision is now accepted and ready to land.May 8 2023, 8:48 PM
vitalybuka added inline comments.May 9 2023, 12:05 AM
compiler-rt/lib/hwasan/hwasan_interceptors.cpp
91–97

typedef unsigned long int pthread_t; which is size of pointer on posix compilers
internally, for glibc, pthread_t is just a pointer to internal data structure.

we cannot include pthread.h here, but it would be cleaner to have some our typedef for that.

Enna1 added inline comments.May 9 2023, 6:38 PM
compiler-rt/lib/hwasan/hwasan_interceptors.cpp
91–97

Got it, thanks!

This revision was automatically updated to reflect the committed changes.