Skip to content

[Linux] Maximizing default app segfaults in GDK after eglMakeCurrent fails on NVIDIA/Wayland #191775

Open

Description

@yesme

Steps to reproduce

This is reproducible with the default Linux application generated by flutter create on Flutter 3.47.1 stable. No Dart changes are required.

Manual reproduction

  1. Run:

    flutter create bug
    cd bug
    flutter build linux --release
    cd build/linux/x64/release/bundle
    GDK_BACKEND=wayland ./bug
  2. After the first frame is visible, double-click the title bar to maximize the window.

  3. The window flashes briefly and the process exits with SIGSEGV.

The same manual reproduction also crashes with GDK_BACKEND=x11 under the same GNOME Wayland session.

Automatic reproduction

To make the crash reproducible without user interaction, change the generated linux/runner/my_application.cc so that the window is maximized one second after its first frame:

 G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
 
+static gboolean maximize_window_cb(gpointer data) {
+  gtk_window_maximize(GTK_WINDOW(data));
+  return G_SOURCE_REMOVE;
+}
+
 // Called when first Flutter frame received.
 static void first_frame_cb(MyApplication* self, FlView* view) {
-  gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view)));
+  GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view));
+  gtk_widget_show(window);
+  g_timeout_add_full(G_PRIORITY_DEFAULT, 1000, maximize_window_cb,
+                     g_object_ref(window), g_object_unref);
 }

Then build and run the same commands above. The release build exits with status 139 about one second after the first frame. A debug build reproduces under GDB as well.

Environment details:

  • Ubuntu 26.04 LTS, kernel 7.0.0-30-generic, x86_64
  • GNOME Shell 50.1, native Wayland session
  • Dell P3223QE at 3840x2160, 59.997 Hz, 150% fractional scaling
  • Mutter features: scale-monitor-framebuffer, xwayland-native-scaling
  • NVIDIA Quadro P620, proprietary driver 580.173.02
  • Flutter reports Impeller OpenGLESSDF

I found #187589 and #190059 before filing this. #187589 was fixed by #187626, and the fix is present in the 3.47.1 source. However, the default application still crashes here. This may be a remaining resize path or a regression: the GDB crash is in GDK's gdk_window_end_draw_frame() after eglMakeCurrent fails, rather than the earlier libgallium memcpy stack.

Expected results

The window maximizes and continues rendering. A temporary framebuffer-size mismatch or an EGL context failure during resize should not terminate the process.

Actual results

On native Wayland, the process exits with SIGSEGV immediately after maximizing:

$ GDK_BACKEND=wayland ./bug
[IMPORTANT:flutter/shell/platform/embedder/embedder_surface_gl_impeller.cc(126)] Using the Impeller rendering backend (OpenGLESSDF).
Gdk-Message: Unable to load  from the cursor theme

(com.example.bug): Gdk-WARNING **: eglMakeCurrent failed
(com.example.bug): Gdk-WARNING **: eglMakeCurrent failed
Segmentation fault (core dumped)

With GDK_BACKEND=x11, maximizing also flashes and crashes. A larger test application logged framebuffer-size mismatches immediately before becoming unresponsive:

Timed out waiting for OpenGL frame of size 5090x2826 (have 2560x1440)
Timed out waiting for OpenGL frame of size 4986x2722 (have 5090x2826)

The software-renderer fallback is not usable on this version either; it exits immediately while drawing the default application's text:

$ FLUTTER_LINUX_RENDERER=software GDK_BACKEND=wayland ./bug
WARNING: Using the software renderer. Not all features are supported. This is not recommended.
[FATAL:flutter/display_list/skia/dl_sk_dispatcher.cc(328)] Check failed: blob. Impeller DlText cannot be drawn to a Skia canvas.

Code sample

Code sample

The unmodified Dart application produced by flutter create bug reproduces the problem. The optional my_application.cc diff in the reproduction steps makes the maximize action automatic.

Screenshots or Video

Screenshots / Video demonstration

The window flashes during maximize and disappears. The console output and GDB stack are included below.

Logs

Logs

The debug build stops on SIGSEGV in the GTK/GDK main thread:

(com.example.bug): Gdk-WARNING **: eglMakeCurrent failed
(com.example.bug): Gdk-WARNING **: eglMakeCurrent failed

Thread 1 "bug" received signal SIGSEGV, Segmentation fault.
0x00007ffff4d3f0a4 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0

#0  0x00007ffff4d3f0a4 in ??? () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#1  0x00007ffff4d4a530 in ??? () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#2  0x00007ffff4d4a647 in gdk_window_end_draw_frame () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#3  0x00007ffff50157c3 in gtk_main_do_event () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#4  0x00007ffff4d33db7 in ??? () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#5  0x00007ffff4d45ede in ??? () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#6  0x00007ffff4d4b854 in ??? () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#7  0x00007ffff4d4ba71 in ??? () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0

At the same time, another thread is inside the NVIDIA EGL driver:

Thread "bug":
#0  __syscall_cancel_arch ()
#1  __internal_syscall_cancel ()
#2  __futex_abstimed_wait_common64 ()
#3  __futex_abstimed_wait_common ()
#4  __GI___futex_abstimed_wait_cancelable64 ()
#5  __pthread_cond_wait_common ()
#6  ___pthread_cond_wait ()
#7  0x00007fffe810bccc in ??? () at /usr/lib/x86_64-linux-gnu/libEGL_nvidia.so.0

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.47.1, on Ubuntu 26.04 LTS 7.0.0-30-generic, locale C.UTF-8)
    • Flutter version 3.47.1 on channel stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6655482ec0 (2026-08-19)
    • Engine revision 5d53178869
    • Dart version 3.13.1
    • 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-swift-package-manager,
      omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 21.1.8 (6ubuntu1)
    • cmake version 4.2.3
    • ninja version 1.13.2
    • pkg-config version 2.5.1
    ! Unable to access driver information using 'eglinfo'.

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 26.04 LTS 7.0.0-30-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 152.0.7977.64

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

Activity

  1. suryaKommana2662 commented on Aug 27, 2026

    @suryaKommana2662
    Contributor

    @yesme Thanks for the report. I reviewed the issue and attempted to reproduce it on Flutter 3.47.1 using the default Linux application. My environment is Ubuntu 26.04 under Wayland, but it uses the Mesa llvmpipe software renderer rather than the NVIDIA proprietary driver reported in the issue.

    Since my environment does not match the reported GPU/driver configuration. The issue has sufficient reproduction steps and diagnostic information for further investigation, so I’m routing it to team-engine for further investigation.

  2. added
    e: impellerImpeller rendering backend issues and features requests
    fyi-linuxFor the attention of the Linux platform team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 27, 2026
  3. added
    P1High-priority issues at the top of the work list
    on Aug 31, 2026
  4. added
    team-linuxOwned by the Linux platform team
    and removed on Aug 31, 2026
  5. gaaclarke commented on Aug 31, 2026

    @gaaclarke
    Member

    This crash seems to be at the intersection of the linux embedder and the engine. I'm forwarding it to the linux to investigate. @robert-ancell let us know if we can help.

  6. flutter-triage-bot commented on Aug 31, 2026

    @flutter-triage-bot

    The fyi-linux label is redundant with the team-linux label.

  7. self-assigned this
    on Sep 1, 2026
  8. robert-ancell commented on Sep 1, 2026

    @robert-ancell
    Contributor

    Looks like a synchronization issue between Flutter and GTK. I'll propose some PRs onto master which we will cherry-pick back if they work out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: desktopRunning on desktope: impellerImpeller rendering backend issues and features requeststeam-linuxOwned by the Linux platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions