flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[desktop_webview_window] [Flutter 3.22.0] App crashes on windows when webview is closed

Open anirudhJG opened this issue 1 year ago • 5 comments

App crashes when webview is closed from method channel API

Reproduce Steps

Steps to reproduce the behavior: 1.Update to Flutter version 3.22.0 2. Close from the close API method channel 3. Notice App crashing 4. Message is Exception thrown at 0x00007FFF7DF25CB4 (flutter_windows.dll) in App.exe: 0xC0000005: Access violation reading location 0x00000000000002F0.

Expected behavior

App should not crash

Version (please complete the following information):

  • Flutter Version: 3.22.0
  • OS: Windows
  • plugin: desktop_webview_window

anirudhJG avatar Sep 12 '24 11:09 anirudhJG

I'm getting same issue, it's reproducible ~5% of the time close() is called

It's consistently pointing to flutter_windows, while another thread is consistently pointing to destructor of either desktop_webview_window or desktop_multi_window

Admittedly I got a weird setup going on (intermixing both plugins), but seems like others are also getting this issue

  • e.g.: seems both desktop_webview_window and desktop_multi_window plugins might be affected

desktop_webview_window example: image image desktop-webview-window-symbolicated.txt

desktop_multi_window example: image image desktop-multi-window-symbolicated.txt

Flutter Version: 3.22.3, Dart 3.4.4 OS: Windows plugins: desktop_webview_window, desktop_multi_window

isaacy13 avatar Oct 21 '24 21:10 isaacy13

Updated Flutter SDK to stable channel (Flutter 3.24.3, Dart 3.5.3 at time of writing)

Could be placebo, but it feels more stable (still replicated crash once, but A LOT harder to reproduce now)

Seems like flutter_windows.dll is root cause (Flutter SDK issue & not plugin issue), I'd suggest any folks running into this issue to try upgrading their Flutter SDK

EDIT: seems like there's a lead here. New Flutter engine code might be breaking change for desktop_webview_window when chance, I will try either downgrading Flutter < 3.22 or testing out playground patch

https://github.com/flutter/flutter/issues/155685#issuecomment-2428360798 https://github.com/flutter/flutter/issues/155685#issuecomment-2430293157

isaacy13 avatar Oct 21 '24 22:10 isaacy13

Has been reported by another individual to Flutter before https://github.com/flutter/flutter/issues/152299 https://github.com/flutter/flutter/issues/155685

Other threads https://github.com/MixinNetwork/flutter-plugins/issues/352

isaacy13 avatar Oct 23 '24 03:10 isaacy13

In the time that I last posted, smarter people have reported an RCA

Per this thread https://github.com/flutter/flutter/issues/155685, this MR is root cause of crashing

Will shamelessly admit I just downgraded to Flutter v3.16.8 / Dart 3.2.5 and downgraded the associated packages

  • This resolved all crashing
  • Merged into Flutter on 1/23/2024, so just picked the Flutter release before it (v3.16.8)

If you don't want to use an old Flutter version, according to others, you can attempt to patch your current Flutter version by:

  • reverting changes in this MR

OR

  • patching with https://github.com/flutter/flutter/issues/155685#issuecomment-2430293157

Have not tested any of these and personally wouldn't recommend it unless you have a good reason, as I imagine further debugging may be a headache

Will have to do it eventually, but that's a future me problem. Hopefully there's a better solution in the future

isaacy13 avatar Jan 11 '25 04:01 isaacy13

I have this crash with flutter 3.19.6, anyone has same flutter version?

NicholasHwang avatar Jan 16 '25 12:01 NicholasHwang