fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.11k stars 1.4k forks source link

MacOSX Mojave Panic #2465

Closed hippodribble closed 3 years ago

hippodribble commented 3 years ago

Describe the bug:

Unable to run any examples or fyne_demo in OSX Mojave 10.14.6

To Reproduce:

Steps to reproduce the behaviour:

  1. Install go, vscode with extensions, as well as fyne, fyne_demo
  2. Enter example code below into Visual Studio Code or text editor in folder
  3. Run go mod init github.com/whatever/stuff and go mod tidy in same source folder
  4. Try go run main.go -> panic
  5. go build completes normally, but executable does not run (same output)
  6. fyne_demo also does not start
  7. Code without fyne dependencies is working normally
  8. go.mod contains indirect dependencies - on Windows, it does not.

Terminal Output:

(base) Glenns-MBP:P190 glenn$ go run main.go 
2021-09-13 22:38:23.974 main[44383:7625847] ApplePersistence=YES
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff7f7e3aad]

runtime stack:
runtime.throw({0x42d91d8, 0x0})
    /usr/local/go/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
    /usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x423eb30, 0xc00029fca8)
    /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc00029fc80 sp=0xc00029fc48 pc=0x4004ebc
...etc

Example code:

package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/widget"
)

func main() {
    app := app.New()

    w := app.NewWindow("Hello")
    w.SetContent(widget.NewLabel("Hello Fyne!"))

    w.ShowAndRun()
}

(or any code using fyne)

Device (please complete the following information):

go Environment variables (non-blank)

GOARCH="amd64" GOCACHE="/Users/glenn/Library/Caches/go-build" GOENV="/Users/glenn/Library/Application Support/go/env" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOMODCACHE="/Users/glenn/go/pkg/mod" GOOS="darwin" GOPATH="/Users/glenn/go" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOVERSION="go1.17.1" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1n/cmq8c9w550187yxnftjjjrf40000gn/T/go-build3258414917=/tmp/go-build -gno-record-gcc-switches -fno-common"

System Environment Variables

GOROOT=/usr/local/go GOPATH=/Users/glenn/go (I don't believe these matter, but they are correct)

go.mod

module github.com/zoid/test

go 1.17

require fyne.io/fyne/v2 v2.0.4

require (
    github.com/davecgh/go-spew v1.1.1 // indirect
    github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 // indirect
    github.com/fsnotify/fsnotify v1.4.9 // indirect
    github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a // indirect
    github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect
    github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb // indirect
    github.com/godbus/dbus/v5 v5.0.4 // indirect
    github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect
    github.com/pmezard/go-difflib v1.0.0 // indirect
    github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 // indirect
    github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 // indirect
    github.com/stretchr/testify v1.5.1 // indirect
    golang.org/x/image v0.0.0-20200430140353-33d19683fad8 // indirect
    golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
    golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666 // indirect
    golang.org/x/text v0.3.2 // indirect
    gopkg.in/yaml.v2 v2.2.8 // indirect
)

Compiler Installation

Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Jacalz commented 3 years ago

The indirect dependencies in your go.mod file are most likely because of a new feature (lazy module loading or pruned module graphs) in Go 1.17, not an issue with Fyne.

As for the actual panic, could you please share more of the stack trace? The part that is include above doesn’t contain the relevant information of the Fyne code running (just the runtime).

andydotxyz commented 3 years ago

AS this may relate to auto-graphics switching which we added in v2.1 work can you try the version v2.1.0-rc1 and confirm it is still an issue?

hippodribble commented 3 years ago

@Jacalz

Thanks for your help. Trace shown below.

I have fyne working on MacOSX 10.15.7 under clang 12.0.0, but not 10.14 under clang 10.

(base) Glenns-MBP:P190 glenn$ go run main.go 
2021-09-14 01:41:42.793 main[47019:7650522] ApplePersistence=YES
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff7f7e3aad]

runtime stack:
runtime.throw({0x42d91d8, 0x0})
    /usr/local/go/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
    /usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x423eb30, 0xc00031fca8)
    /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc00031fc80 sp=0xc00031fc48 pc=0x4004ebc
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwCreateWindow(0x67, 0x2d, 0x4a03af0, 0x0, 0x0)
    _cgo_gotypes.go:671 +0x4d fp=0xc00031fca8 sp=0xc00031fc80 pc=0x41f612d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow.func2(0x67, 0x2d, 0x47be800, 0x0, 0x0)
    /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0x9d fp=0xc00031fce8 sp=0xc00031fca8 pc=0x41fc13d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow(0xc000098000, 0xc0000002e8, {0x42c0bd5, 0x409cad0}, 0x0, 0x0)
    /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0xd5 fp=0xc00031fd80 sp=0xc00031fce8 pc=0x41fbf55
fyne.io/fyne/v2/internal/driver/glfw.(*window).create.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1330 +0x11b fp=0xc00031fdd8 sp=0xc00031fd80 pc=0x420cd1b
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).runGL(0xc0001ae370)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:97 +0x171 fp=0xc00031ff08 sp=0xc00031fdd8 pc=0x4203011
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).Run(0xc000098000)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/driver.go:80 +0x30 fp=0xc00031ff30 sp=0xc00031ff08 pc=0x4202410
fyne.io/fyne/v2/internal/driver/glfw.(*window).ShowAndRun(0xc000098000)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:449 +0x2c fp=0xc00031ff48 sp=0xc00031ff30 pc=0x420792c
main.main()
    /Users/glenn/go/src/libs/P190/main.go:14 +0xac fp=0xc00031ff80 sp=0xc00031ff48 pc=0x4228aec
runtime.main()
    /usr/local/go/src/runtime/proc.go:255 +0x227 fp=0xc00031ffe0 sp=0xc00031ff80 pc=0x4037027
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00031ffe8 sp=0xc00031ffe0 pc=0x4063ce1

goroutine 35 [sleep]:
time.Sleep(0x22ecb25c00)
    /usr/local/go/src/runtime/time.go:193 +0x12e
fyne.io/fyne/v2/internal/painter.svgCacheJanitor.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/painter/svg_cache.go:57 +0x47
sync.(*Once).doSlow(0x0, 0x0)
    /usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(0x0, 0x0)
    /usr/local/go/src/sync/once.go:59 +0x1f
created by fyne.io/fyne/v2/internal/painter.svgCacheJanitor
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/painter/svg_cache.go:55 +0xb2

goroutine 36 [select]:
fyne.io/fyne/v2/data/binding.makeInfiniteQueue.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:36 +0x12e
created by fyne.io/fyne/v2/data/binding.makeInfiniteQueue
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:21 +0xc5

goroutine 37 [chan receive]:
fyne.io/fyne/v2/data/binding.processItems()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:54 +0x2e
created by fyne.io/fyne/v2/data/binding.init.0
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:15 +0x25

goroutine 38 [chan receive]:
fyne.io/fyne/v2/app.newAppWithDriver.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/app.go:120 +0x36
created by fyne.io/fyne/v2/app.newAppWithDriver
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/app.go:118 +0x217

goroutine 39 [syscall]:
syscall.syscall6(0x42235a0, 0x3, 0x0, 0x0, 0xc0003a4678, 0xa, 0x47ee810)
    /usr/local/go/src/runtime/sys_darwin.go:44 +0x3b
golang.org/x/sys/unix.kevent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20200720211630-cb9d2d5c5666/unix/zsyscall_darwin_amd64.go:292 +0x5b
golang.org/x/sys/unix.Kevent(0x0, {0x0, 0x0, 0xc0003a4558}, {0xc0003a4678, 0x0, 0x0}, 0x0)
    /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20200720211630-cb9d2d5c5666/unix/syscall_bsd.go:413 +0x3c
github.com/fsnotify/fsnotify.read(0x0, {0xc0003a4678, 0x0, 0xa}, 0x0)
    /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x36
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc0001a87e0)
    /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0xa5
created by github.com/fsnotify/fsnotify.NewWatcher
    /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x1c7

goroutine 40 [chan receive]:
fyne.io/fyne/v2/app.watchFile.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/settings_desktop.go:42 +0x6c
created by fyne.io/fyne/v2/app.watchFile
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/settings_desktop.go:41 +0x10f

goroutine 41 [select, locked to thread]:
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:186 +0xfd
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:182 +0xcf

goroutine 50 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.(*window).runEventQueue(0xc000098000)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1267 +0x96
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1292 +0x148

goroutine 51 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).setupThemeListener.func1()
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/canvas.go:495 +0x3d
created by fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).setupThemeListener
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/canvas.go:493 +0xa5

goroutine 52 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.runOnMain(0xc00009c0e0)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:56 +0x71
fyne.io/fyne/v2/internal/driver/glfw.(*window).create(0xc000098000)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1303 +0x5a
sync.(*Once).doSlow(0x989680, 0x0)
    /usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
    /usr/local/go/src/sync/once.go:59
fyne.io/fyne/v2/internal/driver/glfw.(*window).doShow(0xc000098000)
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:375 +0x87
created by fyne.io/fyne/v2/internal/driver/glfw.(*window).Show
    /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:363 +0x5b
exit status 2
hippodribble commented 3 years ago

@andydotxyz

Thanks Andy

Trace attached after using release candidate:

(base) Glenns-MBP:P190 glenn$ go get fyne.io/fyne/v2/@v2.1.0-rc1
go get: upgraded fyne.io/fyne/v2 v2.0.4 => v2.1.0-rc1
go get: upgraded github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 => v0.0.0-20210813123233-e4099ee2221f
go get: upgraded golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e => v0.0.0-20210405180319-a5a99cb37ef4
go get: upgraded golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666 => v0.0.0-20210630005230-0f9fa26af87c
go get: upgraded golang.org/x/text v0.3.2 => v0.3.3
(base) Glenns-MBP:P190 glenn$ go mod tidy
(base) Glenns-MBP:P190 glenn$ go run main.go
2021-09-14 02:00:42.562 main[48034:7658992] ApplePersistence=YES
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff7f7e3aad]

runtime stack:
runtime.throw({0x43b6de2, 0x0})
        /usr/local/go/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x4308210, 0xc0004b3ca8)
        /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc0004b3c80 sp=0xc0004b3c48 pc=0x400415c
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwCreateWindow(0x66, 0x2d, 0xc1088e0, 0x0, 0x0)
        _cgo_gotypes.go:671 +0x4d fp=0xc0004b3ca8 sp=0xc0004b3c80 pc=0x42bf80d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow.func2(0x66, 0x2d, 0x490f280, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0x9d fp=0xc0004b3ce8 sp=0xc0004b3ca8 pc=0x42c581d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow(0xc000078000, 0xc0000002e8, {0x439b504, 0x4086e50}, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0xd5 fp=0xc0004b3d80 sp=0xc0004b3ce8 pc=0x42c5635
fyne.io/fyne/v2/internal/driver/glfw.(*window).create.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/window.go:1427 +0x131 fp=0xc0004b3dd8 sp=0xc0004b3d80 pc=0x42d49f1
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).runGL(0xc00013e910)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/loop.go:104 +0x197 fp=0xc0004b3f08 sp=0xc0004b3dd8 pc=0x42cadd7
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).Run(0xc000078000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/driver.go:83 +0x30 fp=0xc0004b3f30 sp=0xc0004b3f08 pc=0x42c9ef0
fyne.io/fyne/v2/internal/driver/glfw.(*window).ShowAndRun(0xc000078000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/window.go:461 +0x2f fp=0xc0004b3f48 sp=0xc0004b3f30 pc=0x42ced0f
main.main()
        /Users/glenn/go/src/libs/P190/main.go:14 +0x8b fp=0xc0004b3f80 sp=0xc0004b3f48 pc=0x42f1ccb
runtime.main()
        /usr/local/go/src/runtime/proc.go:255 +0x227 fp=0xc0004b3fe0 sp=0xc0004b3f80 pc=0x40362c7
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0004b3fe8 sp=0xc0004b3fe0 pc=0x4063221

goroutine 19 [syscall]:
syscall.syscall6(0x42ec160, 0x3, 0x0, 0x0, 0xc00003c678, 0xa, 0x493f360)
        /usr/local/go/src/runtime/sys_darwin.go:44 +0x3b
golang.org/x/sys/unix.kevent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c/unix/zsyscall_darwin_amd64.go:276 +0x52
golang.org/x/sys/unix.Kevent(0x0, {0x0, 0x0, 0xc00003c558}, {0xc00003c678, 0x0, 0x0}, 0x0)
        /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c/unix/syscall_bsd.go:429 +0x3c
github.com/fsnotify/fsnotify.read(0x0, {0xc00003c678, 0x0, 0xa}, 0x0)
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x36
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc000138de0)
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0xa5
created by github.com/fsnotify/fsnotify.NewWatcher
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x1c7

goroutine 20 [chan receive]:
fyne.io/fyne/v2/app.watchFile.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/app/settings_desktop.go:42 +0x6c
created by fyne.io/fyne/v2/app.watchFile
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/app/settings_desktop.go:41 +0x10f

goroutine 5 [select, locked to thread]:
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/loop.go:196 +0x11f
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/loop.go:192 +0xcf

goroutine 6 [chan receive]:
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0xc000078000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/common/window.go:57 +0x7d
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/window.go:1388 +0x15b

goroutine 7 [chan receive]:
fyne.io/fyne/v2/internal/async.NewUnboundedCanvasObjectChan.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/async/chan_canvasobject.go:35 +0x9e
created by fyne.io/fyne/v2/internal/async.NewUnboundedCanvasObjectChan
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/async/chan_canvasobject.go:27 +0xd1

goroutine 50 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.runOnMain(0xc000012010)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/loop.go:61 +0xd7
fyne.io/fyne/v2/internal/driver/glfw.(*window).create(0xc000078000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/window.go:1399 +0x5a
sync.(*Once).doSlow(0x989680, 0x0)
        /usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:59
fyne.io/fyne/v2/internal/driver/glfw.(*window).doShow(0xc000078000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/window.go:380 +0x87
created by fyne.io/fyne/v2/internal/driver/glfw.(*window).Show
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0-rc1/internal/driver/glfw/window.go:368 +0x5b
exit status 2
hippodribble commented 3 years ago

I'll upgrade to Big Sur, upgrade clang to 12+ and try again.

andydotxyz commented 3 years ago

Hmm, this is strange. It is almost certainly failing to create the OpenGL context. Can you please provide more information about your hardware configuration?

hippodribble commented 3 years ago

Andy

Macbook Pro 2017 Radeon Pro 560 4 GB

I just installed Big Sur and reinstalled vscode and fyne

I loaded this code from the Tour, which works on my Macbook Air under Catalina 10.15.7:

package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/widget"
)

func main() {
    app := app.New()

    w := app.NewWindow("Hello")
    w.SetContent(widget.NewLabel("Hello Fyne!"))

    w.ShowAndRun()
}

It still won't run (nor will fyne_demo)Stack trace is:

(base) Glenns-MBP:p190 glenn$ go run main.go 
2021-09-14 04:59:39.573 main[2607:25068] ApplePersistence=YES
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff20205aec]

runtime stack:
runtime.throw({0x42db1f8, 0x0})
        /usr/local/go/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x4240b50, 0xc00021fca8)
        /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc00021fc80 sp=0xc00021fc48 pc=0x4006edc
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwCreateWindow(0x67, 0x2d, 0xc0094a0, 0x0, 0x0)
        _cgo_gotypes.go:671 +0x4d fp=0xc00021fca8 sp=0xc00021fc80 pc=0x41f814d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow.func2(0x67, 0x2d, 0x47c0800, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0x9d fp=0xc00021fce8 sp=0xc00021fca8 pc=0x41fe15d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow(0xc000326000, 0xc0000002e8, {0x42c2bf5, 0x409eaf0}, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0xd5 fp=0xc00021fd80 sp=0xc00021fce8 pc=0x41fdf75
fyne.io/fyne/v2/internal/driver/glfw.(*window).create.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1330 +0x11b fp=0xc00021fdd8 sp=0xc00021fd80 pc=0x420ed3b
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).runGL(0xc0000763c0)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:97 +0x171 fp=0xc00021ff08 sp=0xc00021fdd8 pc=0x4205031
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).Run(0xc000326000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/driver.go:80 +0x30 fp=0xc00021ff30 sp=0xc00021ff08 pc=0x4204430
fyne.io/fyne/v2/internal/driver/glfw.(*window).ShowAndRun(0xc000326000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:449 +0x2c fp=0xc00021ff48 sp=0xc00021ff30 pc=0x420994c
main.main()
        /Users/glenn/go/src/libs/p190/main.go:14 +0xac fp=0xc00021ff80 sp=0xc00021ff48 pc=0x422ab0c
runtime.main()
        /usr/local/go/src/runtime/proc.go:255 +0x227 fp=0xc00021ffe0 sp=0xc00021ff80 pc=0x4039047
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00021ffe8 sp=0xc00021ffe0 pc=0x4065d01

goroutine 6 [sleep]:
time.Sleep(0x22ecb25c00)
        /usr/local/go/src/runtime/time.go:193 +0x12e
fyne.io/fyne/v2/internal/painter.svgCacheJanitor.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/painter/svg_cache.go:57 +0x47
sync.(*Once).doSlow(0x0, 0x0)
        /usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(0x0, 0x0)
        /usr/local/go/src/sync/once.go:59 +0x1f
created by fyne.io/fyne/v2/internal/painter.svgCacheJanitor
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/painter/svg_cache.go:55 +0xb2

goroutine 7 [select]:
fyne.io/fyne/v2/data/binding.makeInfiniteQueue.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:36 +0x12e
created by fyne.io/fyne/v2/data/binding.makeInfiniteQueue
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:21 +0xc5

goroutine 8 [chan receive]:
fyne.io/fyne/v2/data/binding.processItems()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:54 +0x2e
created by fyne.io/fyne/v2/data/binding.init.0
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/data/binding/queue.go:15 +0x25

goroutine 9 [chan receive]:
fyne.io/fyne/v2/app.newAppWithDriver.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/app.go:120 +0x36
created by fyne.io/fyne/v2/app.newAppWithDriver
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/app.go:118 +0x217

goroutine 10 [syscall]:
syscall.syscall6(0x42255c0, 0x3, 0x0, 0x0, 0xc000040678, 0xa, 0x47f0810)
        /usr/local/go/src/runtime/sys_darwin.go:44 +0x3b
golang.org/x/sys/unix.kevent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20200720211630-cb9d2d5c5666/unix/zsyscall_darwin_amd64.go:292 +0x5b
golang.org/x/sys/unix.Kevent(0x0, {0x0, 0x0, 0xc000040558}, {0xc000040678, 0x0, 0x0}, 0x0)
        /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20200720211630-cb9d2d5c5666/unix/syscall_bsd.go:413 +0x3c
github.com/fsnotify/fsnotify.read(0x0, {0xc000040678, 0x0, 0xa}, 0x0)
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x36
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc00006c840)
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0xa5
created by github.com/fsnotify/fsnotify.NewWatcher
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x1c7

goroutine 11 [chan receive]:
fyne.io/fyne/v2/app.watchFile.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/settings_desktop.go:42 +0x6c
created by fyne.io/fyne/v2/app.watchFile
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/app/settings_desktop.go:41 +0x10f

goroutine 18 [select, locked to thread]:
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:186 +0xfd
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:182 +0xcf

goroutine 19 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.(*window).runEventQueue(0xc000326000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1267 +0x96
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1292 +0x148

goroutine 20 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).setupThemeListener.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/canvas.go:495 +0x3d
created by fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).setupThemeListener
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/canvas.go:493 +0xa5

goroutine 21 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.runOnMain(0xc00032a0e0)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/loop.go:56 +0x71
fyne.io/fyne/v2/internal/driver/glfw.(*window).create(0xc000326000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:1303 +0x5a
sync.(*Once).doSlow(0x989680, 0x0)
        /usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:59
fyne.io/fyne/v2/internal/driver/glfw.(*window).doShow(0xc000326000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:375 +0x87
created by fyne.io/fyne/v2/internal/driver/glfw.(*window).Show
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/driver/glfw/window.go:363 +0x5b
exit status 2
hippodribble commented 3 years ago

WORKAROUND: compile on Macbook Air and copy to Macbook Pro. Code runs correctly.

andydotxyz commented 3 years ago

I think I understand. The fix that resolved auto-switching is in v2.1.0, but it is in the packager no the library. When you installed on a different computer you probably got the new one (check with fyne version). If you upgrade the cmdline tool on the computer that is not working (using go get -u fyne.io/fyne/v2/cmd/fyne) it should build and run correctly.

hippodribble commented 3 years ago

Thanks Andy

No luck, I'm afraid. I uninstalled the packages and the CLI application (even the demo), and reinstalled them all (packages and binary are now both v2.1.0). fyne version fyne cli version: v2.1.0 go mod init on the base example (window with a button) gives: module testfyne

go 1.17

go mod tidy then gives: module testfyne

go 1.17

require fyne.io/fyne/v2 v2.1.0

require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/go-gl/gl v0.0.0-20210813123233-e4099ee2221f // indirect github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb // indirect github.com/godbus/dbus/v5 v5.0.4 // indirect github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 // indirect github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 // indirect github.com/stretchr/testify v1.5.1 // indirect github.com/yuin/goldmark v1.3.8 // indirect golang.org/x/image v0.0.0-20200430140353-33d19683fad8 // indirect golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect golang.org/x/text v0.3.3 // indirect gopkg.in/yaml.v2 v2.2.8 // indirect )

It still fails to execute (building works, it just doesn't run). Whether I build and run, or go run, I get the same thing. If I create a binary on my Macbook Air and try to run that on the Macbook Pro, I also seem to get the same thing, viz

(base) Glenns-MBP:testfyne glenn$ ./main 
2021-10-07 15:26:17.600 main[20714:220016] ApplePersistence=YES
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff20205aec]

runtime stack:
runtime.throw({0x43ba062, 0x0})
        /usr/local/go/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x4309620, 0xc00060fca8)
        /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc00060fc80 sp=0xc00060fc48 pc=0x40068dc
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwCreateWindow(0x66, 0x2d, 0x4b11f50, 0x0, 0x0)
        _cgo_gotypes.go:671 +0x4d fp=0xc00060fca8 sp=0xc00060fc80 pc=0x42c1f8d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow.func2(0x66, 0x2d, 0x4912280, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0x9d fp=0xc00060fce8 sp=0xc00060fca8 pc=0x42c7f9d
github.com/go-gl/glfw/v3.3/glfw.CreateWindow(0xc00009a000, 0xc0000002e8, {0x439e784, 0x40895d0}, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20210410170116-ea3d685f79fb/window.go:348 +0xd5 fp=0xc00060fd80 sp=0xc00060fce8 pc=0x42c7db5
fyne.io/fyne/v2/internal/driver/glfw.(*window).create.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:1427 +0x131 fp=0xc00060fdd8 sp=0xc00060fd80 pc=0x42d7171
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).runGL(0xc000076960)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/loop.go:104 +0x197 fp=0xc00060ff08 sp=0xc00060fdd8 pc=0x42cd557
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).Run(0xc000076960)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/driver.go:83 +0x30 fp=0xc00060ff30 sp=0xc00060ff08 pc=0x42cc670
fyne.io/fyne/v2/internal/driver/glfw.(*window).ShowAndRun(0xc00009a000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:461 +0x2f fp=0xc00060ff48 sp=0xc00060ff30 pc=0x42d148f
main.main()
        /Users/glenn/go/src/testfyne/main.go:14 +0x8b fp=0xc00060ff80 sp=0xc00060ff48 pc=0x42f444b
runtime.main()
        /usr/local/go/src/runtime/proc.go:255 +0x227 fp=0xc00060ffe0 sp=0xc00060ff80 pc=0x4038a47
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00060ffe8 sp=0xc00060ffe0 pc=0x40659a1

goroutine 6 [syscall]:
syscall.syscall6(0x42ee8e0, 0x3, 0x0, 0x0, 0xc000046678, 0xa, 0x4942360)
        /usr/local/go/src/runtime/sys_darwin.go:44 +0x3b
golang.org/x/sys/unix.kevent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c/unix/zsyscall_darwin_amd64.go:276 +0x52
golang.org/x/sys/unix.Kevent(0x0, {0x0, 0x0, 0xc000046558}, {0xc000046678, 0x0, 0x0}, 0x0)
        /Users/glenn/go/pkg/mod/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c/unix/syscall_bsd.go:429 +0x3c
github.com/fsnotify/fsnotify.read(0x0, {0xc000046678, 0x0, 0xa}, 0x0)
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x36
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc00006ce40)
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0xa5
created by github.com/fsnotify/fsnotify.NewWatcher
        /Users/glenn/go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x1c7

goroutine 7 [chan receive]:
fyne.io/fyne/v2/app.watchFile.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/app/settings_desktop.go:42 +0x6c
created by fyne.io/fyne/v2/app.watchFile
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/app/settings_desktop.go:41 +0x10f

goroutine 18 [select, locked to thread]:
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/loop.go:196 +0x11f
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/loop.go:192 +0xcf

goroutine 19 [chan receive]:
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0xc00009a000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/common/window.go:57 +0x7d
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:1388 +0x15b

goroutine 20 [chan receive]:
fyne.io/fyne/v2/internal/async.NewUnboundedCanvasObjectChan.func1()
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/async/chan_canvasobject.go:35 +0x9e
created by fyne.io/fyne/v2/internal/async.NewUnboundedCanvasObjectChan
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/async/chan_canvasobject.go:27 +0xd1

goroutine 10 [chan receive]:
fyne.io/fyne/v2/internal/driver/glfw.runOnMain(0xc0000a0000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/loop.go:61 +0xd7
fyne.io/fyne/v2/internal/driver/glfw.(*window).create(0xc00009a000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:1399 +0x5a
sync.(*Once).doSlow(0x989680, 0x0)
        /usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:59
fyne.io/fyne/v2/internal/driver/glfw.(*window).doShow(0xc00009a000)
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:380 +0x87
created by fyne.io/fyne/v2/internal/driver/glfw.(*window).Show
        /Users/glenn/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:368 +0x5b

Perhaps it's the fact that I have a 2017 Mac with Big Sur. Mind you, it didn't work on Catalina either. A little frustrating of course.

I ran a diff on go.mod and go.sum from both Macs. They are the same.

I was able to go build . on both machines. The resulting file klengths were different:

MBP: 13226440 MBA: 13226672

The difference is 232 bytes.

Source code was:

package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/widget"
)

func main() {
    app := app.New()

    w := app.NewWindow("Hello")
    w.SetContent(widget.NewLabel("Hello Fyne!"))

    w.ShowAndRun()
}

If you have any suggestions as to other things I could try, I would certainly be grateful. I have been working through your book and creating custom widgets for displaying data as images, etc. I am hoping to compile for Mac and Win for folk at work.

Cheers

andydotxyz commented 3 years ago

You seem to have helped narrow it down to a runtime issue - something about OpenGL. It seems not to be able to connect to your graphics card. Are you able to run any other OpenGL based apps? (google around for examples perhaps - not ones using material). Not sure how to start debugging the GL setup on macOS.

hippodribble commented 3 years ago

Thanks Andy

I was able to open .obj files in Clari3D, a free CAD viewer that uses OpenGL. I don't believe it uses Material.

Cheers

Glenn

On Mon, Oct 18, 2021 at 2:49 AM Andy Williams @.***> wrote:

You seem to have helped narrow it down to a runtime issue - something about OpenGL. It seems not to be able to connect to your graphics card. Are you able to run any other OpenGL based apps? (google around for examples perhaps - not ones using material). Not sure how to start debugging the GL setup on macOS.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fyne-io/fyne/issues/2465#issuecomment-945175167, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACL74LUB2VMBB7GVT3F7O5LUHMLCLANCNFSM5D6BV5CA .

andydotxyz commented 3 years ago

Thanks for this. I have one more thought. The GPU auto-switching config is part of the app metadata, so go run will not enable this. Can you please run fyne package (with the v2.1.0 at least version of fyne tool), then try executing the app by running open myapp.app (or double clicking the icon) instead of running it using the go commands. Hopefully this helps!

hippodribble commented 3 years ago

Thanks Andy

That worked. So I can just build and package.

I'll let you know if any more complex apps give a similar problem. I used the demo hello fyne app here. As it wasn't working before and is working now, it is a good result. Many thanks for your help.

This was a 2017 15" Macbook Pro, the one with the shitty keyboard. Maybe I am the only person with this problem.

Cheers

Glenn

On Tue, Oct 26, 2021 at 7:02 PM Andy Williams @.***> wrote:

Thanks for this. I have one more thought. The GPU auto-switching config is part of the app metadata, so go run will not enable this. Can you please run fyne package (with the v2.1.0 at least version of fyne tool), then try executing the app by running open myapp.app (or double clicking the icon) instead of running it using the go commands. Hopefully this helps!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fyne-io/fyne/issues/2465#issuecomment-951823066, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACL74LXDYGYB4J7JPMZX3C3UI2KGLANCNFSM5D6BV5CA .

andydotxyz commented 3 years ago

Glad it is sorted. Maybe we can find a way to message that this is a resolution for macOS developers that could hit it using go run