-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Remove maximum OSX version for sanitizers #77543
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
Conversation
Pinging people that were involved in my previous review (#74394) as this is in the same area of the code and is related to the same things (OSX, Sanitizers, CMake). Thanks in advance for any thoughts. |
Thank you Chris for this detailed write up. We really appreciate open source contributions to make sanitizers work better on Darwin. I am happy with this PR since it just removes the "clamp max min version at some arbitrary (old) value". The default stays the same. Comment on:
I don't think this is necessarily true. There is 2 issues to consider: building and availability at runtime.
I am not 100% certain if there isn't a more tricky reason, but my guess for On a different note: I am open to bumping the minimal deployment target (even if not strictly necessary) if it eases the maintenance burden. |
Thanks for the clarity on this point, that makes a lot of sense! I was very surprised to think that these were so "behind" the newer OS.
@yln could you point me to an example of this? I'm trying to find one for Understanding that will help me........
....do this! Happy to follow up with some PRs to do some of this, I'm in the area. Lastly:
Let me know if you'd like to see this in this review, or a future one, and what version to move it to. As mentioned in the wall of text there are some deprecation warnings in newer versions while building, but no build errors. |
The libdispatch APIs here (added in e0e0244):
Albeit the reason wasn't to intercept a new API, but to reduce our dependencies on the SDK.
In a separate PR please and with some justification "What does it buy us?". This will require extensive qualification on our side. I am deferring to @thetruestblue who already did some investigation on this. |
Great, thanks Julian! Very helpful.
Sounds good, I will leave this PR as it is now. I will also defer this version bump PR to someone else, as this decision is above my paygrade. However I am more than happy to be involved or help test, all someone has to do is reach out. |
Pinging @yln @vitalybuka @petrhosek @thetruestblue For more reviews, or merging if it's appropriate. Thank you |
Thank you, Chris! |
Remove a block preventing newer versions of the MacOS SDK from being selected for compiling the sanitizers.
Remove a block preventing newer versions of the MacOS SDK from being selected for compiling the sanitizers.
As a backup proposal (if this is unacceptable), I think we should consider increasing the maximum version to (minimally) 10.15, or 14.0 (latest as of writing) to allow the sanitizers to intercept more modern calls like
aligned_alloc
andshared_mutex
, introduced in 10.15 and 10.12 respectively.History
The limitation on the max version of OSX was committed here, originally set to 10.9:
41c5288
Later, it was updated to be 10.10 in this commit:
b87fc09
This means the original error was that the sanitizers could not build with the errors produced in a newer version than 10.9, and later 10.10.
Why we may want to go higher than 10.10 (or not limit at all)
There are some sanitizers that do not intercept functions that they could because these APIs do not exist in the version we are targeting.
Take for example
aligned_alloc
, introduced in 10.15:We have a few interceptors that cannot intercept aligned_alloc:
TSan seemingly would use aligned_alloc if it were available to it (but does not use the SANITIZER_INTERCEPT_ALIGNED_ALLOC call)
ASan shows aligned_alloc in their linux interceptors, but no such call exists in their mac interceptors
Additionally, any future interceptor that wants to intercept calls introduced later than 10.10 will be blocked. For instance, in my own development I have been blocked intercepting
shared_mutex
(introduced 10.12) andaligned_alloc
(introduced in 10.15).Testing
I have tested 3 versions, the existing 10.10, 10.15 (the latest I personally care about), and 14.0 (the latest MacOS available as of writing). I was attempting to confirm that no regressions happened in the newer versions, and the limitation could be removed.
Each of these tests I:
check-ubsan
check-asan
check-ubsan
clang
,compiler-rt
andllvm-symbolizer
Summary
No versions tested that were newer than 10.10 had any regressions or errors compiling.
check-asan
failed 137 tests against all versions, remaining the same, the others had no failures.The newer versions (10.15 and 14.0) did report a number of deprecation warnings, but no compilation errors.
Full testing results
Testing done on this machine:
With MacOS version 10.10 (Existing default today)
UBSan
No failures
ASan
Failed: 137 tests
TSan
No failures
Building main targets
Succeeds
With MacOS version 10.15
UBSan
No failures
ASan
Failed: 137 tests - SAME AS 10.10
TSan
No failures
Building main targets
Succeeds
With MacOS version 14.0 (latest released)
UBSan
No failures
ASan
Failed: 137 tests - SAME AS 10.10
TSan
No failures
Building main targets
Succeeds
Future PRs
To not overload this PR, I omitted these, but they should be done in quick succession, which I'm happy to do.
A few sanitizers unnecessarily do not include interceptors for
aligned_alloc
which could be easily fixed.SANITIZER_INTERCEPT_ALIGNED_ALLOC (!SI_MAC)
to be version dependent, if the version is greater than 10.15, this should evaluate to trueTSAN_INTERCEPTOR
to use theSANITIZER_INTERCEPT_ALIGNED_ALLOC
macro, currently it is blocked out behind just!SANITIZER_APPLE
aligned_alloc
tocompiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
, as it is missing, but all other allocations exist there.Lastly, we may want to consider increasing the default version from 10.10:
See "Why we may want to go higher" for details on these changes.