alttpo / sni

SNES Interface with gRPC API
MIT License
46 stars 12 forks source link

Crash SIGBUS: Bus Error on MacOS #37

Open jneen opened 7 months ago

jneen commented 7 months ago

From a fresh build from source, running ./sni with no arguments results in a large stack trace. The same seems to happen with the published universal binary.

$ uname -a
Darwin [REDACTED] 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64
$ ./sni
2024/02/29 05:40:02.165038 sni-darwin-arm64 v0.0.0 dirty built on 2021-05-03T00:17:00Z by go
2024/02/29 05:40:02.165092 logging to '/Users/jneen/.sni/sni-darwin-arm64-v0.0.0-2024-02-29T00-40-02-164Z.log'
2024/02/29 05:40:02.165101 config: load
2024/02/29 05:40:02.165395 Read env var SNI_FXPAKPRO_DISABLE: not found; defaulting to '0'
2024/02/29 05:40:02.165405 Read env var SNI_DEBUG: not found; defaulting to '0'
2024/02/29 05:40:02.165412 Read env var SNI_EMUNW_DISABLE: not found; defaulting to '0'
2024/02/29 05:40:02.165418 Read env var NWA_PORT_RANGE: not found; defaulting to '0xbeef'
2024/02/29 05:40:02.165424 Read env var NWA_DISABLE_OLD_RANGE: not found; defaulting to '1'
2024/02/29 05:40:02.165430 emunwa: disabling old port range 65400..65409 due to NWA_DISABLE_OLD_RANGE
2024/02/29 05:40:02.165437 Read env var SNI_EMUNW_HOSTS: not found; defaulting to 'localhost:48879,localhost:48880,localhost:48881,localhost:48882,localhost:48883,localhost:48884,localhost:48885,localhost:48886,localhost:48887,localhost:48888'
2024/02/29 05:40:02.168024 Read env var SNI_EMUNW_DETECT_LOG: not found; defaulting to '0'
2024/02/29 05:40:02.168047 Read env var SNI_LUABRIDGE_LISTEN_HOST: not found; defaulting to '0.0.0.0'
2024/02/29 05:40:02.168057 Read env var SNI_LUABRIDGE_LISTEN_PORT: not found; defaulting to '65398'
2024/02/29 05:40:02.168068 Read env var SNI_RETROARCH_DISABLE: not found; defaulting to '0'
2024/02/29 05:40:02.168075 Read env var SNI_RETROARCH_HOSTS: not found; defaulting to 'localhost:55355'
2024/02/29 05:40:02.168190 luabridge: listening on 0.0.0.0:65398
2024/02/29 05:40:02.168341 Read env var SNI_RETROARCH_DETECT_LOG: not found; defaulting to '0'
2024/02/29 05:40:02.168356 Read env var SNI_MOCK_ENABLE: not found; defaulting to '0'
2024/02/29 05:40:02.168365 Read env var SNI_GRPC_LISTEN_HOST: not found; defaulting to '0.0.0.0'
2024/02/29 05:40:02.168393 Read env var SNI_USB2SNES_DISABLE: not found; defaulting to '0'
2024/02/29 05:40:02.168400 Read env var SNI_USB2SNES_LISTEN_ADDRS: not found; defaulting to '0.0.0.0:23074'
2024/02/29 05:40:02.168424 Read env var SNI_GRPCWEB_LISTEN_PORT: not found; defaulting to '8190'
2024/02/29 05:40:02.168480 grpcweb: listening on 0.0.0.0:8190
2024/02/29 05:40:02.168396 Read env var SNI_GRPC_LISTEN_PORT: not found; defaulting to '8191'
2024/02/29 05:40:02.168525 grpc: listening on 0.0.0.0:8191
2024/02/29 05:40:02.168603 usb2snes: listening on 0.0.0.0:23074
SIGBUS: bus error
PC=0xbad4007 m=5 sigcode=1
signal arrived during cgo execution

goroutine 72 [syscall]:
runtime.cgocall(0x100977270, 0x14000307e58)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/cgocall.go:157 +0x44 fp=0x14000307e20 sp=0x14000307de0 pc=0x10031f7c4
github.com/alttpo/systray._Cfunc_setIcon(0x10111d9a0, 0x34fe, 0x0)
    _cgo_gotypes.go:167 +0x30 fp=0x14000307e50 sp=0x14000307e20 pc=0x10072e890
github.com/alttpo/systray.SetIcon(...)
    /Users/jneen/go/pkg/mod/github.com/alttpo/systray@v0.0.0-20240127184046-394d348e75ad/systray_nonwindows.go:36
sni/cmd/sni/tray.trayStart()
    /Users/jneen/src/sni/cmd/sni/tray/tray.go:99 +0x48 fp=0x14000307fa0 sp=0x14000307e50 pc=0x1008873c8
github.com/alttpo/systray.Register.func2()
    /Users/jneen/go/pkg/mod/github.com/alttpo/systray@v0.0.0-20240127184046-394d348e75ad/systray.go:100 +0x38 fp=0x14000307fd0 sp=0x14000307fa0 pc=0x10072dba8
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000307fd0 sp=0x14000307fd0 pc=0x100389544
created by github.com/alttpo/systray.Register in goroutine 1
    /Users/jneen/go/pkg/mod/github.com/alttpo/systray@v0.0.0-20240127184046-394d348e75ad/systray.go:98 +0xb8

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x1009772cc, 0x1400028fdd8)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/cgocall.go:157 +0x44 fp=0x1400028fda0 sp=0x1400028fd60 pc=0x10031f7c4
github.com/alttpo/systray._Cfunc_nativeLoop()
    _cgo_gotypes.go:131 +0x34 fp=0x1400028fdd0 sp=0x1400028fda0 pc=0x10072e7a4
github.com/alttpo/systray.nativeLoop(...)
    /Users/jneen/go/pkg/mod/github.com/alttpo/systray@v0.0.0-20240127184046-394d348e75ad/systray_nonwindows.go:24
github.com/alttpo/systray.Run(0x14000318340?, 0x1400031e060?)
    /Users/jneen/go/pkg/mod/github.com/alttpo/systray@v0.0.0-20240127184046-394d348e75ad/systray.go:84 +0x24 fp=0x1400028fdf0 sp=0x1400028fdd0 pc=0x10072d984
sni/cmd/sni/tray.CreateSystray()
    /Users/jneen/src/sni/cmd/sni/tray/tray.go:67 +0x2c fp=0x1400028fe50 sp=0x1400028fdf0 pc=0x100886f2c
main.main()
    /Users/jneen/src/sni/cmd/sni/main.go:103 +0x2dc fp=0x1400028ff30 sp=0x1400028fe50 pc=0x100976d0c
runtime.main()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:267 +0x2bc fp=0x1400028ffd0 sp=0x1400028ff30 pc=0x10035528c
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400028ffd0 sp=0x1400028ffd0 pc=0x100389544

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x1400006af90 sp=0x1400006af70 pc=0x1003556e8
runtime.goparkunlock(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:404
runtime.forcegchelper()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:322 +0xb8 fp=0x1400006afd0 sp=0x1400006af90 pc=0x100355548
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400006afd0 sp=0x1400006afd0 pc=0x100389544
created by runtime.init.6 in goroutine 1
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:310 +0x24

goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x1400006b760 sp=0x1400006b740 pc=0x1003556e8
runtime.goparkunlock(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:404
runtime.bgsweep(0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgcsweep.go:280 +0xa0 fp=0x1400006b7b0 sp=0x1400006b760 pc=0x100340370
runtime.gcenable.func1()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgc.go:200 +0x28 fp=0x1400006b7d0 sp=0x1400006b7b0 pc=0x100334e68
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400006b7d0 sp=0x1400006b7d0 pc=0x100389544
created by runtime.gcenable in goroutine 1
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgc.go:200 +0x6c

goroutine 4 [GC scavenge wait]:
runtime.gopark(0x1400007c000?, 0x100a864d8?, 0x1?, 0x0?, 0x140000031e0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x1400006bf50 sp=0x1400006bf30 pc=0x1003556e8
runtime.goparkunlock(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:404
runtime.(*scavengerState).park(0x101135a00)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgcscavenge.go:425 +0x5c fp=0x1400006bf80 sp=0x1400006bf50 pc=0x10033dc1c
runtime.bgscavenge(0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgcscavenge.go:653 +0x44 fp=0x1400006bfb0 sp=0x1400006bf80 pc=0x10033e174
runtime.gcenable.func2()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgc.go:201 +0x28 fp=0x1400006bfd0 sp=0x1400006bfb0 pc=0x100334e08
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400006bfd0 sp=0x1400006bfd0 pc=0x100389544
created by runtime.gcenable in goroutine 1
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mgc.go:201 +0xac

goroutine 18 [select]:
runtime.gopark(0x1400018cfa8?, 0x2?, 0x0?, 0xf?, 0x1400018cf84?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x1400018ce20 sp=0x1400018ce00 pc=0x1003556e8
runtime.selectgo(0x1400018cfa8, 0x1400018cf80, 0x0?, 0x0, 0x101000000000000?, 0x1)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/select.go:327 +0x608 fp=0x1400018cf30 sp=0x1400018ce20 pc=0x1003668e8
github.com/desertbit/timer.timerRoutine()
    /Users/jneen/go/pkg/mod/github.com/desertbit/timer@v0.0.0-20180107155436-c41aec40b27f/timers.go:119 +0xa4 fp=0x1400018cfd0 sp=0x1400018cf30 pc=0x100915614
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400018cfd0 sp=0x1400018cfd0 pc=0x100389544
created by github.com/desertbit/timer.init.0 in goroutine 1
    /Users/jneen/go/pkg/mod/github.com/desertbit/timer@v0.0.0-20180107155436-c41aec40b27f/timers.go:15 +0x24

goroutine 19 [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x14000066580 sp=0x14000066560 pc=0x1003556e8
runtime.runfinq()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mfinal.go:193 +0x108 fp=0x140000667d0 sp=0x14000066580 pc=0x100333f18
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000667d0 sp=0x140000667d0 pc=0x100389544
created by runtime.createfing in goroutine 1
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/mfinal.go:163 +0x80

goroutine 69 [IO wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x14000080a60 sp=0x14000080a40 pc=0x1003556e8
runtime.netpollblock(0x14000080af8?, 0x3f5b14?, 0x1?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:564 +0x158 fp=0x14000080aa0 sp=0x14000080a60 pc=0x10034ec08
internal/poll.runtime_pollWait(0x1016f78b0, 0x72)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:343 +0xa0 fp=0x14000080ad0 sp=0x14000080aa0 pc=0x1003832a0
internal/poll.(*pollDesc).wait(0x140001ba100?, 0x1?, 0x0)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28 fp=0x14000080b00 sp=0x14000080ad0 pc=0x1003f1178
internal/poll.(*pollDesc).waitRead(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x140001ba100)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_unix.go:611 +0x250 fp=0x14000080bb0 sp=0x14000080b00 pc=0x1003f5c00
net.(*netFD).accept(0x140001ba100)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/fd_unix.go:172 +0x28 fp=0x14000080c70 sp=0x14000080bb0 pc=0x1004d2278
net.(*TCPListener).accept(0x140001ac140)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock_posix.go:152 +0x28 fp=0x14000080ca0 sp=0x14000080c70 pc=0x1004e81e8
net.(*TCPListener).Accept(0x140001ac140)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock.go:315 +0x2c fp=0x14000080ce0 sp=0x14000080ca0 pc=0x1004e73cc
google.golang.org/grpc.(*Server).Serve(0x1400032e000, {0x100c375e0?, 0x140001ac140})
    /Users/jneen/go/pkg/mod/google.golang.org/grpc@v1.61.0/server.go:885 +0x458 fp=0x14000080e30 sp=0x14000080ce0 pc=0x10085aab8
sni/services/grpcimpl.listenGrpc({0x140001a0220, 0xc})
    /Users/jneen/src/sni/services/grpcimpl/grpc.go:90 +0x154 fp=0x14000080f30 sp=0x14000080e30 pc=0x100932f04
sni/services/grpcimpl.serveGrpc()
    /Users/jneen/src/sni/services/grpcimpl/grpc.go:69 +0x114 fp=0x14000080fd0 sp=0x14000080f30 pc=0x100932d84
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000080fd0 sp=0x14000080fd0 pc=0x100389544
created by sni/services/grpcimpl.StartGrpcServer in goroutine 1
    /Users/jneen/src/sni/services/grpcimpl/grpc.go:48 +0x35c

goroutine 68 [chan receive]:
runtime.gopark(0x140003065d8?, 0x1004c233c?, 0xb8?, 0x65?, 0x1004e11c8?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x14000306570 sp=0x14000306550 pc=0x1003556e8
runtime.chanrecv(0x14000320660, 0x140003066d8, 0x1)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/chan.go:583 +0x414 fp=0x140003065f0 sp=0x14000306570 pc=0x100321cd4
runtime.chanrecv2(0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/chan.go:447 +0x14 fp=0x14000306620 sp=0x140003065f0 pc=0x1003218a4
sni/devices/snes/drivers/retroarch.(*RAClient).handleOutgoing(0x1400032a000)
    /Users/jneen/src/sni/devices/snes/drivers/retroarch/raclient.go:622 +0x13c fp=0x140003067b0 sp=0x14000306620 pc=0x10091132c
sni/devices/snes/drivers/retroarch.NewRAClient.func2()
    /Users/jneen/src/sni/devices/snes/drivers/retroarch/raclient.go:99 +0x28 fp=0x140003067d0 sp=0x140003067b0 pc=0x10090e188
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140003067d0 sp=0x140003067d0 pc=0x100389544
created by sni/devices/snes/drivers/retroarch.NewRAClient in goroutine 1
    /Users/jneen/src/sni/devices/snes/drivers/retroarch/raclient.go:99 +0x170

goroutine 67 [chan receive]:
runtime.gopark(0x101134900?, 0x100c38e08?, 0x60?, 0x29?, 0x10097a01b?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x14000067630 sp=0x14000067610 pc=0x1003556e8
runtime.chanrecv(0x140003206c0, 0x14000067748, 0x1)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/chan.go:583 +0x414 fp=0x140000676b0 sp=0x14000067630 pc=0x100321cd4
runtime.chanrecv2(0x4?, 0x1400030e450?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/chan.go:447 +0x14 fp=0x140000676e0 sp=0x140000676b0 pc=0x1003218a4
sni/devices/snes/drivers/retroarch.(*RAClient).handleIncoming(0x1400032a000)
    /Users/jneen/src/sni/devices/snes/drivers/retroarch/raclient.go:680 +0x8c fp=0x140000677b0 sp=0x140000676e0 pc=0x100911c0c
sni/devices/snes/drivers/retroarch.NewRAClient.func1()
    /Users/jneen/src/sni/devices/snes/drivers/retroarch/raclient.go:98 +0x28 fp=0x140000677d0 sp=0x140000677b0 pc=0x10090e1e8
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000677d0 sp=0x140000677d0 pc=0x100389544
created by sni/devices/snes/drivers/retroarch.NewRAClient in goroutine 1
    /Users/jneen/src/sni/devices/snes/drivers/retroarch/raclient.go:98 +0x130

goroutine 25 [IO wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x14000302430 sp=0x14000302410 pc=0x1003556e8
runtime.netpollblock(0x140003024c8?, 0x3f5b14?, 0x1?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:564 +0x158 fp=0x14000302470 sp=0x14000302430 pc=0x10034ec08
internal/poll.runtime_pollWait(0x1016f7aa0, 0x72)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:343 +0xa0 fp=0x140003024a0 sp=0x14000302470 pc=0x1003832a0
internal/poll.(*pollDesc).wait(0x1400022d200?, 0x100321afc?, 0x0)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28 fp=0x140003024d0 sp=0x140003024a0 pc=0x1003f1178
internal/poll.(*pollDesc).waitRead(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x1400022d200)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_unix.go:611 +0x250 fp=0x14000302580 sp=0x140003024d0 pc=0x1003f5c00
net.(*netFD).accept(0x1400022d200)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/fd_unix.go:172 +0x28 fp=0x14000302640 sp=0x14000302580 pc=0x1004d2278
net.(*TCPListener).accept(0x1400014abc0)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock_posix.go:152 +0x28 fp=0x14000302670 sp=0x14000302640 pc=0x1004e81e8
net.(*TCPListener).AcceptTCP(0x1400014abc0)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock.go:302 +0x2c fp=0x140003026b0 sp=0x14000302670 pc=0x1004e728c
sni/devices/snes/drivers/luabridge.(*Driver).runServer(0x0?, 0x1400014abc0)
    /Users/jneen/src/sni/devices/snes/drivers/luabridge/driver.go:203 +0xf0 fp=0x140003027b0 sp=0x140003026b0 pc=0x1009082f0
sni/devices/snes/drivers/luabridge.(*Driver).StartServer.func2()
    /Users/jneen/src/sni/devices/snes/drivers/luabridge/driver.go:176 +0x2c fp=0x140003027d0 sp=0x140003027b0 pc=0x10090815c
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140003027d0 sp=0x140003027d0 pc=0x100389544
created by sni/devices/snes/drivers/luabridge.(*Driver).StartServer in goroutine 48
    /Users/jneen/src/sni/devices/snes/drivers/luabridge/driver.go:176 +0x160

goroutine 70 [IO wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x1400018d9f0 sp=0x1400018d9d0 pc=0x1003556e8
runtime.netpollblock(0x1400018da88?, 0x3f5b14?, 0x1?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:564 +0x158 fp=0x1400018da30 sp=0x1400018d9f0 pc=0x10034ec08
internal/poll.runtime_pollWait(0x1016f79a8, 0x72)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:343 +0xa0 fp=0x1400018da60 sp=0x1400018da30 pc=0x1003832a0
internal/poll.(*pollDesc).wait(0x140001ba000?, 0x100ba90c0?, 0x0)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28 fp=0x1400018da90 sp=0x1400018da60 pc=0x1003f1178
internal/poll.(*pollDesc).waitRead(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x140001ba000)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_unix.go:611 +0x250 fp=0x1400018db40 sp=0x1400018da90 pc=0x1003f5c00
net.(*netFD).accept(0x140001ba000)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/fd_unix.go:172 +0x28 fp=0x1400018dc00 sp=0x1400018db40 pc=0x1004d2278
net.(*TCPListener).accept(0x140001ac100)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock_posix.go:152 +0x28 fp=0x1400018dc30 sp=0x1400018dc00 pc=0x1004e81e8
net.(*TCPListener).Accept(0x140001ac100)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock.go:315 +0x2c fp=0x1400018dc70 sp=0x1400018dc30 pc=0x1004e73cc
net/http.(*onceCloseListener).Accept(0x100c38d60?)
    <autogenerated>:1 +0x30 fp=0x1400018dc90 sp=0x1400018dc70 pc=0x1005c35c0
net/http.(*Server).Serve(0x140001be000, {0x100c375e0, 0x140001ac100})
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/http/server.go:3056 +0x2b8 fp=0x1400018ddc0 sp=0x1400018dc90 pc=0x1005b44e8
net/http.Serve(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/http/server.go:2595
sni/services/grpcimpl.listenGrpcWeb({0x140001a0200, 0xc}, 0x1400019e1c0)
    /Users/jneen/src/sni/services/grpcimpl/grpc.go:166 +0x234 fp=0x1400018ded0 sp=0x1400018ddc0 pc=0x1009339d4
sni/services/grpcimpl.serveGrpcWeb()
    /Users/jneen/src/sni/services/grpcimpl/grpc.go:130 +0x224 fp=0x1400018dfd0 sp=0x1400018ded0 pc=0x1009332d4
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400018dfd0 sp=0x1400018dfd0 pc=0x100389544
created by sni/services/grpcimpl.StartGrpcServer in goroutine 1
    /Users/jneen/src/sni/services/grpcimpl/grpc.go:49 +0x368

goroutine 71 [IO wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/proc.go:398 +0xc8 fp=0x14000085ab0 sp=0x14000085a90 pc=0x1003556e8
runtime.netpollblock(0x14000085b48?, 0x3f5b14?, 0x1?)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:564 +0x158 fp=0x14000085af0 sp=0x14000085ab0 pc=0x10034ec08
internal/poll.runtime_pollWait(0x1016f77b8, 0x72)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/netpoll.go:343 +0xa0 fp=0x14000085b20 sp=0x14000085af0 pc=0x1003832a0
internal/poll.(*pollDesc).wait(0x140000ac000?, 0x100ba90c0?, 0x0)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28 fp=0x14000085b50 sp=0x14000085b20 pc=0x1003f1178
internal/poll.(*pollDesc).waitRead(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x140000ac000)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/internal/poll/fd_unix.go:611 +0x250 fp=0x14000085c00 sp=0x14000085b50 pc=0x1003f5c00
net.(*netFD).accept(0x140000ac000)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/fd_unix.go:172 +0x28 fp=0x14000085cc0 sp=0x14000085c00 pc=0x1004d2278
net.(*TCPListener).accept(0x1400007a040)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock_posix.go:152 +0x28 fp=0x14000085cf0 sp=0x14000085cc0 pc=0x1004e81e8
net.(*TCPListener).Accept(0x1400007a040)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/tcpsock.go:315 +0x2c fp=0x14000085d30 sp=0x14000085cf0 pc=0x1004e73cc
net/http.(*onceCloseListener).Accept(0x100c38d60?)
    <autogenerated>:1 +0x30 fp=0x14000085d50 sp=0x14000085d30 pc=0x1005c35c0
net/http.(*Server).Serve(0x140000ae000, {0x100c375e0, 0x1400007a040})
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/http/server.go:3056 +0x2b8 fp=0x14000085e80 sp=0x14000085d50 pc=0x1005b44e8
net/http.Serve(...)
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/net/http/server.go:2595
sni/services/usb2snes.listenHttp({0x100981e9c, 0xd})
    /Users/jneen/src/sni/services/usb2snes/usb2snes.go:83 +0x264 fp=0x14000085f90 sp=0x14000085e80 pc=0x100944b94
sni/services/usb2snes.StartHttpServer.func1({0x100981e9c, 0xd})
    /Users/jneen/src/sni/services/usb2snes/usb2snes.go:42 +0x24 fp=0x14000085fb0 sp=0x14000085f90 pc=0x10094dad4
sni/services/usb2snes.StartHttpServer.func3()
    /Users/jneen/src/sni/services/usb2snes/usb2snes.go:44 +0x38 fp=0x14000085fd0 sp=0x14000085fb0 pc=0x100944888
runtime.goexit()
    /opt/homebrew/Cellar/go/1.21.7/libexec/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000085fd0 sp=0x14000085fd0 pc=0x100389544
created by sni/services/usb2snes.StartHttpServer in goroutine 1
    /Users/jneen/src/sni/services/usb2snes/usb2snes.go:40 +0x130

r0      0x19766e2ed
r1      0x0
r2      0x1974175dc
r3      0x197417634
r4      0x14ae0df70
r5      0x14ae0df80
r6      0x14ae0e078
r7      0x60000173dd40
r8      0x600003c11fb8
r9      0x0
r10     0x1d
r11     0x0
r12     0x5
r13     0x14b022980
r14     0x1e32f4600
r15     0x1e32f4600
r16     0xbad4007
r17     0x1ec373568
r18     0x0
r19     0x14ae0df80
r20     0x1e7e0a428
r21     0x14ae0e078
r22     0x60000023af00
r23     0x60000173dd00
r24     0x60000173dd00
r25     0x60000173dd40
r26     0x100c2c050
r27     0x0
r28     0x504e4720
r29     0x171b0aac0
lr      0x1973aba54
sp      0x171b0a710
pc      0xbad4007
fault   0xbad4007

Thanks for your help!

jneen

JamesDunne commented 7 months ago

Cannot reproduce.

$ uname -a
Darwin LYW3C3G6TD 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov  7 21:40:08 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_ARM64_T6000 arm64

Looks like you're on a newer MacOS version than me. I'll have to test again when I'm able to upgrade next.

For now, you can try to comment out the call to systray.SetIcon() to see if that resolves your issue.

JamesDunne commented 7 months ago

You can also try go build -tags notray ./cmd/sni to build without systray support.

jneen commented 7 months ago

Thanks, I'll try this!