Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[release/9.0-staging] [Profiler] Avoid Recursive ThreadStoreLock in Profiling Thread Enumerator#110665

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@github-actions
Copy link
Contributor

@github-actionsgithub-actionsbot commentedDec 12, 2024
edited by mdh1418
Loading

Backport of#110548 to release/9.0-staging

/cc@mdh1418

Customer Impact

  • Customer reported
  • Found internally

#110062
Profiler users invokingEnumThreads within aRuntimeSuspendFinished callback will cause aninfinite wait because theEnumThreads will recursively acquire/release the ThreadStore lock.

Regression

  • Yes
  • No

This did not occur in .NET 8.0. The recursive ThreadStoreLock acquire/release was always there, butthe condition that previously prevented this case causing an infinite wait was removed in#101782

Testing

The issue was reproduced locally and the fix was confirmed locally.
The issue was missed previously because there were no profiler tests covering this edge-case scenario. It is hard to cover all the ways our customers will use Profiler APIs.
A runtime test was added for this particular scenario, invoking theEnumThreads API within aRuntimeSuspendFinished callback.

Risk

Low. The changes only affect Profiler users that specifically invokeEnumThreads within aRuntimeSuspendFinished callback and trigger a GC.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch isrelease/X.0-staging, notrelease/X.0.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Profiling Enumerators look to acquire the ThreadStoreLock.In release config, re-acquiring the ThreadStoreLock andreleasing it in ProfilerThreadEnum::Init will causeproblems if the callback invoking EnumThread has logicthat depends on the ThreadStoreLock being held.To avoid recursively acquiring the ThreadStoreLock,expand the condition when the profiling thread enumeratorshouldn't acquire the ThreadStoreLock.
There was a potential race condition when setting the flagbefore suspending and resetting the flag after restarting.For example, if the thread restarting runtime is preemptedright after resuming runtime, the flag could remain unsetby the time another thread looks to suspend runtime, whichwould see that the flag as set.
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area:@tommcdon
See info inarea-owners.md if you want to be subscribed.

@mdh1418mdh1418 added this to the9.0.x milestoneDec 18, 2024
@tommcdontommcdon added the Servicing-approvedApproved for servicing release labelDec 18, 2024
@mdh1418
Copy link
Member

Approved via email.

@mdh1418mdh1418 merged commit7eb5ef2 intorelease/9.0-stagingDec 19, 2024
97 of 101 checks passed
@jkotasjkotas deleted the backport/pr-110548-to-release/9.0-staging branchDecember 29, 2024 15:49
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 29, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@tommcdontommcdontommcdon approved these changes

@VSadovVSadovAwaiting requested review from VSadov

Assignees

No one assigned

Labels

area-Diagnostics-coreclrServicing-approvedApproved for servicing release

Projects

None yet

Milestone

9.0.x

Development

Successfully merging this pull request may close these issues.

3 participants

@mdh1418@tommcdon

[8]ページ先頭

©2009-2025 Movatter.jp