Skip to content

Linux desktop app just stops updating its window after a while #173447

Closed

Description

@Hixie

Steps to reproduce

Run the code below using flutter run -d linux and wait up to 15 minutes (usually a lot less, sometimes less than 10 seconds). All the code does is show a timer on the screen.

Expected results

There should be a counter that increases forever.

Actual results

The timer eventually just appears to hang.

In practice (as tested via debugger), the Dart part of the application is continuing to work fine. It's just the window that isn't updating.

Code sample

import 'dart:async';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final DateTime _start = DateTime.now();
  
  @override
  Widget build(BuildContext context) {
    scheduleMicrotask(() { setState(() { /* rebuild */ }); });
    return Center(
      child: Text(
        '${DateTime.now().millisecondsSinceEpoch - _start.millisecondsSinceEpoch}ms',
        textDirection: TextDirection.ltr,
      ),
    );
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.33.0-1.0.pre-1324, on Ubuntu 24.04.1 LTS 6.8.0-58-generic, locale C.UTF-8) [61ms]
    ! Flutter version 3.33.0-1.0.pre-1324 on channel [user-branch] at /home/ianh/dev/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 796c62bd76 (2 hours ago), 2025-08-07 15:42:16 -0700
    • Engine revision 9264b70f24
    • Dart version 3.10.0 (build 3.10.0-75.1.beta)
    • DevTools version 2.49.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,762ms]
    • Android SDK at /home/ianh/Android/Sdk
    • Emulator version 31.3.13.0 (build_id 9189900) (CL:N/A)
    ✗ Flutter requires Android SDK 36 and the Android BuildTools 28.0.3
      To update the Android SDK visit https://flutter.dev/to/linux-android-setup for detailed instructions.
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

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

[✓] Linux toolchain - develop for Linux desktop [529ms]
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1
    • OpenGL core renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 (X11)
    • OpenGL core version: 4.6.0 NVIDIA 550.120 (X11)
    • OpenGL core shading language version: 4.60 NVIDIA (X11)
    • OpenGL ES renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 (X11)
    • OpenGL ES version: OpenGL ES 3.2 NVIDIA 550.120 (X11)
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
    • GL_EXT_framebuffer_blit: yes (X11)
    • GL_EXT_texture_format_BGRA8888: yes (X11)

[✓] Connected device (2 available) [151ms]
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 24.04.1 LTS 6.8.0-58-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 136.0.7103.59

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

! Doctor found issues in 2 categories.

While I'm at it:

ianh@burmese:~$ sudo X -version
X.Org X Server 1.21.1.11
X Protocol Version 11, Revision 0
Current Operating System: Linux burmese 6.8.0-58-generic #60-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 14 18:29:48 UTC 2025 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-58-generic root=UUID=dc31e344-a73b-4584-9bbb-d412fe845c85 ro
xorg-server 2:21.1.12-1ubuntu1.4 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.42.2
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.

Activity

  1. Hixie commented on Aug 8, 2025

    @Hixie
    ContributorAuthor

    I git bisected this to #171414.

  2. robert-ancell commented on Aug 8, 2025

    @robert-ancell
    Contributor

    Confirmed here. It seems to be locking in one of the mutexes.

  3. robert-ancell commented on Aug 8, 2025

    @robert-ancell
    Contributor

    Adding logging I can see fl_compositor_opengl_present_layers is being called but fl_compositor_opengl_render stops being called. Not able to pinpoint it more than that as not reproducing when adding the additional logging. Will look more into this next week.

  4. added
    platform-linuxBuilding on or for Linux specifically
    c: regressionIt was better in the past than it is now
    P0Critical issues such as a build break or regression
    triaged-linuxTriaged by the Linux platform team
    on Aug 8, 2025
  5. flutter-triage-bot commented on Aug 8, 2025

    @flutter-triage-bot

    The triaged-linux label is irrelevant if there is no team-linux label or fyi-linux label.

  6. loic-sharma commented on Aug 8, 2025

    @loic-sharma
    Member

    FYI the commit that introduced this regression, 78e111f, is included in the next stable release. We'll want to cherrypick the fix.

  7. robert-ancell commented on Aug 11, 2025

    @robert-ancell
    Contributor

    Spent some more time investigating this today, notes:

    • Seems to reproducing at a similar rate as Hixie was, normally under a minute, but at times doesn't seem to reproduce for 10 mins+.
    • Adding debugging to try and work out why render has stopped hasn't shown anything yet. When it does stop it doesn't seem to be in the middle of the render call.
    • I have not been able to reproduce with the software renderer (run with FLUTTER_LINUX_RENDERER=software)
    • I am testing on Wayland (GNOME Shell), and Hixie is using X11. Doesn't seem to make a difference.
    • Tried compiling with tsan, but is failing to build in perfetto (unrelated this this issue I think).

    Will continue to look into it more tomorrow.

  8. github-actions commented on Aug 27, 2025

    @github-actions

    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.

  9. locked as resolved and limited conversation to collaborators on Aug 27, 2025
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

    P0Critical issues such as a build break or regressionc: regressionIt was better in the past than it is nowplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged 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