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
Engine crash in MessageLoopTaskQueues::NotifyObservers #38778
Comments
This seems related to dynamic thread merging but the engine SHA does not include the changes to the same made over the weekend. @iskakaushik: Does this look related? Probably needs more investigation but it seems like a junk observer is getting invoked. |
Potential fix for: flutter/flutter#38778
@ds84182 I'm still trying to reproduce this issue. One theory I have is that there might be I've made some changes so we warn when we do this going forward: flutter/engine#11315 Looks like you are running this on android, on commit Also is the backtrace you have provided for a 64 bit device? Thanks! |
Potential fix for: flutter/flutter#38778
Potential fix for: flutter/flutter#38778
Potential fix for: flutter/flutter#38778
@iskakaushik It is a 32-bit Android device. The backtrace above was from release mode, but I've also hit it in debug mode. |
/cc @adazh |
I was able to reproduce this by running an internal customer test case, and I think I know why this is happening. The crash occurs in
One option would be replacing the The map will also make it easier to clean up a queue after the engine that created the queue is deleted. |
The core underlying issue is that vector push_back could re-allocate and cause us to segfault. I have switched the backing queues to a map per @jason-simmons suggestion in flutter/flutter#38778. I've also added a test to capture the aforementioned bug. I've run internal tests several times to validate that this is fixed. General threading note for this class is that only the following operations take a write lock on the meta mutex: 1. Create 2. Dispose The rest of the operations take read lock on the meta mutex and acquire finer grained locks for the duration of the operation. We can not grab read lock for the entire duration of NotifyObservers for example because observer can in-turn create other queues -- Which we should not block. Additional changes: 1. Make as many methods as possible const. Unlocked methods are all const. 2. Migrate all the queue members to a struct, and have a map. 3. Get rid of the un-used Swap functionality.
@ds84182 looks like this is fixed per our internal testing. Please let me know if you still run into issue on master. Thanks! |
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 |
Very inconsistent crash, may be concurrency related. The stack trace the tombstone gives back is incorrect (lack of frame pointers?). Here's a symbolicated stack dump instead:
Manual stack trace:
Typically this happens during image loading in my project. I use a background view to manage thumbnail downloading (since I can use the http2 package, which works quite nicely). It is somewhat hard to reproduce, but it has happened on multiple devices.
cc @iskakaushik @chinmaygarde
The text was updated successfully, but these errors were encountered: