-
Notifications
You must be signed in to change notification settings - Fork 1
[Sketch] Rtsan/intercept more apple locks sanitizer dense map #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Sketch] Rtsan/intercept more apple locks sanitizer dense map #40
Conversation
| void __rtsan::Context::RealtimePush() { realtime_depth_++; } | ||
| void __rtsan::Context::RealtimePush() { | ||
| __sanitizer::SpinMutexLock lock{&spin_mutex_}; | ||
| depths_[pthread_self()].realtime++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to think about handling the case where depths_ would need to be resized and (potentially) allocate more memory
| ExpectBypassed(true); | ||
| } | ||
|
|
||
| TEST_F(TestRtsanContext, IsProbablyThreadSafe) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume this test would almost certainly not be able to be kept. But you never know.
| return REAL(os_unfair_lock_lock)(lock); | ||
| } | ||
|
|
||
| INTERCEPTOR(void, os_unfair_lock_unlock, os_unfair_lock_t lock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the one that triggered infinite recursion previously
This a just a draft PR to show a possible approach to userspace TLS in RTSan, thereby avoiding recursion from
pthread_onceimplementations calling an intercepted function during__rtsan::Contextinitialisation.