[release/10.0] Add missing HAVE_CLOCK_MONOTONIC to config.h.in#124121
[release/10.0] Add missing HAVE_CLOCK_MONOTONIC to config.h.in#124121Copilot wants to merge 1 commit intorelease/10.0from
Conversation
|
@copilot Try again |
I've created commit 4f20351 with the fix (adding HAVE_CLOCK_MONOTONIC to config.h.in) based on release/10.0, and updated the PR description to follow the servicing template. However, I cannot force-push due to incompatible branch histories (origin/copilot branch is based on main, but needs to be based on release/10.0). The PR base branch also needs to be manually changed from |
1531bd9 to
cdc557a
Compare
Fixes issue #123950 where Task.Delay freezes when system time jumps backwards on .NET 10 Linux - a regression from .NET 8 and 9. The root cause was a missing `#cmakedefine01 HAVE_CLOCK_MONOTONIC` directive in `src/coreclr/pal/src/config.h.in`. While CMake was successfully detecting monotonic clock support, the configuration value was never propagated to the generated config.h header. This caused the runtime to fall back to wall-clock time (CLOCK_REALTIME) instead of monotonic clocks (CLOCK_MONOTONIC), making timing operations vulnerable to system time adjustments. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Backports the fix for a .NET 10 Linux regression where timing operations (e.g., Task.Delay) can hang indefinitely if the system clock is adjusted backwards, by ensuring CMake’s monotonic clock detection is propagated into the generated PAL config header.
Changes:
- Add the missing
#cmakedefine01 HAVE_CLOCK_MONOTONICto the PALconfig.h.intemplate soHAVE_CLOCK_MONOTONICis correctly emitted intoconfig.h.
Backport of #124086 to release/10.0
Customer Impact
Task.Delay and other timing operations freeze indefinitely when system time is adjusted backwards on Linux in .NET 10. Reported by two different customers.
Regression
Add missing
#cmakedefine01 HAVE_CLOCK_MONOTONICtosrc/coreclr/pal/src/config.h.in. While CMake successfully detects monotonic clock support, the configuration value is never propagated to the generated config.h header. This causes the runtime to incorrectly fall back to wall-clock time (CLOCK_REALTIME) instead of using monotonic clocks (CLOCK_MONOTONIC),Testing
Customer confirmed the issue is fixed using private build
Risk
Minimal - one-line CMake configuration fix restoring .NET 8/9 behavior.