Skip to content

Conversation

@VSadov
Copy link
Member

@VSadov VSadov commented Apr 27, 2023

Fixes: #85377

GC makes no promises about coop mode when GC callouts are invoked.
Background GC, for example, may invoke callouts in preemptive mode. Foreground GC with WKS will do it in coop.

@ghost ghost assigned VSadov Apr 27, 2023
@ghost
Copy link

ghost commented Apr 27, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes: #85377

GC makes no promises about coop mode when GC callouts are invoked.
Background GC, for example, may invoke callouts in preemptive mode.

Author: VSadov
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to do this before the TSF_Attached check. We do not want to attach untached GC threads as a side-effect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, on server GC this could be unattached thread.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to pass ServerGarbageCollection=true to src\tests\build.cmd ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set DOTNET_gcServer=1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out src\tests\build.cmd can pass through paramters to msbuild, but src/tests/build.proj was not propagating some parameters that could be useful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
m_pTransitionFrame = NULL;

This should not be need.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this as very first thing in the method to avoid duplication. It will make the code a bit smaller.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this makes the dwarf warnings test to fail

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something up the stack sets StripSymbols and once propagated it breaks the test.
StripSymbols is a very useful setting if someone needs to debug tests, but we can deal with that later.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@VSadov
Copy link
Member Author

VSadov commented Apr 28, 2023

Thanks!

@VSadov VSadov merged commit c04933d into dotnet:main Apr 28, 2023
@VSadov VSadov deleted the Fix85377 branch April 28, 2023 13:32
@ghost ghost locked as resolved and limited conversation to collaborators May 28, 2023
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.

ReversePInvoke transition should be no-op in DoNotTriggerGc region on NativeAOT

2 participants