This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Support IsRssLimitExceeded in all sanitizers
ClosedPublic

Authored by vitalybuka on Dec 2 2021, 2:33 PM.

Diff Detail

Event Timeline

vitalybuka created this revision.Dec 2 2021, 2:33 PM
vitalybuka requested review of this revision.Dec 2 2021, 2:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 2:33 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
kstoimenov accepted this revision.Dec 2 2021, 8:49 PM

LTGM

compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
86

I am little worried that someone might try to use this variable to check if the tread has been initialized. Instead maybe make this a void* and aways return nullptr?

This revision is now accepted and ready to land.Dec 2 2021, 8:49 PM
vitalybuka added inline comments.Dec 3 2021, 10:54 AM
compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
86

you can check void* as well

maybe something like:

class ThreadGlobalConstructor() {
  ThreadGlobalConstructor() {
     ....
  }
} thread_global_constructor UNUSED;
kstoimenov added inline comments.Dec 3 2021, 12:12 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
86–102

Can you try this? It might be a little too convoluted as it is using the comma operator. The lambda is void in this case and the expression is always nullptr. Probably your class solution is better though...

This revision was landed with ongoing or failed builds.Dec 3 2021, 12:45 PM
This revision was automatically updated to reflect the committed changes.