andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 648 forks source link

UI events cause Crash after adding Table (Darwin) #57

Open antonyho opened 9 years ago

antonyho commented 9 years ago

After I have added a ui.Table to my interface, events on UI component crash frequently. Resizing the window dies 100%.

Here are some dumps I've collected after crashing.

Clicking on Image:

panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x14 pc=0x40259ce]

goroutine 16 [running]: runtime.panic(0x412d7c0, 0x4211d84) /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5 github.com/andlabs/ui.areaMouseEvent(0x4723640, 0x7023e90, 0x4030000, 0xc20803c560) /Users/antonyho/golang/src/github.com/andlabs/ui/area_darwin.go:170 +0x6c1 github.com/andlabs/ui.areaView_mouseMoved_mouseDragged(0x4723640, 0x7023e90, 0xc20803c560) /Users/antonyho/golang/src/github.com/andlabs/ui/area_darwin.go:177 +0x45 github.com/andlabs/ui._Cfunc_uimsgloop(0x4034f71) github.com/andlabs/ui/_obj/_cgo_defun.c:588 +0x31 github.com/andlabs/ui.uimsgloop() /Users/antonyho/golang/src/github.com/andlabs/ui/uitask_darwin.go:27 +0x1a github.com/andlabs/ui.Go(0x0, 0x0) /Users/antonyho/golang/src/github.com/andlabs/ui/uitask.go:22 +0x71 main.main() /Users/antonyho/golang/src/reserve-gui/main.go:279 +0x36

goroutine 19 [finalizer wait]: runtime.park(0x401d430, 0x421f128, 0x4213e49) /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89 runtime.parkunlock(0x421f128, 0x4213e49) /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b runfinq() /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 17 [syscall]: runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 21 [chan receive]: github.com/andlabs/ui.uiissueloop() /Users/antonyho/golang/src/github.com/andlabs/ui/uitask.go:59 +0x50 created by github.com/andlabs/ui.Go /Users/antonyho/golang/src/github.com/andlabs/ui/uitask.go:21 +0x6a exit status 2

Resizing Window:

fatal error: unexpected signal during runtime execution [signal 0xb code=0x1 addr=0x28 pc=0x7fff9adcf825]

runtime stack: runtime: unexpected return pc for runtime.sigpanic called from 0x7fff9adcf825 runtime.throw(0x4211cd6) /usr/local/go/src/pkg/runtime/panic.c:520 +0x69 runtime: unexpected return pc for runtime.sigpanic called from 0x7fff9adcf825 runtime.sigpanic() /usr/local/go/src/pkg/runtime/os_darwin.c:439 +0x3d

goroutine 16 [syscall]: runtime.cgocall(0x4002370, 0x45b5f40) /usr/local/go/src/pkg/runtime/cgocall.c:143 +0xe5 fp=0x45b5f28 sp=0x45b5ee0 github.com/andlabs/ui._Cfunc_containerBounds(0x40f3480, 0xc20804c000, 0x186, 0x41330e0, 0xc2080b2940) github.com/andlabs/ui/_obj/_cgo_defun.c:183 +0x31 fp=0x45b5f40 sp=0x45b5f28 github.com/andlabs/ui.containerResized(0xc2080c6440) /Users/antonyho/golang/src/github.com/andlabs/ui/container_darwin.go:45 +0x5a fp=0x45b5fa0 sp=0x45b5f40 ----- stack segment boundary ----- runtime.cgocallbackg1() /usr/local/go/src/pkg/runtime/cgocall.c:275 +0xb9 fp=0x45a1e48 sp=0x45a1df0 runtime.cgocallbackg() /usr/local/go/src/pkg/runtime/cgocall.c:247 +0x6b fp=0x45a1e70 sp=0x45a1e48 runtime.cgocallback_gofunc(0x400e10d, 0x4002720, 0x45a1ee8) /usr/local/go/src/pkg/runtime/asm_amd64.s:786 +0x69 fp=0x45a1e80 sp=0x45a1e70 runtime.asmcgocall(0x4002720, 0x45a1ee8) /usr/local/go/src/pkg/runtime/asm_amd64.s:691 +0x3a fp=0x45a1e88 sp=0x45a1e80 runtime.cgocall(0x4002720, 0x45a1ee8) /usr/local/go/src/pkg/runtime/cgocall.c:143 +0xfd fp=0x45a1ed0 sp=0x45a1e88 github.com/andlabs/ui._Cfunc_uimsgloop(0x4034f71) github.com/andlabs/ui/_obj/_cgo_defun.c:588 +0x31 fp=0x45a1ee8 sp=0x45a1ed0 github.com/andlabs/ui.uimsgloop() /Users/antonyho/golang/src/github.com/andlabs/ui/uitask_darwin.go:27 +0x1a fp=0x45a1ef0 sp=0x45a1ee8 github.com/andlabs/ui.Go(0x0, 0x0) /Users/antonyho/golang/src/github.com/andlabs/ui/uitask.go:22 +0x71 fp=0x45a1f18 sp=0x45a1ef0 main.main() /Users/antonyho/golang/src/reserve-gui/main.go:279 +0x36 fp=0x45a1f50 sp=0x45a1f18 runtime.main() /usr/local/go/src/pkg/runtime/proc.c:247 +0x11a fp=0x45a1fa8 sp=0x45a1f50 runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445 fp=0x45a1fb0 sp=0x45a1fa8 created by _rt0_go /usr/local/go/src/pkg/runtime/asm_amd64.s:97 +0x120

goroutine 19 [finalizer wait]: runtime.park(0x401d430, 0x421f128, 0x4213e49) /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89 runtime.parkunlock(0x421f128, 0x4213e49) /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b runfinq() /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 17 [syscall]: runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 21 [chan receive]: github.com/andlabs/ui.uiissueloop() /Users/antonyho/golang/src/github.com/andlabs/ui/uitask.go:59 +0x50 created by github.com/andlabs/ui.Go /Users/antonyho/golang/src/github.com/andlabs/ui/uitask.go:21 +0x6a exit status 2

eikaas commented 9 years ago

This happens for me aswell, added a table, resizing the window - poof: $ ./tendo 2015/07/03 09:27:29 main.Server panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0xd8 pc=0x4496f1]

goroutine 1 [running, locked to thread]: github.com/andlabs/ui.containerResize(0xc208020220, 0x7fff53304520) /home/robin/code/go/src/github.com/andlabs/ui/container_unix.go:55 +0xb1 github.com/andlabs/ui._Cfunc_gtk_main() /home/robin/code/go/src/github.com/andlabs/ui/:502 +0x45 github.com/andlabs/ui.uimsgloop() /home/robin/code/go/src/github.com/andlabs/ui/uitask_unix.go:31 +0x1b github.com/andlabs/ui.Go(0x0, 0x0) /home/robin/code/go/src/github.com/andlabs/ui/uitask.go:22 +0x74 main.main() /home/robin/code/go/src/github.com/eikaas/tendo/main.go:10 +0x3b

goroutine 17 [syscall, locked to thread]: runtime.goexit() /home/robin/.gvm/gos/go1.4.1/src/runtime/asm_amd64.s:2232 +0x1

goroutine 6 [chan receive]: github.com/andlabs/ui.uiissueloop() /home/robin/code/go/src/github.com/andlabs/ui/uitask.go:59 +0x53 created by github.com/andlabs/ui.Go /home/robin/code/go/src/github.com/andlabs/ui/uitask.go:21 +0x6d

(Running LInux 4.0.7-2 w/ go1.4.1) Code: https://gist.github.com/eikaas/4a8f7509a3d6d92684f0

andlabs commented 9 years ago

I don't know what's going on there. I haven't added tables to the new libui yet, but when I do we'll see if the bug persists.