-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Tracing GC on iOS yields mono_coop_cond_signal Cannot transition thread 0x2016c7280 from STATE_BLOCKING with DO_BLOCKING #88642
Comments
The crash is in I do a couple things that seem to avoid this issue, maybe?
Some links that might help: |
MacCatalyst! Very helpful, thanks. Sounds like you haven’t had good experience using mono-gcdump directly? It’s an extra step to convert, and the interactive mode looked useful. |
I don't think They are planning to make |
Good to know, thanks. Confirmed this works on MacCatalyst (at least for a default Maui app), with one change to the gist. Initially, monogc-dump failed with a known crash with the provider flags set to Microsoft-DotNETRuntimeMonoProfiler:0xC900001. Following @filipnavara's guidance here: filipnavara/mono-gcdump#6 (comment), I changed them to 0xC900003. That sadly caused the app to crash in the app when running the trace. But using the gist's instructions for a first trace, followed by filip's with a second trace while the app was still running, the monogram-dump convert completed, and the .gcdump file is viewable VS. |
Amending the above workaround. I am now able generate dumps from my own app. But to do so, I needed the first trace to completely omit the --providers flag and do default tracing, it crashed at startup otherwise. Once I did that, I was able to then run it with the GC flags. Btw, a leak I'm seeing includes a reference to Microsoft.Maui.Controls.Platform.GestureManager, and from this PR (dotnet/maui#15062) that may now be fixed in .net 8? |
@lateralusX can you see if you get this same kind of crash? |
Good news is that regular dotnet-gcdump will work with Mono in .net8 :). I think the issue that gets hit here is due to starting up the runtime in suspend mode and then try to do a gc dump as first session, that will probably cause this issue. Doing a regular trace first will make sure runtime leave its suspend startup state and when a gc dump is done later, it will work as intended, since runtime is up and running, capable of doing gc dumps. So when doing a gc dump, don't suspend the runtime on startup, you do that by removing the suspend flag:
Suspending runtime on startup is normally only needed when analyzing startup performance issues and not the default configuration for EventPipe. |
Tried this on iOS simulator .net8 without hitting the crash either using dotnet-gcdump or the legacy Microsoft-DotNETRuntimeMonoProfiler to get a gc dump. If runtime is started in suspend mode, dotnet-gcdump will hang since that tool is not prepared to work with runtimes in suspend mode (tool needs to run a resume runtime command), so that means you can't run dotnet-gcdump with runtime setup in suspend mode, that is rather good, since taking a gcdump during runtime startup is probably not what you want anyways. Running with Microsoft-DotNETRuntimeMonoProfiler using dotnet-trace will make the runtime resume, but in .net8 the provider won't try to do a GC until runtime has been fully initialized and that won't be the case when doing startup tracing, so resulting .nettrace file won't include a gc dump. If you on the other hand requests dumps once the runtime is up and running, both dotnet-gcdump as well as Microsoft-DotNETRuntimeMonoProfiler gives expected results. Since the issue seems to be resolved in .net8 and since we have standard ways to do dumps in .net8 using dotnet-gcdump as well as the issue in .net7 is probably due to starting up runtime in suspend mode, I will close this issue. |
Description
I'm seeing a Mono crash while trying to create a GC .nettrace file with dotnet-dstrace and dotnet-dsrouter in both Debug and Release Maui builds in the iOS simulator.
This appears to be a Mono issue, but I was directed here by the workflow, and I'm also wondering how @jonathanpeppers is successfully diagnosing leaks on iOS.
Steps to Reproduce
Create a new default vanilla iOS Maui app, MauiTest, no changes.
Install and run app on simulator (udid here is for iPhone 14, ymmv).
App crashes:
Link to public reproduction project repository
https://github.com/kcoop/MauiTest
Version with bug
7.0.49
Last version that worked well
6.0
Affected platforms
iOS, I was not able test on other platforms
Affected platform versions
iOS 16.4
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: