Skip to content
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

[mono] Fix class initialization spurious wakeups #96903

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Jan 12, 2024

  1. mono_runtime_class_init_full: handle spurious wakeups.
    the condition variable may be signaled even if the initialization by the other thread is not done yet. Handle spurious wakeups the same way as timeouts: go around once more from the beginning.

    Fixes [monovm] Assertion at object.c:657, condition `lock->done' not met #96872 and [Android][Regression] * Assertion at /__w/1/s/src/mono/mono/metadata/object.c:657, condition `lock->done' not met #96804

  2. fix unbalanced handle frames.
    if we goto retry_top, don't set up a new handle frame that lacks a matching HANDLE_FUNCTION_RETURN_VAL.

    Instead setup the handle frame once upfront

the condition variable may be signaled even if the initialization by
the other thread is not done yet.  Handle spurious wakeups the same
way as timeouts: go around once more from the beginning.

Fixes dotnet#96872
if we goto retry_top, don't set up a new handle frame that lacks a
matching HANDLE_FUNCTION_RETURN_VAL.

Instead setup the handle frame once upfront
@thaystg
Copy link
Member

thaystg commented Jan 12, 2024

@lambdageek I think it also fixes this one right?
#96804

@lambdageek
Copy link
Member Author

@lambdageek I think it also fixes this one right? #96804

yes. same issue.

@lambdageek
Copy link
Member Author

/azp run runtime-extra-platforms

@lambdageek
Copy link
Member Author

/backport to release/8.0-staging

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/7505359031

@lambdageek
Copy link
Member Author

All failures are known

@lambdageek lambdageek merged commit b610c99 into dotnet:main Jan 12, 2024
151 of 163 checks passed
@IKPegasi
Copy link

@lambdageek , Is this change (#96903) available on a daily build. I am seeing the same issue ("Assertion at /__w/1/s/src/mono/mono/metadata/object.c:657, condition `lock->done' not met") after updating to dotnet 8.0.100. Tried the "8.0.200-preview.24064.2" and that didn't have the fix either(crashes) .

@lambdageek
Copy link
Member Author

@lambdageek , Is this change (#96903) available on a daily build. I am seeing the same issue ("Assertion at /__w/1/s/src/mono/mono/metadata/object.c:657, condition `lock->done' not met") after updating to dotnet 8.0.100. Tried the "8.0.200-preview.24064.2" and that didn't have the fix either(crashes) .

the release/8.0-staging branch was just merged into release/8.0 branch this morning. it usually takes about half a day for packages to be built. after that it takes a few days for the packages to flow from dotnet/runtime to dotnet/sdk and dotnet/installer. tl;dr - the changes aren't available to try out yet

tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
* mono_runtime_class_init_full: handle spurious wakeups

the condition variable may be signaled even if the initialization by
the other thread is not done yet.  Handle spurious wakeups the same
way as timeouts: go around once more from the beginning.

Fixes dotnet#96872 and dotnet#96804

* fix unbalanced handle frames

if we goto retry_top, don't set up a new handle frame that lacks a
matching HANDLE_FUNCTION_RETURN_VAL.

Instead setup the handle frame once upfront
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[monovm] Assertion at object.c:657, condition `lock->done' not met
3 participants