Open jslater89 opened 2 years ago
flutter doctor -v:
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.8.0, on Linux Mint 20.2 5.11.0-41-generic, locale en_US.UTF-8)
• Flutter version 2.8.0 at /home/jay/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cf44000065 (5 days ago), 2021-12-08 14:06:50 -0800
• Engine revision 40a99c5951
• Dart version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /home/jay/development/Android/Sdk
• Platform android-31, build-tools 30.0.2
• Java binary at: /home/jay/development/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2020.3)
• Android Studio at /home/jay/development/android-studio
• Flutter plugin version 62.0.1
• Dart plugin version 203.8452
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] IntelliJ IDEA Community Edition (version 2020.2)
• IntelliJ at /home/jay/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/202.7660.26
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin version 202.8531
[✓] VS Code (version 1.63.0)
• VS Code at /usr/share/code
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)
• Pixel 3a (mobile) • 939AY08K04 • android-arm64 • Android 12 (API 31)
• Linux (desktop) • linux • linux-x64 • Linux Mint 20.2 5.11.0-41-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.93
• No issues found!
Hi @jslater89, thanks for filing the issue. I am having trouble installing the hover tool. The install command in readme doesn't seem to work heres what I have tried.
mahesh@mahesh:~$ GO111MODULE=on go get -u -a github.com/go-flutter-desktop/hover
go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
mahesh@mahesh:~$ hover
Command 'hover' not found, did you mean:
command 'rover' from deb rover (0.76.1)
command 'cover' from deb libdevel-cover-perl (1.33-1build1)
command 'over' from deb enscript (1.6.5.90-3)
Try: sudo apt install <deb name>
mahesh@mahesh:~$ go install hover@0.4.7
go install: hover@0.4.7: malformed module path "hover": missing dot in first path element
mahesh@mahesh:~$ go install hover@v0.4.7
go install: hover@v0.4.7: malformed module path "hover": missing dot in first path element
mahesh@mahesh:~$ go get hover@v0.4.7
go get hover@v0.4.7: malformed module path "hover": missing dot in first path element
mahesh@mahesh:~$ go get https://github.com/go-flutter-desktop/hover@v0.4.7
go get https:/github.com/go-flutter-desktop/hover@v0.4.7: malformed module path "https:/github.com/go-flutter-desktop/hover": invalid char ':'
mahesh@mahesh:~$ go get hover@0.4.7
go get hover@0.4.7: malformed module path "hover": missing dot in first path element
mahesh@mahesh:~$ go get hover
go get: malformed module path "hover": missing dot in first path element
mahesh@mahesh:~$ go install hover
go install: version is required when current directory is not in a module
Try 'go install hover@latest' to install the latest version
mahesh@mahesh:~$ go install hover@latest
go install: hover@latest: malformed module path "hover": missing dot in first path element
mahesh@mahesh:~$
Let me know if I am missing anything.
thanks.
I've updated hover's README. To install hover with the newer version of Golang please use:
GO111MODULE=on go get -u -a github.com/go-flutter-desktop/hover@latest
Or even:
GO111MODULE=on go install github.com/go-flutter-desktop/hover@latest
Thanks!
@pchampio, I am sorry I am not familiar with the go package system but the commands shared above don't seem to install hover on Ubuntu 20.04.3 LTS 5.11.0-41-generic
.
mahesh@mahesh:~/Desktop/go-flutter-desktop-repro$ go version
go version go1.17.5 linux/amd64
mahesh@mahesh:~$ GO111MODULE=on go get -u -a github.com/go-flutter-desktop/hover@latest
go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
mahesh@mahesh:~$ GO111MODULE=on go install github.com/go-flutter-desktop/hover@latest
mahesh@mahesh:~$ hover
Command 'hover' not found, did you mean:
command 'rover' from deb rover (0.76.1)
command 'over' from deb enscript (1.6.5.90-3)
command 'cover' from deb libdevel-cover-perl (1.33-1build1)
Try: sudo apt install <deb name>
mahesh@mahesh:~$ cd ~/Desktop/go-flutter-desktop-repro/
mahesh@mahesh:~/Desktop/go-flutter-desktop-repro$ hover run
Command 'hover' not found, did you mean:
command 'cover' from deb libdevel-cover-perl (1.33-1build1)
command 'rover' from deb rover (0.76.1)
command 'over' from deb enscript (1.6.5.90-3)
Try: sudo apt install <deb name>
mahesh@mahesh:~/Desktop/go-flutter-desktop-repro$
Make sure the hover binary is on your (Golang) PATH (defaults are $GOPATH/bin
or $HOME/go/bin
)
This issue: https://github.com/flutter/flutter/issues/95227 might be related to our. (It's an Engine/Embedding issue)
Conceivably, but that seems to be about calling exit() from within app code. I think that was also causing a segfault for me, but a different one from exiting with SystemNavigator.pop and doing the teardown, I think.
@maheshmnj, I would expect to find the hover
binary at ~/go/bin/hover
, if you don't have a $GOPATH set.
@pchampio I do have a hover binary at $HOME/go/bin
and this is in my PATH
mahesh@mahesh:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mahesh/depot_tools:/home/mahesh/Development/go1.17.5.linux-amd64/go/bin:/home/go/bin
mahesh@mahesh:~$ cd go/bin/
mahesh@mahesh:~/go/bin$ ls
hover
mahesh@mahesh:~/go/bin$
mahesh@mahesh:~/Development/go1.17.5.linux-amd64/go/bin$ which go
/home/mahesh/Development/go1.17.5.linux-amd64/go/bin/go
mahesh@mahesh:~/Development/go1.17.5.linux-amd64/go/bin$ cd $HOME
mahesh@mahesh:~$ cd ~/Desktop/go-flutter-desktop-repro/
mahesh@mahesh:~/Desktop/go-flutter-desktop-repro$ hover run
Command 'hover' not found, did you mean:
command 'rover' from deb rover (0.76.1)
command 'cover' from deb libdevel-cover-perl (1.33-1build1)
command 'over' from deb enscript (1.6.5.90-3)
Try: sudo apt install <deb name>
mahesh@mahesh:~/Desktop/go-flutter-desktop-repro$
The correct entry for your path variable should be /home/mahesh/go/bin, or you can call hover with an explicit path:
cd ~/Desktop/go-flutter-desktop-repro
~/go/bin/hover run
@jslater89, I do have a hover binary at $HOME/go/bin
and I deleted the go folder and redownloaded by running
GO111MODULE=on go get -u -a github.com/go-flutter-desktop/hover@latest
but it doesn't seem to run.
mahesh@mahesh:~/go/bin$ hover
Command 'hover' not found, did you mean:
command 'cover' from deb libdevel-cover-perl (1.33-1build1)
command 'over' from deb enscript (1.6.5.90-3)
command 'rover' from deb rover (0.76.1)
Try: sudo apt install <deb name>
mahesh@mahesh:~/go/bin$ ls
hover
mahesh@mahesh:~/go/bin$ hover run
Command 'hover' not found, did you mean:
command 'over' from deb enscript (1.6.5.90-3)
command 'cover' from deb libdevel-cover-perl (1.33-1build1)
command 'rover' from deb rover (0.76.1)
Try: sudo apt install <deb name>
mahesh@mahesh:~/go/bin$
Leaving this issue open for further investigation from the team.
Just checking @jslater89: is this still a problem?
I'm not sure—go-flutter hasn't been maintained much lately, and my test application segfaults on launch at present.
Okay, we're going to just close this. Please ask to reopen if you determine in the future that it is still an issue.
(Desktop Triage)
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.
Hitting this issue now on Engine 3.13.9 platform/glfw
.
Easy to repro on Linux: https://github.com/toyota-connected/linux-pigeon-sandbox
I recently started helping with maintenance on the go-flutter-desktop embedder, and have come across an issue (go-flutter-desktop/go-flutter#634) that I can't reproduce in the official Linux embedder, but can't find a clear cause for in the go-flutter-desktop codebase.
The issue occurred in Flutter stable 2.5.x, Flutter beta 2.8, and the new 2.8.
Symptom
If an application is displaying an image and has spawned additional isolates, a segfault occurs on the io.flutter.io thread, before FlutterEngineShutdown returns on the embedder's main thread.
Minimal example
See example repository.
If not on Linux x64, install hover. The repository contains a prebuilt hover executable for Linux x64.
If you hit the Exit button before the image displays, the app exits normally. If you hit it after the image displays, the app segfaults on exit.
Comment out either the Container with key bg1 or the call to
compute
ininitState
, and the issue goes away.Investigation/Speculation
There's a whole lot more of this in the linked issue, but here's the short version, starting with the stack trace from the segfault, but I'll reproduce the current state of my knowledge here.
io.flutter.io segfault
``` #0 sk_spIt appears to be a use-after-free issue. I spent some time digging in, and couldn't identify any obvious differences between go-flutter-desktop and the official Linux embedder modulo the glfw/GTK differences. They both configure the engine in the same way before starting it, and neither seems to do any special preparation before shutting down the engine when glfw/GTK say it's time to close the window.
go-flutter-desktop uses a single platform/render thread like the Linux embedder. The segfault occurs after it calls FlutterEngineShutdown but before that function returns, and before FlutterEngineDeinitialize returns in FlutterEngineShutdown.
The issue seems to be caused by a SkiaGPUObject calling Unref on the io_manager SkiaUnrefQueue after the IO thread teardown code at shell.cc:454. In this case, a flutter::Picture is deleted on a DartWorker thread, after a breakpoint placed at shell.cc:478 (i.e., at the end of the Shell::Shell destructor), shortly before the segmentation fault.
Unref called from DartWorker, late
``` Thread 37 "DartWorker" hit Breakpoint 3, flutter::SkiaUnrefQueue::Unref (this=0x7fffac0108d0, object=0x7fffb83bf860) at ../../flutter/flow/skia_gpu_object.cc:29 29 task_runner_->PostDelayedTask( (gdb) bt #0 flutter::SkiaUnrefQueue::Unref (this=0x7fffac0108d0, object=0x7fffb83bf860) at ../../flutter/flow/skia_gpu_object.cc:29 #1 0x00007ffff74b491e in flutter::SkiaGPUObjectRemoving the call to is torn down on the io.flutter.ui thread during flutter::Picture::dispose, before the breakpoint at shell.cc:478 is hit:
compute
in main.dart, the SkiaGPUObjectUnref called from UI thread
``` Thread 11 "io.flutter.ui" hit Breakpoint 3, flutter::SkiaUnrefQueue::Unref (this=0x7fffb00108d0, object=0x7fffbc319f80) at ../../flutter/flow/skia_gpu_object.cc:29 29 task_runner_->PostDelayedTask( (gdb) bt #0 flutter::SkiaUnrefQueue::Unref (this=0x7fffb00108d0, object=0x7fffbc319f80) at ../../flutter/flow/skia_gpu_object.cc:29 #1 0x00007ffff74b491e in flutter::SkiaGPUObjectAfter that, the GrGLContext destructor runs, then the breakpoint at shell.cc:478, then the app exits normally. The following breakpoints were used:
Let me know if you need any additional information from me on how the go-flutter-desktop embedder operates, or if there are any caveats about threading/isolates/goroutines we need to keep in mind.
I tried running on the GLFW example in flutter/examples to see if it showed a similar issue (in the hopes of comparing apples to apples), but it failed to start: