Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation violation when resizing window under macOS Mojave #1140

Closed
peterhellberg opened this issue Jun 26, 2020 · 2 comments
Closed

Segmentation violation when resizing window under macOS Mojave #1140

peterhellberg opened this issue Jun 26, 2020 · 2 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Milestone

Comments

@peterhellberg
Copy link

Describe the bug:

Resizing the window for the example code results in a segmentation violation under macOS Mojave.

To Reproduce:

Steps to reproduce the behavior:

  1. Run the example code at https://developer.fyne.io/tour/introduction/guis.html
  2. Resize the window (bigger and then smaller for example)
  3. Segmentation violation triggered

Code

package main

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

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

	myWindow := myApp.NewWindow("Hello")

	myWindow.SetContent(widget.NewLabel("Hello Fyne!"))

	myWindow.ShowAndRun()
}

Screenshots:

screenshot 2020-06-26 at 13 55 04

screenshot 2020-06-26 at 14 00 58

Device:

  • OS: macOS
  • Version: 10.14.6
  • Go version: go1.14.4 darwin/amd64
  • Fyne version: v1.3.0

Output

2020/06/26 13:56:47 Error 506 in GL Renderer
2020/06/26 13:56:47   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:187
2020/06/26 13:56:47 Error 506 in GL Renderer
2020/06/26 13:56:47   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:187
2020/06/26 13:56:47 Error 506 in GL Renderer
2020/06/26 13:56:47   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:247
2020/06/26 13:56:56 Error 506 in GL Renderer
2020/06/26 13:56:56   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:187
2020/06/26 13:56:56 Error 506 in GL Renderer
2020/06/26 13:56:56   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:187
2020/06/26 13:56:57 Error 506 in GL Renderer
2020/06/26 13:56:57   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:187
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7fff2ad1ed28]

runtime stack:
runtime.throw(0x4472e47, 0x2a)
	/usr/local/Cellar/go/1.14.4/libexec/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
	/usr/local/Cellar/go/1.14.4/libexec/src/runtime/signal_unix.go:679 +0x46a

goroutine 39 [syscall, locked to thread]:
runtime.cgocall(0x4361690, 0xc00012f808, 0x7fff00000000)
	/usr/local/Cellar/go/1.14.4/libexec/src/runtime/cgocall.go:133 +0x5b fp=0xc00012f7d8 sp=0xc00012f7a0 pc=0x400601b
github.com/go-gl/gl/v3.2-core/gl._Cfunc_glowDrawArrays(0x7fff3a533741, 0x5, 0x4)
	_cgo_gotypes.go:6248 +0x45 fp=0xc00012f808 sp=0xc00012f7d8 pc=0x42e37a5
github.com/go-gl/gl/v3.2-core/gl.DrawArrays(...)
	/Users/peter/Go/pkg/mod/github.com/go-gl/gl@v0.0.0-20190320180904-bf2b1f2f34d7/v3.2-core/gl/package.go:9268
fyne.io/fyne/internal/painter/gl.(*glPainter).glDrawTexture(0xc0003bc000, 0x3f80000000000001)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/gl_core.go:246 +0xec fp=0xc00012f830 sp=0xc00012f808 pc=0x4306f0c
fyne.io/fyne/internal/painter/gl.(*glPainter).drawTextureWithDetails(0xc0003bc000, 0x44f16c0, 0xc0000b4090, 0xc00012f930, 0x8, 0x8, 0x4f, 0x15, 0xd0, 0x4e, ...)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/draw.go:69 +0x14d fp=0xc00012f8b0 sp=0xc00012f830 pc=0x430255d
fyne.io/fyne/internal/painter/gl.(*glPainter).drawText(0xc0003bc000, 0xc0000b4090, 0x8, 0x8, 0xd0, 0x4e)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/draw.go:131 +0x227 fp=0xc00012f950 sp=0xc00012f8b0 pc=0x4303157
fyne.io/fyne/internal/painter/gl.(*glPainter).drawObject(0xc0003bc000, 0x44f16c0, 0xc0000b4090, 0x8, 0x8, 0xd0, 0x4e)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/draw.go:150 +0x45e fp=0xc00012f9b0 sp=0xc00012f950 pc=0x430369e
fyne.io/fyne/internal/painter/gl.(*glPainter).Paint(0xc0003bc000, 0x44f16c0, 0xc0000b4090, 0x8, 0x8, 0xd0, 0x4e)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/gl/painter.go:68 +0x8c fp=0xc00012f9f8 sp=0xc00012f9b0 pc=0x430728c
fyne.io/fyne/internal/driver/glfw.(*glCanvas).paint.func1(0xc00009a0f0, 0x8, 0x8)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:421 +0x162 fp=0xc00012fa78 sp=0xc00012f9f8 pc=0x4326462
fyne.io/fyne/internal/driver/glfw.(*glCanvas).walkTree.func1(0x44f16c0, 0xc0000b4090, 0x8, 0x8, 0x0, 0x0, 0x7fffffff, 0x7fffffff, 0xd0)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:477 +0x137 fp=0xc00012fac8 sp=0xc00012fa78 pc=0x4326617
fyne.io/fyne/internal/driver.walkObjectTree(0x44f16c0, 0xc0000b4090, 0x44f17e0, 0xc000096080, 0x4, 0x4, 0x0, 0x0, 0x7fffffff, 0x7fffffff, ...)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/util.go:74 +0x2d0 fp=0xc00012fb88 sp=0xc00012fac8 pc=0x4257ed0
fyne.io/fyne/internal/driver.walkObjectTree(0x44f17e0, 0xc000096080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7fffffff, 0x7fffffff, ...)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/util.go:81 +0x1f6 fp=0xc00012fc48 sp=0xc00012fb88 pc=0x4257df6
fyne.io/fyne/internal/driver.WalkVisibleObjectTree(0x44f17e0, 0xc000096080, 0xc00012fd38, 0xc00012fd10, 0xc00003f000)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/util.go:25 +0x82 fp=0xc00012fcc8 sp=0xc00012fc48 pc=0x4257b22
fyne.io/fyne/internal/driver/glfw.(*glCanvas).walkTree(0xc000094000, 0xc000098040, 0xc00012fdf0, 0xc00012fde0)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:498 +0x15c fp=0xc00012fd80 sp=0xc00012fcc8 pc=0x431cc3c
fyne.io/fyne/internal/driver/glfw.(*glCanvas).walkTrees(0xc000094000, 0xc00012fdf0, 0xc00012fde0)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:436 +0x4f fp=0xc00012fdc8 sp=0xc00012fd80 pc=0x431ca1f
fyne.io/fyne/internal/driver/glfw.(*glCanvas).paint(0xc000094000, 0xd0, 0x4e)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:429 +0xd5 fp=0xc00012fe20 sp=0xc00012fdc8 pc=0x431c9a5
fyne.io/fyne/internal/driver/glfw.(*gLDriver).repaintWindow.func1()
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/loop.go:156 +0x7f fp=0xc00012fe60 sp=0xc00012fe20 pc=0x4326c7f
fyne.io/fyne/internal/driver/glfw.(*window).RunWithContext(0xc000090000, 0xc00012fe88)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/window.go:1010 +0x38 fp=0xc00012fe78 sp=0xc00012fe60 pc=0x43256d8
fyne.io/fyne/internal/driver/glfw.(*gLDriver).repaintWindow(0xc0001c6280, 0xc000090000)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/loop.go:147 +0x60 fp=0xc00012feb0 sp=0xc00012fe78 pc=0x431edc0
fyne.io/fyne/internal/driver/glfw.(*gLDriver).startDrawThread.func1(0xc000180360, 0xc0001b00f0, 0xc0001c6280)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/loop.go:193 +0x217 fp=0xc00012ffc8 sp=0xc00012feb0 pc=0x4326f07
runtime.goexit()
	/usr/local/Cellar/go/1.14.4/libexec/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00012ffd0 sp=0xc00012ffc8 pc=0x4064711
created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).startDrawThread
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/loop.go:169 +0xbd

goroutine 1 [runnable, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwPollEvents()
	_cgo_gotypes.go:1404 +0x41
github.com/go-gl/glfw/v3.3/glfw.PollEvents()
	/Users/peter/Go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/window.go:948 +0x22
fyne.io/fyne/internal/driver/glfw.(*gLDriver).tryPollEvents(0xc0001c6280)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/loop.go:207 +0x44
fyne.io/fyne/internal/driver/glfw.(*gLDriver).runGL(0xc0001c6280)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/loop.go:101 +0x1e3
fyne.io/fyne/internal/driver/glfw.(*gLDriver).Run(0xc0001c6280)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/driver.go:70 +0x37
fyne.io/fyne/internal/driver/glfw.(*window).ShowAndRun(0xc000090000)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/window.go:387 +0x57
main.main()
	/Users/peter/Go/src/experiments/fyne/fyne-hello/fyne-hello.go:15 +0xdc

goroutine 35 [sleep]:
time.Sleep(0x22ecb25c00)
	/usr/local/Cellar/go/1.14.4/libexec/src/runtime/time.go:188 +0xba
fyne.io/fyne/internal/painter.svgCacheJanitor.func1()
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/svg_cache.go:51 +0x116
sync.(*Once).doSlow(0x4a8fd78, 0xc0001a82d0)
	/usr/local/Cellar/go/1.14.4/libexec/src/sync/once.go:66 +0xec
sync.(*Once).Do(0x4a8fd78, 0xc0001a82d0)
	/usr/local/Cellar/go/1.14.4/libexec/src/sync/once.go:57 +0x45
created by fyne.io/fyne/internal/painter.svgCacheJanitor
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/svg_cache.go:49 +0x9b

goroutine 36 [chan receive]:
fyne.io/fyne/app.newAppWithDriver.func1(0xc0001801e0, 0xc0001ac3c0)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/app/app.go:113 +0x3d
created by fyne.io/fyne/app.newAppWithDriver
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/app/app.go:111 +0x182

goroutine 37 [syscall]:
syscall.syscall6(0x4342440, 0x3, 0x0, 0x0, 0xc00005be88, 0xa, 0x4a8fe80, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.14.4/libexec/src/runtime/sys_darwin.go:74 +0x2e
golang.org/x/sys/unix.kevent(0x3, 0x0, 0x0, 0xc00005be88, 0xa, 0x4a8fe80, 0x0, 0x0, 0x0)
	/Users/peter/Go/pkg/mod/golang.org/x/sys@v0.0.0-20200327173247-9dae0f8f5775/unix/zsyscall_darwin_amd64.go:292 +0xa6
golang.org/x/sys/unix.Kevent(0x3, 0x0, 0x0, 0x0, 0xc00005be88, 0xa, 0xa, 0x4a8fe80, 0x0, 0x0, ...)
	/Users/peter/Go/pkg/mod/golang.org/x/sys@v0.0.0-20200327173247-9dae0f8f5775/unix/syscall_bsd.go:413 +0x71
github.com/fsnotify/fsnotify.read(0x3, 0xc00005be88, 0xa, 0xa, 0x4a8fe80, 0xc00005be88, 0x0, 0xa, 0x0, 0x0)
	/Users/peter/Go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x6e
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc0001ac420)
	/Users/peter/Go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0x804
created by github.com/fsnotify/fsnotify.NewWatcher
	/Users/peter/Go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x18f

goroutine 38 [chan receive]:
fyne.io/fyne/app.watchFile.func1(0xc0001ac420, 0xc0001a60c0, 0x33, 0xc000191320, 0xc000191330)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/app/settings_desktop.go:42 +0x58
created by fyne.io/fyne/app.watchFile
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/app/settings_desktop.go:41 +0xe7

goroutine 50 [chan receive]:
fyne.io/fyne/internal/driver/glfw.(*window).runEventQueue(0xc000090000)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/window.go:1070 +0xb0
created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).createWindow.func1
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/window.go:1095 +0x103

goroutine 51 [chan receive]:
fyne.io/fyne/internal/driver/glfw.(*glCanvas).setupThemeListener.func1(0xc0000b0000, 0xc000094000)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:520 +0x47
created by fyne.io/fyne/internal/driver/glfw.(*glCanvas).setupThemeListener
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/driver/glfw/canvas.go:518 +0xa6

goroutine 20 [chan receive]:
fyne.io/fyne/internal/painter.SvgCacheMonitorTheme.func1(0xc00011a000)
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/svg_cache.go:103 +0x34
created by fyne.io/fyne/internal/painter.SvgCacheMonitorTheme
	/Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.0/internal/painter/svg_cache.go:101 +0x9c
exit status 2
@andydotxyz andydotxyz added blocker Items that would block a forthcoming release bug Something isn't working labels Jun 26, 2020
@andydotxyz andydotxyz added this to the 1.3.x milestone Jun 26, 2020
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 30, 2020
This does add a little lag, especially on complex screens, but that is the tradeoff.
Resizing GL canvases is slow so unfortunately.

Fixes fyne-io#1114, fyne-io#1122, fyne-io#1140
@andydotxyz
Copy link
Member

I think this has been resolved on develop now, but I could not replicate before so please can you test that branch? @peterhellberg

@peterhellberg
Copy link
Author

@andydotxyz The segmentation violation seems to have been resolved in develop now. Good job :)

Steps taken when testing your changes

$ cat go.mod
module experiments/fyne/fyne-hello

go 1.14

require fyne.io/fyne v1.3.0
$ go get fyne.io/fyne@develop
go: fyne.io/fyne develop => v1.3.1-0.20200630182836-102ff9e4a866
go: downloading fyne.io/fyne v1.3.1-0.20200630182836-102ff9e4a866
$ go run fyne-hello.go
go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3
2020/07/01 07:53:11 Error 506 in GL Renderer
2020/07/01 07:53:11   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.1-0.20200630182836-102ff9e4a866/internal/painter/gl/gl_core.go:187
2020/07/01 07:53:12 Error 506 in GL Renderer
2020/07/01 07:53:12   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.1-0.20200630182836-102ff9e4a866/internal/painter/gl/gl_core.go:187
2020/07/01 07:53:12 Error 506 in GL Renderer
2020/07/01 07:53:12   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.1-0.20200630182836-102ff9e4a866/internal/painter/gl/gl_core.go:247
2020/07/01 07:53:16 Error 506 in GL Renderer
2020/07/01 07:53:16   At: /Users/peter/Go/pkg/mod/fyne.io/fyne@v1.3.1-0.20200630182836-102ff9e4a866/internal/painter/gl/gl_core.go:187
<…>

Error 506 in GL Renderer is still logged when resizing the window, but it doesn’t crash anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants