Open vext01 opened 9 months ago
The Fyne errors are expected and aren't a problem other than polluting the logs. It's because Fyne doesn't like when you use PNGs instead of SVGs as button icons (see #155).
Does the crashing on exit happen all the time or is it intermittent? I know it intermittently crashes on exit on all platforms, though not super often in my experience. It's some sort of timing bug in the shutdown of the various background threads. While I'd like to fix it, it's not causing any real problems (esp. after #277), so it has not been on my priority list to track down and fix.
Hi,
Thanks for the fast response!
It crashes like this every time.
It'd be good to get it fixed because OpenBSD creates a core dump for the crashing process.
If you think it's a race, is there a sanitiser that could help?
Cheers
The first thing to try I think is if you run the Fyne Demo and see if it crashes similarly on exit. If so, the issue is in the Fyne toolkit and would have to be reported there. If Fyne demo exits normally, I would try adding a time.Sleep(1 * time.Second)
at the very end of main
in Supersonic and see if that mitigates it (if so, it was because main was exiting before giving other goroutines a chance to finish up).
Edit: of course this wouldn't be a proper fix but would just give some insight into what's going wrong and how to implement a true fix
The Fyne demo works fine:
$ go run fyne.io/fyne/v2/cmd/fyne_demo@latest 2>&1 | tee LOG
# fyne.io/fyne/v2/cmd/fyne_demo
x11_window.c:1047 (/home/edd/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20221017161538-93cebf72946b/glfw/src/x11_window.c:1047)(/tmp/go-link-541355508/000009.o:(getSelectionString)): warning: strcat() is almost always misused, please use strlcat()
init.c:305 (/home/edd/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20221017161538-93cebf72946b/glfw/src/init.c:305)(/tmp/go-link-541355508/000008.o:(_glfwInputError)): warning: strcpy() is almost always misused, please use strlcpy()
2023/12/19 10:14:02 Lifecycle: Started
2023/12/19 10:14:02 Lifecycle: Entered Foreground
2023/12/19 10:14:04 Lifecycle: Exited Foreground
2023/12/19 10:14:04 Lifecycle: Entered Foreground
2023/12/19 10:14:05 Lifecycle: Exited Foreground
2023/12/19 10:14:05 Lifecycle: Stopped
Adding the sleep you suggested and some prints:
diff --git a/main.go b/main.go
index 5ec9592..8087aa1 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "fmt"
"log"
"math"
"os"
@@ -74,10 +75,18 @@ func main() {
fyneApp.Quit()
}
})
+
+ fmt.Println("AAA")
fyneApp.Run()
+ fmt.Println("BBB")
log.Println("Running shutdown tasks...")
+ fmt.Println("CCC")
myApp.Shutdown()
+ fmt.Println("DDD")
+
+ time.Sleep(1 * time.Second)
+ fmt.Println("EEE")
}
func saveWindowSize(config *backend.Config, window fyne.Window) {
Only AAA
prints, so fyneApp.Run()
must be crashing?
(disclaimer, this is the most go I've ever written :laughing: )
Hi,
I'm an OpenBSD developer making a binary package of supersonic v0.8.2.
It all seems to be working, but I notice it crashes upon exit. Here's stdout/stderr:
Are all those Fyne errors related and/or expected?
This is against gonic-0.15.2 (running on another FreeBSD box).
Thanks