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
Hot reload crashes the mac os desktop embedder #44724
Comments
I was able to reproduce a crash, not sure if it was the crash. This is happening on the macOS desktop embedder when running in debug mode
I noticed that TextRange doesn't have an entrypoint annotation (should it?), but I did not think this mattered in debug mode. |
Actually, this isn't an entrypoint issue since the embedder isn't calling into text range. |
Current theory from @alexmarkov is that I wasn't loading the core snapshots correctly, but since we were linking the platform in it didn't matter. Verifying that now |
Forcing platform linking in debug mode issue casues the crash to disappear. I'm now looking into why we're not correctly supplying the core snapshots. |
My read of the situation is:
In the meantime, we shouldn't keep the desktop targets broken though. I would propose that we force platform linking on desktop platforms for now |
It sounds like there was a breaking change to the behavior of the embedding API? That's not supposed to happen, and would affect third-party projects that we don't control. |
It wasn't a change to the embedder API, it was a change in how we built the initial kernel file that uncovered it. We never supplied the callbacks for isolate/vm data EDIT: |
I understand that the API didn't change, but it sounds like a change was made such that if someone were using the embedding API in the past, successfully, it will no longer work for them after an update unless they make changes to how they use it. That violates the compatibility intent of that API later as I have understood it. |
Just catching up on this. Can you elaborate on:
Is this something each desktop application will need to change? Or is it something that needs to be changed internally to Flutter? |
Also, is this crash reproducible in the desktop example app? Or does it require a more complex app to surface the issue? |
We produce two artifacts ( a core snapshot) that contain parts of a precompiled dart-sdk for debug mode only. Android and iOS correctly load this artifact from the flutter assets_directory, but we never did the same for the desktop embedder. It happened to work, because we were previously compiling the entire dart-sdk into the initial kernel dill. To avoid this extra work, I disabled link-platform for debug mode fairly recently, which caused this particular macOS crash: since it doesn't have the core snapshots and doesn't have the linked platform there is no actual dart-sdk loaded into the program. The workaround is to turn link-platform back on for desktop targets. The actual fix is to update the embedder to allow loading these snapshots in debug mode, and update the desktop shells to load them from flutter assets. The change is internal to the desktop shells, applications won't need to do anything.
This crash was trivially reproducible, it might be related to the other macOS crash but it needs more investigation. Matt and I are going to take a look on Friday. |
Can you link to the PR where link-platform was disabled? I'd like to correlate that change to when we started seeing problems on our end, as data around whether there is another problem lurking behind that one. |
OK. I don't think that change could account for all the issues we have been seeing, because it only landed 9 days ago, and we started seeing issues before that. Still, there was a separate app-specific fix that we landed today that might possibly account for the earlier failures. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
When the first reload attempt has dirty libraries, the macOS desktop embedder silently crashes during reassemble. However, if the first reload has no dirty libraries, then subsequent reloads succeed.
@jonahwilliams @stuartmorgan
The text was updated successfully, but these errors were encountered: