-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[release/8.0-staging] Fix #91958: use mach_timebase_info to determine process time coefficient on macOS #100122
[release/8.0-staging] Fix #91958: use mach_timebase_info to determine process time coefficient on macOS #100122
Conversation
…efficient on macOS
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
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.
LGTM, thank you for backporting the fix @jeffhandley !
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.OSX.cs
Outdated
Show resolved
Hide resolved
Without this fix, it was possible for another thread to see an incorrect (zero) value of s_timeBase_numer because of a race condition.
@jeffhandley should this be marked as servicing consider now that #100122 (comment) got resolved? If so, do we need to email tactics? |
@jozkee I didn't find a Tactics email, so assuming this is ready (pending @jeffhandley 's or @adamsitnik 's confirmation), then yes, please send an email to Tactics and add the |
This was approved in email and needs an approval for merge. @jkotas -- you can ignore the re-review request as this can now be merged. |
8acc1b5
into
dotnet:release/8.0-staging
Backport of #92185 to release/8.0-staging
Customer Impact
This has been reported by 2 customers. The first report was in September 2023 by @ForNeVeR in #91958, and they also provided the fix and tests. The issue was reported again by @huntharo in February with #98121. In that issue, @huntharo requested that this fix be backported to 8.0. As @huntharo stated:
Regression
While this isn't a product regression, it's behavior that became incorrect with Apple Silicon.
Testing
@ForNeVeR included a new test with their fix that is part of this backport. The test performs a native call and compares the API's results against the native results. As stated in the original PR:
Risk
Low. This is a targeted fix that only affects
PrivilegedProcessorTime
,TotalProcessorTime
, andUserProcessorTime
on macOS. While the fix had been in main since September, a race condition bug in the original fix was found during the review of this backport. That bug was fixed in main on March 25 and cherry-picked to this backport.The automatic backport of this fix failed due to a merge conflict in src/libraries/Common/src/Interop/OSX/Interop.Libraries.cs. That conflict arose because the preceding line to the change here was removed in 20a3350. Otherwise, the rest of the merge was clean.