Skip to content

[Windows] Null pointer crash in HostWindowPopup::UpdatePosition (regression in 3.47.0) #191478

Closed

Description

@kryali

I recently upgraded from flutter 3.44.9 to flutter 3.47.0 and noticed that the upgrade introduced a new crash on windows. This surfaced as a EXCEPTION_ACCESS_VIOLATION_READ crash in my application.

I was able to trace the issue to HostWindowPopup and have proposed a fix with this change. #191479

Steps to reproduce

  1. Windows desktop app embedding a native HWND-backed platform view (webview_windows, in my case) in a page.
  2. Navigate away, disposing that page.
  3. Crashes 100% of the time on 3.47.0.

Expected results

App keeps running after navigating away.

Actual results

Crash in flutter_windows.dll:
AV.Dereference: NullPtr
AV.Type: Read
flutter_windows!InternalFlutterWindows_WindowManager_UpdatePopupPosition+0x28ddcc
mov rax,qword ptr [rcx] ; rcx = 0
Bisected: no crash on 3.44.9 (engine b9499e4c25, HostWindowPopup didn't exist), crashes 100% on 3.47.0 (engine 59d54a2b28).

Code sample

Code sample. I haven't isolated a minimal repro without the plugin. The linked PR includes an engine-level unit test (`PopupWindowHandlesNullPositionCallback`) that reproduces the defect directly with no app code — it crashes the test binary unpatched, passes with the fix.
class WebViewPageWindowsState extends State<WebViewPageWindows> {
  final WebviewController webViewController = WebviewController();

  @override
  Widget build(BuildContext context) => Stack(
    children: [
      Webview(webViewController),
      if (firstLoad) const CircularProgressIndicator(),
    ],
  );

  @override
  void dispose() {
    webViewController.dispose();
    super.dispose();
  }
}

void _goToNativeLogin() {
  BlazeSession().clearCookies();
  if (context.mounted) context.go("/login"); // disposes the page above
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
PS C:\Users\kiran\Development\blazetrade-flutter> flutter doctor -v
[!] Flutter (Channel [user-branch], 3.47.0, on Microsoft Windows [Version 10.0.26200.9168], locale en-US) [343ms]
    ! Flutter version 3.47.0 on channel [user-branch] at C:\src\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, try deleting the 'bin/cache/flutter.version.json' file in your Flutter SDK
      directory and then reinstall Flutter by following instructions at https://flutter.dev/setup.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf2416426 (10 days ago), 2026-08-11 11:53:49 -0700
    • Engine revision 5f77625673
    • Dart version 3.13.0
    • DevTools version 2.60.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android,
      enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager,
      omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
      to perform update checks and upgrades.

[✓] Windows Version (Windows 11 or higher, 25H2, 2009) [728ms]

[✗] Android toolchain - develop for Android devices [131ms]
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/windows-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Chrome - develop for the web [117ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop Windows apps (Visual Studio Build Tools 2026 18.9.0) [115ms]
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools
    • Visual Studio Build Tools 2026 version 18.9.12105.275
    • Windows 10 SDK version 10.0.26100.0

[✓] Connected device (3 available) [119ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26200.9168]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 151.0.7922.138
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 151.0.4129.93

[✓] Network resources [309ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.```

</details>

Activity

  1. added
    c: regressionIt was better in the past than it is now
    in triagePresently being triaged by the triage team
    c: crashStack traces logged to the console
    engineflutter/engine related. See also e: labels.
    platform-windowsBuilding on or for Windows specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-windowsOwned by the Windows platform team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 21, 2026
  2. mbcorona commented on Aug 21, 2026

    @mbcorona
    Member

    Hi @kryali, thanks for the bisection and for the fix PR #191479
    Routing to the Windows team for evaluation.

  3. added
    triaged-windowsTriaged by the Windows platform team
    P2Important issues not at the top of the work list
    on Aug 26, 2026
  4. added a commit that references this issue on Sep 1, 2026
    a26f7ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowengineflutter/engine related. See also e: labels.found in release: 3.47Found to occur in 3.47has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions