-
Notifications
You must be signed in to change notification settings - Fork 6k
Made sure not to delete handles of dart objects if the isolate has been deleted #25506
Made sure not to delete handles of dart objects if the isolate has been deleted #25506
Conversation
| /// may cause memory to stick around until the isolate group is destroyed. | ||
| /// Currently if DartState::IsShuttingDown == true, this code will crash when | ||
| /// binding the isolate. | ||
| if (!dart_state->IsShuttingDown()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches the logic in DartWeakPersistentValue.
|
@xster @mkustermann what do you think about this approach for now? I don't know what our policy is for editing tonic is, I'll come up with a unit test for the DartIsolate stuff, too. |
This LGTM. Checking for shutdown condition is solving the exact same issue as we already do in weak persistent handles, so it should have the same solution. This fix is independent of lightweight isolates. (The original commit that added this condition to weak handles had some simple tests in it - maybe you can add a test case there, see ccdb681) The fact that we might leak those handles is specific to @gaaclarke Since this is low-risk, so we should cherry-pick this to the stable branch if possible. |
96eb4cc to
cbe2785
Compare
| Dart_DeletePersistentHandle(value_); | ||
| /// TODO(80155): Remove the handle even if the isolate is shutting down. This | ||
| /// may cause memory to stick around until the isolate group is destroyed. | ||
| /// Currently if DartState::IsShuttingDown == true, this code will crash when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the perspective of someone reading this in the future, this should read "Previously" right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to the code inside of the branch, that will crash. Reworded it.
|
This pull request is not suitable for automatic merging in its current state.
|
|
@gaaclarke is it possible to merge this? |
|
Yea, the bot was suppose to do it automatically, sorry. |
…e has been deleted (flutter/engine#25506)
…e has been deleted (flutter/engine#25506)
) * Made sure not to delete handles of dart objects if the isolate has been deleted (#25506) * Roll Dart SDK to 2.13.0-211.6.beta * update licenses golden Co-authored-by: gaaclarke <[email protected]>
|
@gaaclarke is it possible to have this cherry-picked to the upcoming stable hot fix as proposed by @mkustermann? |
|
It already is cherry picked in #25595 |
This fixes a crash but can result in memory living longer than expected. The memory fix will require a larger engineering effort. I think we should land this in the meantime. See the attached issue for a detailed explanation about what is happening here.
fixes flutter/flutter#79335
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.