MixinNetwork / MixinNetwork/flutter-plugins
Crash on Wayland
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 512
- Forks
- 292
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 7
Description
Running under Wayland on Fedora 43 Kinoite (whether inside a toolbox or on the host), I get a crash after clicking the close button on a webview:
$ ~/repository/repro_desktop_webview_window_crash/build/linux/x64/release/bundle/repro_desktop_webview_window_crash
Gdk-Message: 15:02:50.433: Unable to load from the cursor theme
Gdk-Message: 15:02:53.301: Unable to load from the cursor theme
~WebviewWindow
embedder.cc (2603): 'FlutterEngineRemoveView' returned 'kInvalidArguments'. Remove view info was invalid. The implicit view cannot be removed.
(com.example.repro_desktop_webview_window_crash:1299103): Gdk-WARNING **: 15:02:56.612: eglMakeCurrent failed
(com.example.repro_desktop_webview_window_crash:1299103): Gdk-WARNING **: 15:02:56.612: eglMakeCurrent failed
(com.example.repro_desktop_webview_window_crash:1299103): Gdk-WARNING **: 15:02:56.616: eglMakeCurrent failed
(com.example.repro_desktop_webview_window_crash:1299103): Gdk-WARNING **: 15:02:56.616: eglMakeCurrent failed
(com.example.repro_desktop_webview_window_crash:1299103): Gdk-WARNING **: 15:02:56.618: eglMakeCurrent failed
Segmentation fault (core dumped) ~/repository/repro_desktop_webview_window_crash/build/linux/x64/release/bundle/repro_desktop_webview_window_crash
Reproduce Steps
$ mkdir repro_desktop_webview_window_crash
$ cd repro_desktop_webview_window_crash
$ flutter create --platforms linux .
$ flutter pub add desktop_webview_window
Then change main.dart to:
import 'package:flutter/material.dart';
import 'package:desktop_webview_window/desktop_webview_window.dart';
void main(args) {
if (runWebViewTitleBarWidget(args)) {
return;
}
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Repro',
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Repro'),
),
body: Center(
child: Column(
mainAxisAlignment: .center,
children: [
ElevatedButton(
onPressed: () async {
final webview = await WebviewWindow.create();
webview.launch("https://example.com");
},
child: const Text('Open Webview'),
),
],
),
),
);
}
}
$ flutter build linux
$ ./build/linux/x64/release/bundle/repro_desktop_webview_window_crash
Click the Open Webview button, then click the close button on the webview.
Expected behavior
Should simply close the webview without crashing.
Additional Info
Version (please complete the following information):
- Flutter Version:
3.44.0-0.3.pre(but also tried on latest stable,3.41.1) - OS: Fedora Kinoite 43
- plugin:
desktop_webview_window: 0.2.3
Note that in my actual application I can run under X11 by prepending the start command with GDK_BACKEND=x11 and it works fine in that case. However, I was surprised to find that the repro above also fails under X11:
$ GDK_BACKEND=x11 ./build/linux/x64/release/bundle/repro_desktop_webview_window_crash 3
Gtk-Message: 15:14:50.431: Failed to load module "colorreload-gtk-module"
** (com.example.repro_desktop_webview_window_crash:1319133): WARNING **: 15:14:52.054: Failed to setup compositor shaders, unable to make OpenGL context current
~WebviewWindow
embedder.cc (2603): 'FlutterEngineRemoveView' returned 'kInvalidArguments'. Remove view info was invalid. The implicit view cannot be removed.
(com.example.repro_desktop_webview_window_crash:1319133): Gdk-WARNING **: 15:14:54.011: The program 'com.example.repro_desktop_webview_window_crash' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAccess (attempt to access private resource denied)'.
(Details: serial 1618 error_code 10 request_code 150 (GLX) minor_code 26)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the main.dart reproducer and run the listed flutter build linux command, then reproduce the crash by opening and closing the webview under Wayland. Trace the desktop_webview_window close path against the reported FlutterEngineRemoveView and GDK errors; done means the webview closes without a segmentation fault under the reported environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, linux
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100