You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Engine, PlatformView, Hybird Composition] Potential deadlock on platform thread caused by Thread Merge #80491
Suppose we have TaskRunner A, which belong to Thread A currently, and TaskRunner B, which belong to Thread B currently. The following steps happen sequentially will cause deadlock.
Thread B is executing Task M, which belong to TaskRunner B;
Thread A post Task N to TaskRunner B, and block itself to wait Task N signal the latch;
Task M merge TaskRunner B to TaskRunner A, then the new added Task N will be executed on Thread A;
Raster thread is drawing a frame, and SurfaceChanged just happen on Platform thread;
Platform thread post a task to RasterTaskRunner to resize Surface, which still belong to raster thread at this moment;
Platform thread is waiting the above resize task executing;
At the end of frame drawing, because we have a new PlatformLayer, then Rasterizer will merge RasterTaskRunner to PlatformTaskRunner, then the new added resize task will be executed on Platform thread now, and we got deadlock on Platform thread;
changed the title [-]Potential deadlock on platform thread caused by Thread Merge[/-][+][Engine] Potential deadlock on platform thread caused by Thread Merge[/+]on Apr 15, 2021
changed the title [-][Engine] Potential deadlock on platform thread caused by Thread Merge[/-][+][Engine, PlatformView, Hybird Composition] Potential deadlock on platform thread caused by Thread Merge[/+]on Apr 15, 2021
Hi @rogeryi
Unfortunately, I am not familiar with the Engine platform view.
Can you please explain if this is a bug and Is there any way to verify these reproducible steps?
Thank you
Hi @rogeryi
Unfortunately, I am not familiar with the Engine platform view.
Can you please explain if this is a bug and Is there any way to verify these reproducible steps?
Thank you
Yes, its a bug and when it happen, it will cause Flutter Platform thread deadlock and the App will not response anymore.
But this is probabilistic threading issue, and its chance is rare, although in theory it is exists, but hard to reproduce it stably.
We currently use PlatfromVie's technical solution in our own application. We have discovered a large number of thread merging problems causing deadlocks. Our number of users is in the tens of millions. One of the interfaces has caused a very high problem due to this thread merging problem. Crash rate, I think this is a problem worthy of attention.
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 flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]Potential deadlock on platform thread caused by Thread Merge[/-][+][Engine] Potential deadlock on platform thread caused by Thread Merge[/+][-][Engine] Potential deadlock on platform thread caused by Thread Merge[/-][+][Engine, PlatformView, Hybird Composition] Potential deadlock on platform thread caused by Thread Merge[/+]TahaTesser commentedon Apr 15, 2021
Hi @rogeryi
Unfortunately, I am not familiar with the Engine platform view.
Can you please explain if this is a bug and Is there any way to verify these reproducible steps?
Thank you
rogeryi commentedon Apr 15, 2021
Yes, its a bug and when it happen, it will cause Flutter Platform thread deadlock and the App will not response anymore.
But this is probabilistic threading issue, and its chance is rare, although in theory it is exists, but hard to reproduce it stably.
tylorvan commentedon Jul 30, 2021
Is it resolved? We has faced the same bug in our app.
tongyangsheng commentedon Nov 30, 2021
Is it resolved? We has faced the same bug in our app.
tongyangsheng commentedon Nov 30, 2021
We currently use PlatfromVie's technical solution in our own application. We have discovered a large number of thread merging problems causing deadlocks. Our number of users is in the tens of millions. One of the interfaces has caused a very high problem due to this thread merging problem. Crash rate, I think this is a problem worthy of attention.
dnfield commentedon Dec 9, 2021
I'm going to close this in favor of #94524, which at this point has more context.
github-actions commentedon Dec 23, 2021
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
flutter doctor -vand a minimal reproduction of the issue.