Git Product home page Git Product logo

Comments (10)

zserge avatar zserge commented on May 13, 2024

Sorry, couldn't reproduce it on 10.12 VM with Go 1.9.2.
The crash happens in the main UI loop. I wonder if this happens every time? And, does it happen to other apps, e.g. todo app example? Will it crash if you click buttons instead of a text view?

from webview.

ooZberg avatar ooZberg commented on May 13, 2024

It is happens every time, very repeatable. I have tried a lot of other stuff like buttons, dialogs etc and everything else works, but when I just click inside a textbox and I see it gets focused (blue glow around the text box) it crashes immediately, every time.

It seems like it always crashes at the same line. (I did a git pull now so it is crashing on a different line compared to the first report)

I also tried the todo-go app, and it actually crashes as soon as the window shows up, printout at the bottom.

The window-go app (when clicking inside the text window):

oozberg ~/go/src/github.com/zserge/webview/examples/window-go $ go build 
oozberg ~/go/src/github.com/zserge/webview/examples/window-go $ ./window-go 
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff92269b52]

runtime stack:
runtime.throw(0x439b21e, 0x2a)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:605 +0x95
runtime.sigpanic()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/signal_unix.go:351 +0x2b8

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x42d5ce0, 0xc420133e48, 0x439a90e)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/cgocall.go:132 +0xe4 fp=0xc420133e08 sp=0xc420133dc8 pc=0x40042b4
github.com/zserge/webview._Cfunc_CgoWebViewLoop(0x5300040, 0x1, 0x0)
	github.com/zserge/webview/_obj/_cgo_gotypes.go:162 +0x4d fp=0xc420133e48 sp=0xc420133e08 pc=0x42d0f5d
github.com/zserge/webview.(*webview).Loop.func1(0x5300040, 0xc400000001, 0xc400000000)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:294 +0x68 fp=0xc420133e80 sp=0xc420133e48 pc=0x42d3a08
github.com/zserge/webview.(*webview).Loop(0xc42013c018, 0xc420133e01, 0xc42013c001)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:294 +0x3a fp=0xc420133ea8 sp=0xc420133e80 pc=0x42d180a
github.com/zserge/webview.(*webview).Run(0xc42013c018)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:298 +0x30 fp=0xc420133ed0 sp=0xc420133ea8 pc=0x42d1860
main.main()
	/Users/oozberg/go/src/github.com/zserge/webview/examples/window-go/main.go:88 +0xdd fp=0xc420133f80 sp=0xc420133ed0 pc=0x42d511d
runtime.main()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/proc.go:195 +0x226 fp=0xc420133fe0 sp=0xc420133f80 pc=0x402e086
runtime.goexit()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc420133fe8 sp=0xc420133fe0 pc=0x4059a61

goroutine 18 [IO wait]:
internal/poll.runtime_pollWait(0x5080f00, 0x72, 0xffffffffffffffff)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc420142018, 0x72, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc420142018, 0xffffffffffffff00, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Accept(0xc420142000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_unix.go:335 +0x1e2
net.(*netFD).accept(0xc420142000, 0xc42003ce48, 0x4002f17, 0xc420150080)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/fd_unix.go:238 +0x42
net.(*TCPListener).accept(0xc42013c010, 0x4256f68, 0x4056520, 0xc42003ce90)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/tcpsock_posix.go:136 +0x2e
net.(*TCPListener).Accept(0xc42013c010, 0x43a4958, 0xc420150000, 0x45396e0, 0xc42011c300)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/tcpsock.go:247 +0x49
net/http.(*Server).Serve(0xc42014c000, 0x4538d60, 0xc42013c010, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2695 +0x1b2
net/http.Serve(0x4538d60, 0xc42013c010, 0x0, 0x0, 0xc42002ffc8, 0x42925e0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2323 +0x73
main.startServer.func1(0x4538d60, 0xc42013c010)
	/Users/oozberg/go/src/github.com/zserge/webview/examples/window-go/main.go:50 +0x9e
created by main.startServer
	/Users/oozberg/go/src/github.com/zserge/webview/examples/window-go/main.go:45 +0xe0

goroutine 19 [IO wait]:
internal/poll.runtime_pollWait(0x5080e40, 0x72, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc420142098, 0x72, 0xffffffffffffff00, 0x4536520, 0x4532a90)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc420142098, 0xc420160000, 0x1000, 0x1000)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Read(0xc420142080, 0xc420160000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_unix.go:126 +0x18a
net.(*netFD).Read(0xc420142080, 0xc420160000, 0x1000, 0x1000, 0xc4201588c8, 0x424d2da, 0xc42012a218)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/fd_unix.go:202 +0x52
net.(*conn).Read(0xc42013c020, 0xc420160000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/net.go:176 +0x6d
net/http.(*connReader).Read(0xc42012a210, 0xc420160000, 0x1000, 0x1000, 0xc420136100, 0x4532794, 0x2)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:753 +0x105
bufio.(*Reader).fill(0xc42015e000)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:97 +0x11a
bufio.(*Reader).ReadSlice(0xc42015e000, 0xc42013610a, 0xc420158a38, 0x40355ab, 0x2, 0xc420158a48, 0x4034c64)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:338 +0x2c
bufio.(*Reader).ReadLine(0xc42015e000, 0x100, 0xf8, 0x437f8e0, 0xc420158a98, 0x220004004079, 0xf8)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:367 +0x34
net/textproto.(*Reader).readLineSlice(0xc42012a240, 0xc420158b20, 0xc420158b20, 0x4013728, 0x100, 0x437f8e0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:55 +0x70
net/textproto.(*Reader).ReadLine(0xc42012a240, 0xc420162100, 0x0, 0xc420158b90, 0x408c632)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:36 +0x2b
net/http.readRequest(0xc42015e000, 0x0, 0xc420162100, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/request.go:925 +0x99
net/http.(*conn).readRequest(0xc420150000, 0x4539620, 0xc420136080, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:933 +0x17c
net/http.(*conn).serve(0xc420150000, 0x4539620, 0xc420136080)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1739 +0x50e
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x288

The todo-go app, just starting:

oozberg ~/go/src/github.com/zserge/webview/examples/todo-go $ go build
oozberg ~/go/src/github.com/zserge/webview/examples/todo-go $ ./todo-go 
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff92269b52]

runtime stack:
runtime.throw(0x439ec1d, 0x2a)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:605 +0x95
runtime.sigpanic()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/signal_unix.go:351 +0x2b8

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x42d84e0, 0xc42012fe48, 0x439e30d)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/cgocall.go:132 +0xe4 fp=0xc42012fe08 sp=0xc42012fdc8 pc=0x40038f4
github.com/zserge/webview._Cfunc_CgoWebViewLoop(0x5200030, 0x1, 0x0)
	github.com/zserge/webview/_obj/_cgo_gotypes.go:162 +0x4d fp=0xc42012fe48 sp=0xc42012fe08 pc=0x42d112d
github.com/zserge/webview.(*webview).Loop.func1(0x5200030, 0xc400000001, 0xc400000000)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:294 +0x68 fp=0xc42012fe80 sp=0xc42012fe48 pc=0x42d3bd8
github.com/zserge/webview.(*webview).Loop(0xc420144010, 0xc42012fe01, 0xc420144001)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:294 +0x3a fp=0xc42012fea8 sp=0xc42012fe80 pc=0x42d19da
github.com/zserge/webview.(*webview).Run(0xc420144010)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:298 +0x30 fp=0xc42012fed0 sp=0xc42012fea8 pc=0x42d1a30
main.main()
	/Users/oozberg/go/src/github.com/zserge/webview/examples/todo-go/main.go:124 +0xdd fp=0xc42012ff80 sp=0xc42012fed0 pc=0x42d6a4d
runtime.main()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/proc.go:195 +0x226 fp=0xc42012ffe0 sp=0xc42012ff80 pc=0x402d6c6
runtime.goexit()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc42012ffe8 sp=0xc42012ffe0 pc=0x40590a1

goroutine 18 [IO wait]:
internal/poll.runtime_pollWait(0x5090f00, 0x72, 0xffffffffffffffff)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc420148018, 0x72, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc420148018, 0xffffffffffffff00, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Accept(0xc420148000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_unix.go:335 +0x1e2
net.(*netFD).accept(0xc420148000, 0xc42003ce48, 0x4002557, 0xc42029e120)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/fd_unix.go:238 +0x42
net.(*TCPListener).accept(0xc420144008, 0x426bb38, 0x4055b60, 0xc42003ce90)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/tcpsock_posix.go:136 +0x2e
net.(*TCPListener).Accept(0xc420144008, 0x43a8078, 0xc42029e0a0, 0x453e720, 0xc42011c450)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/tcpsock.go:247 +0x49
net/http.(*Server).Serve(0xc420150000, 0x453dda0, 0xc420144008, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2695 +0x1b2
net/http.Serve(0x453dda0, 0xc420144008, 0x0, 0x0, 0xc42002ffc8, 0x42927b0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2323 +0x73
main.startServer.func1(0x453dda0, 0xc420144008)
	/Users/oozberg/go/src/github.com/zserge/webview/examples/todo-go/main.go:42 +0x9e
created by main.startServer
	/Users/oozberg/go/src/github.com/zserge/webview/examples/todo-go/main.go:25 +0xe0

goroutine 19 [IO wait]:
internal/poll.runtime_pollWait(0x5090e40, 0x72, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc420148098, 0x72, 0xffffffffffffff00, 0x453b560, 0x4537a90)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc420148098, 0xc420164000, 0x1000, 0x1000)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Read(0xc420148080, 0xc420164000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_unix.go:126 +0x18a
net.(*netFD).Read(0xc420148080, 0xc420164000, 0x1000, 0x1000, 0xc42004d8c8, 0x4261eaa, 0xc420124308)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/fd_unix.go:202 +0x52
net.(*conn).Read(0xc420144018, 0xc420164000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/net.go:176 +0x6d
net/http.(*connReader).Read(0xc420124300, 0xc420164000, 0x1000, 0x1000, 0xc42013e0c0, 0x4537794, 0x2)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:753 +0x105
bufio.(*Reader).fill(0xc420162000)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:97 +0x11a
bufio.(*Reader).ReadSlice(0xc420162000, 0xc42013e00a, 0xc42004da38, 0x4034beb, 0x2, 0xc42004da48, 0x40342a4)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:338 +0x2c
bufio.(*Reader).ReadLine(0xc420162000, 0x100, 0xf8, 0x43832e0, 0xc42004da98, 0x2200040036b9, 0xf8)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:367 +0x34
net/textproto.(*Reader).readLineSlice(0xc420124330, 0xc42004db20, 0xc42004db20, 0x4012d68, 0x100, 0x43832e0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:55 +0x70
net/textproto.(*Reader).ReadLine(0xc420124330, 0xc42013a100, 0x0, 0xc42004db90, 0x409bb82)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:36 +0x2b
net/http.readRequest(0xc420162000, 0x0, 0xc42013a100, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/request.go:925 +0x99
net/http.(*conn).readRequest(0xc420154000, 0x453e660, 0xc42013e040, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:933 +0x17c
net/http.(*conn).serve(0xc420154000, 0x453e660, 0xc42013e040)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1739 +0x50e
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x288

goroutine 35 [IO wait]:
internal/poll.runtime_pollWait(0x5090d80, 0x72, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc42011e218, 0x72, 0xffffffffffffff00, 0x453b560, 0x4537a90)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc42011e218, 0xc420195000, 0x1000, 0x1000)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Read(0xc42011e200, 0xc420195000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_unix.go:126 +0x18a
net.(*netFD).Read(0xc42011e200, 0xc420195000, 0x1000, 0x1000, 0xc4202b98c8, 0x4261eaa, 0xc42026d3b8)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/fd_unix.go:202 +0x52
net.(*conn).Read(0xc420134028, 0xc420195000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/net.go:176 +0x6d
net/http.(*connReader).Read(0xc42026d3b0, 0xc420195000, 0x1000, 0x1000, 0xc4202b99e8, 0x4260cec, 0xc42013f180)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:753 +0x105
bufio.(*Reader).fill(0xc4201622a0)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:97 +0x11a
bufio.(*Reader).ReadSlice(0xc4201622a0, 0x407240a, 0xc4202b9a38, 0x4034beb, 0x0, 0xc4202b9a48, 0x40342a4)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:338 +0x2c
bufio.(*Reader).ReadLine(0xc4201622a0, 0x100, 0xf8, 0x43832e0, 0xc4202b9a98, 0x2200040036b9, 0xf8)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:367 +0x34
net/textproto.(*Reader).readLineSlice(0xc42026d3e0, 0xc4202b9b20, 0xc4202b9b20, 0x4012d68, 0x100, 0x43832e0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:55 +0x70
net/textproto.(*Reader).ReadLine(0xc42026d3e0, 0xc42013a300, 0x0, 0xc4202b9b90, 0x409bb82)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:36 +0x2b
net/http.readRequest(0xc4201622a0, 0x0, 0xc42013a300, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/request.go:925 +0x99
net/http.(*conn).readRequest(0xc42029e000, 0x453e660, 0xc42013f140, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:933 +0x17c
net/http.(*conn).serve(0xc42029e000, 0x453e660, 0xc42013f140)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1739 +0x50e
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x288

goroutine 36 [IO wait]:
internal/poll.runtime_pollWait(0x5090cc0, 0x72, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc42011e298, 0x72, 0xffffffffffffff00, 0x453b560, 0x4537a90)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc42011e298, 0xc4202b2000, 0x1000, 0x1000)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Read(0xc42011e280, 0xc4202b2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/internal/poll/fd_unix.go:126 +0x18a
net.(*netFD).Read(0xc42011e280, 0xc4202b2000, 0x1000, 0x1000, 0xc4200518c8, 0x4261eaa, 0xc42011c698)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/fd_unix.go:202 +0x52
net.(*conn).Read(0xc420134030, 0xc4202b2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/net.go:176 +0x6d
net/http.(*connReader).Read(0xc42011c690, 0xc4202b2000, 0x1000, 0x1000, 0xc420120280, 0x4537794, 0x2)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:753 +0x105
bufio.(*Reader).fill(0xc42029c060)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:97 +0x11a
bufio.(*Reader).ReadSlice(0xc42029c060, 0xc42012020a, 0xc420051a38, 0x4034beb, 0x2, 0xc420051a48, 0x40342a4)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:338 +0x2c
bufio.(*Reader).ReadLine(0xc42029c060, 0x100, 0xf8, 0x43832e0, 0xc420051a98, 0x2200040036b9, 0xf8)
	/usr/local/Cellar/go/1.9.2/libexec/src/bufio/bufio.go:367 +0x34
net/textproto.(*Reader).readLineSlice(0xc42011c6c0, 0xc420051b20, 0xc420051b20, 0x4012d68, 0x100, 0x43832e0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:55 +0x70
net/textproto.(*Reader).ReadLine(0xc42011c6c0, 0xc420116100, 0x0, 0xc420051b90, 0x409bb82)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/textproto/reader.go:36 +0x2b
net/http.readRequest(0xc42029c060, 0x0, 0xc420116100, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/request.go:925 +0x99
net/http.(*conn).readRequest(0xc42029e0a0, 0x453e660, 0xc420120240, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:933 +0x17c
net/http.(*conn).serve(0xc42029e0a0, 0x453e660, 0xc420120240)
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1739 +0x50e
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x288

from webview.

zserge avatar zserge commented on May 13, 2024

@ooZberg Thanks for providing the details so quickly. I will have a look. Meanwhile, I have a few more questions:

  • Does this happen to C or C++ apps? (e.g. minimal example or timer-cxx example) Or does it only happen to Go apps?
  • What terminal do you use? Does it make any difference if you make it an app bundle (e.g.
    Todo.app/Contents/MacOS/todo directory structure, and then do open Todo.app from terminal, or just click on Todo app in the Finder). Normally, GUI apps are not supposed to be run from the terminal, so it might be the cause.
  • May I ask you to put some NSLog around each line in webview_loop - https://github.com/zserge/webview/blob/master/webview.h#L1607 to see where exactly it crashes?

from webview.

ooZberg avatar ooZberg commented on May 13, 2024

I have compiled minimal and timer-cxx examples and they booth work as expected.

  • The minimal example contains a text input (wikipedia search) and it works as expected

I am using the default Terminal.app

  • The apps both work with open minimal.app as well as with ./minimal.app/Contents/MacOS/minimal
  • When using open .app the app is running in non-Retina mode, and if i execute the binary itself it runs in Retina mode, but it does not seem to affect the crashes.

I am not sure how to add the NSLog commands, could you provide a modified webview_loop method and I can just replace it.

If I try to compile the example:

package main

import "github.com/zserge/webview"

func main() {
	// Open wikipedia in a 800x600 resizable window
	webview.Open("Minimal webview example",
		"https://en.m.wikipedia.org/wiki/Main_Page", 800, 600, true)
}

It crashes when I click the search window. (This worked fine in the minimal c application)

oozberg ~/dev/test $ go build
oozberg ~/dev/test $ ./test 
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff92269b52]

runtime stack:
runtime.throw(0x4189c48, 0x2a)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:605 +0x95
runtime.sigpanic()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/signal_unix.go:351 +0x2b8

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x412cc50, 0xc4200dfed8, 0x4128485)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/cgocall.go:132 +0xe4 fp=0xc4200dfe90 sp=0xc4200dfe50 pc=0x4004474
github.com/zserge/webview._Cfunc_webview(0x4500000, 0x4500020, 0x25800000320, 0x1, 0xc400000000)
	github.com/zserge/webview/_obj/_cgo_gotypes.go:237 +0x4d fp=0xc4200dfed8 sp=0xc4200dfe90 pc=0x4128ced
github.com/zserge/webview.Open(0x4185652, 0x17, 0x4189812, 0x29, 0x320, 0x258, 0x1, 0x0, 0x0)
	/Users/oozberg/go/src/github.com/zserge/webview/webview.go:127 +0xf6 fp=0xc4200dff28 sp=0xc4200dfed8 pc=0x4129186
main.main()
	/Users/oozberg/dev/test/test.go:7 +0x62 fp=0xc4200dff80 sp=0xc4200dff28 pc=0x412c332
runtime.main()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/proc.go:195 +0x226 fp=0xc4200dffe0 sp=0xc4200dff80 pc=0x402d7c6
runtime.goexit()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc4200dffe8 sp=0xc4200dffe0 pc=0x4055e71

from webview.

zserge avatar zserge commented on May 13, 2024

Ok. Looks like the crash happens somewhere in the cgo glue code. I don't think NSLog would help here. May I ask you to run the app with lldb? E.g. lldb ./window-go, then once the debugger loads - type r (for "run") and press enter. The app should crash as usually and leave a more detailed stack trace.

from webview.

ooZberg avatar ooZberg commented on May 13, 2024

I have tried to run the window-go app with lldb

It does not seem to produce to much information though..

oozberg ~/go/src/github.com/zserge/webview/examples/window-go $ lldb ./window-go
(lldb) target create "./window-go"
Current executable set to './window-go' (x86_64).
(lldb) run
Process 51924 launched: './window-go' (x86_64)
Process 51924 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00007fff92269b52 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
->  0x7fff92269b52 <+18>: pcmpeqb (%rdi), %xmm0
    0x7fff92269b56 <+22>: pmovmskb %xmm0, %esi
    0x7fff92269b5a <+26>: andq   $0xf, %rcx
    0x7fff92269b5e <+30>: orq    $-0x1, %rax
Target 0: (window-go) stopped.
(lldb) 

from webview.

zserge avatar zserge commented on May 13, 2024

@ooZberg And if you do bt (for "backtrace") - what does it show?

from webview.

ooZberg avatar ooZberg commented on May 13, 2024
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00007fff92269b52 libsystem_c.dylib`strlen + 18
    frame #1: 0x00007fff922c492b libsystem_c.dylib`strdup + 18
    frame #2: 0x00007fff9247db38 libxpc.dylib`xpc_string_create + 11
    frame #3: 0x00007fff9247db0a libxpc.dylib`xpc_dictionary_set_string + 24
    frame #4: 0x00007fff87010771 CharacterPicker`-[CPKPreferences _loadRecentsAndFavoritesForDataSource:asDictionaryNotAsEntity:callAsync:usingBlock:] + 389
    frame #5: 0x00007fff87012f36 CharacterPicker`-[CPKPreferences recentsOfDataSourceSync:] + 156
    frame #6: 0x00007fff7ab1a492 AppKit`-[__NSEmojiDFREmojiListView _loadSystemRecents] + 71
    frame #7: 0x00007fff7ab18af1 AppKit`-[__NSEmojiDFREmojiListView updateRecentsDisplay] + 61
    frame #8: 0x00007fff7ab183bf AppKit`-[__NSEMIMDFRViewController initWithCloseActionTarget:selector:] + 1571
    frame #9: 0x00007fff7b0c5e60 AppKit`-[NSCharacterPickerTouchBarItem initWithIdentifier:] + 139
    frame #10: 0x00007fff7b0c5dc0 AppKit`+[NSCharacterPickerTouchBarItem characterPickerTouchBarItem] + 51
    frame #11: 0x00007fff7b0037f0 AppKit`-[NSTouchBar itemForIdentifier:] + 507
    frame #12: 0x00007fff7b002fc8 AppKit`-[NSTouchBar items] + 322
    frame #13: 0x00007fff7aaaac03 AppKit`-[NSTouchBarViewController _expandBars:] + 381
    frame #14: 0x00007fff7aaab3b8 AppKit`-[NSTouchBarViewController _updateTree] + 126
    frame #15: 0x00007fff7a6544eb AppKit`-[NSView _doLayout] + 86
    frame #16: 0x00007fff7a654098 AppKit`-[NSView _layoutSubtreeWithOldSize:] + 497
    frame #17: 0x00007fff7a654366 AppKit`-[NSView _layoutSubtreeWithOldSize:] + 1215
    frame #18: 0x00007fff7a654366 AppKit`-[NSView _layoutSubtreeWithOldSize:] + 1215
    frame #19: 0x00007fff7ae2995b AppKit`-[NSView _layoutSubtreeIfNeededAndAllowTemporaryEngine:] + 1516
    frame #20: 0x00007fff7a672869 AppKit`-[NSWindow(NSConstraintBasedLayout) _layoutViewTree] + 163
    frame #21: 0x00007fff7a6e1c2e AppKit`-[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 269
    frame #22: 0x00007fff7ae53b09 AppKit`___NSWindowGetDisplayCycleObserver_block_invoke.6222 + 67
    frame #23: 0x00007fff7a6f33b9 AppKit`__37+[NSDisplayCycle currentDisplayCycle]_block_invoke + 454
    frame #24: 0x00007fff825dcd06 QuartzCore`CA::Transaction::run_commit_handlers(CATransactionPhase) + 46
    frame #25: 0x00007fff826e68bc QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 160
    frame #26: 0x00007fff825db7e1 QuartzCore`CA::Transaction::commit() + 475
    frame #27: 0x00007fff7a9d68b1 AppKit`__37+[NSDisplayCycle currentDisplayCycle]_block_invoke.31 + 323
    frame #28: 0x00007fff7caccd37 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    frame #29: 0x00007fff7caccca7 CoreFoundation`__CFRunLoopDoObservers + 391
    frame #30: 0x00007fff7caad6d9 CoreFoundation`__CFRunLoopRun + 873
    frame #31: 0x00007fff7caad114 CoreFoundation`CFRunLoopRunSpecific + 420
    frame #32: 0x00007fff7c00debc HIToolbox`RunCurrentEventLoopInMode + 240
    frame #33: 0x00007fff7c00dbf9 HIToolbox`ReceiveNextEventCommon + 184
    frame #34: 0x00007fff7c00db26 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #35: 0x00007fff7a5a4a54 AppKit`_DPSNextEvent + 1120
    frame #36: 0x00007fff7ad207ee AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    frame #37: 0x00000000042d5d53 window-go`_cgo_4d388572c7f2_Cfunc_CgoWebViewLoop + 115
    frame #38: 0x00000000040586d0 window-go`runtime.asmcgocall + 112
    frame #39: 0x00000000042d0f5d window-go`github.com/zserge/webview._Cfunc_CgoWebViewLoop + 77
    frame #40: 0x00000000042d3a08 window-go`github.com/zserge/webview.(*webview).Loop.func1 + 104
    frame #41: 0x00000000042d180a window-go`github.com/zserge/webview.(*webview).Loop + 58
    frame #42: 0x00000000042d1860 window-go`github.com/zserge/webview.(*webview).Run + 48
    frame #43: 0x00000000042d511d window-go`main.main + 221
    frame #44: 0x000000000402e086 window-go`runtime.main + 550
(lldb) 

from webview.

zserge avatar zserge commented on May 13, 2024

Yeah... Doesn't make much sense to me yet, but at least we're not alone: mmozeiko/RcloneBrowser#55

from webview.

ooZberg avatar ooZberg commented on May 13, 2024

I have upgrade to macOS 10.13.2 and the same binary that crashed before does not crash anymore.🍺

Probably a bug in macOS itself? I suppose you could close this issue.

from webview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.