ebiten icon indicating copy to clipboard operation
ebiten copied to clipboard

crash with -race on macOS

Open hajimehoshi opened this issue 2 years ago • 3 comments

Reported by @mikenye at https://github.com/plane-watch/pw-slippymap/commit/5182463952d10dae78eda3e8956fed4426df0bc0#commitcomment-72461124

go run -race main.go --aircraftpburl http://192.168.1.1:8079/data/aircraft.pb
2022-04-29 11:58:45.301 main[93268:5315135] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1677.104/Foundation/Misc.subproj/NSUndoManager.m:363
2022-04-29 11:58:45.303 main[93268:5315135] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff34285b57 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff6d2055bf objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff342aed08 +[NSException raise:format:arguments:] + 88
	3   Foundation                          0x00007fff369a0e9d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
	4   Foundation                          0x00007fff368dd5ee +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 440
	5   AppKit                              0x00007fff3146a65c -[NSApplication run] + 864
	6   main                                0x000000000466cb86 _glfwPlatformPostEmptyEvent + 54
	7   main                                0x0000000004069b84 runtime.asmcgocall.abi0 + 100
)
libc++abi.dylib: terminating with uncaught exception of type NSException
SIGABRT: abort
PC=0x7fff6e4f533a m=8 sigcode=0
signal arrived during cgo execution

goroutine 14 [syscall]:
runtime.cgocall(0x46773f0, 0xc000dd3d00)
	/usr/local/go/src/runtime/cgocall.go:157 +0x6e fp=0xc000dd3cd8 sp=0xc000dd3ca0 pc=0x400876e
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwPostEmptyEvent()
	_cgo_gotypes.go:1489 +0x79 fp=0xc000dd3d00 sp=0xc000dd3cd8 pc=0x425a179
github.com/go-gl/glfw/v3.3/glfw.PostEmptyEvent()
	/Users/mikenye/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/window.go:1021 +0x25 fp=0xc000dd3d38 sp=0xc000dd3d00 pc=0x4263065
github.com/hajimehoshi/ebiten/v2/internal/glfw.PostEmptyEvent(...)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/glfw/glfw_notwindows.go:333
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).ScheduleFrame(0x5a18600)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:563 +0x3f fp=0xc000dd3d50 sp=0xc000dd3d38 pc=0x42ba39f
github.com/hajimehoshi/ebiten/v2.ScheduleFrame()
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/run.go:412 +0x38 fp=0xc000dd3d68 sp=0xc000dd3d50 pc=0x42cec98
runtime.deferreturn()
	/usr/local/go/src/runtime/panic.go:436 +0x33 fp=0xc000dd3da8 sp=0xc000dd3d68 pc=0x4037773
pw_slippymap/datasources.(*AircraftDB).SetCallsign(0xc000594018, 0xc9f?, {0xc000de0438, 0x8})
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/datasources/aircraftdb.go:124 +0x1fb fp=0xc000dd3e98 sp=0xc000dd3da8 pc=0x46171db
pw_slippymap/datasources.ReadsbProtobuf({0x7ffeefbffaca, 0x2a}, 0x0?)
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/datasources/readsb.go:59 +0x645 fp=0xc000dd3fa0 sp=0xc000dd3e98 pc=0x4619465
main.main.func2()
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/main.go:393 +0x59 fp=0xc000dd3fe0 sp=0xc000dd3fa0 pc=0x4661b39
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc000dd3fe8 sp=0xc000dd3fe0 pc=0x4069ea1
created by main.main
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/main.go:393 +0x62b

hajimehoshi avatar Apr 29 '22 08:04 hajimehoshi

@mikenye Thank you for reporting! I'm trying to reproduce this issue but failed.

  • I was using the for_hajimehoshi branch.
  • Is the URL http://192.168.1.1:8079 correct? This seems a local server.

hajimehoshi avatar Apr 29 '22 09:04 hajimehoshi

  • Is the URL http://192.168.1.1:8079 correct? This seems a local server.

Yes it is a local server, I'll set up a server that you're able to access and message you on Discord.

mikenye avatar Apr 29 '22 09:04 mikenye

I've had a few more instances of this as I work on the main branch.

$ go run -race main.go --aircraftpburl http://192.168.69.35:8079/data/aircraft.pb
2022/05/03 18:04:26 readsb database version: 298
2022/05/03 18:04:26 Pre-rendering marker: PC12 (PILATUS PC-12)
2022/05/03 18:04:26 Pre-rendering marker: RV9 (VAN'S RV-9)
2022/05/03 18:04:26 Pre-rendering marker: B738 (BOEING 737-800)
2022/05/03 18:04:26 Pre-rendering marker: A388 (AIRBUS A-380-800)
2022/05/03 18:04:26 Pre-rendering marker: B77L (BOEING 777-200ER)
2022/05/03 18:04:26 Pre-rendering marker: E190 (EMBRAER ERJ-190-100)
2022/05/03 18:04:26 Pre-rendering marker: F100 (FOKKER 100)
2022/05/03 18:04:26 Pre-rendering marker: B412 (BELL 412)
2022/05/03 18:04:26 Pre-rendering marker: B788 (BOEING 787-8 Dreamliner)
2022/05/03 18:04:26 Pre-rendering marker: A320 (AIRBUS A-320)
2022/05/03 18:04:26 Pre-rendering marker: DH8D (DE HAVILLAND CANADA DHC-8-400 Dash 8)
2022/05/03 18:04:26 Pre-rendering marker: B77W (BOEING 777-300ER)
2022/05/03 18:04:26 Pre-rendering marker: SW3 (SWEARINGEN Merlin 3)
2022/05/03 18:04:26 Pre-rendering marker: SF34 (SAAB-FAIRCHILD SF-340)
2022/05/03 18:04:26 Pre-rendering marker: HAWK (BAE SYSTEMS T-45 Goshawk)
2022/05/03 18:04:26 Pre-rendering finished, building Marker map
2022/05/03 18:04:26 Directory '/Users/mikenye/.plane.watch' already exists, not creating
2022/05/03 18:04:26 Directory '/Users/mikenye/.plane.watch/tilecache' already exists, not creating
2022/05/03 18:04:26 Initialising SlippyMap at -31.9523/115.8613, zoom level 9
2022/05/03 18:04:26 Datasource: readsb-protobuf at url: http://192.168.69.35:8079/data/aircraft.pb
2022/05/03 18:04:26 Starting UI
2022-05-03 18:04:26.360 main[50019:7082968] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1677.104/Foundation/Misc.subproj/NSUndoManager.m:363
2022-05-03 18:04:26.365 main[50019:7082968] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff34285b57 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff6d2055bf objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff342aed08 +[NSException raise:format:arguments:] + 88
	3   Foundation                          0x00007fff369a0e9d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
	4   Foundation                          0x00007fff368dd5ee +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 440
	5   AppKit                              0x00007fff3146a65c -[NSApplication run] + 864
	6   main                                0x00000000046562c6 _glfwPlatformPostEmptyEvent + 54
	7   main                                0x0000000004068484 runtime.asmcgocall.abi0 + 100
)
libc++abi.dylib: terminating with uncaught exception of type NSException
SIGABRT: abort
PC=0x7fff6e4f533a m=11 sigcode=0
signal arrived during cgo execution

goroutine 75 [syscall]:
runtime.cgocall(0x4660b30, 0xc004da9d00)
	/usr/local/go/src/runtime/cgocall.go:157 +0x6e fp=0xc004da9cd8 sp=0xc004da9ca0 pc=0x400706e
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwPostEmptyEvent()
	_cgo_gotypes.go:1489 +0x79 fp=0xc004da9d00 sp=0xc004da9cd8 pc=0x4235cb9
github.com/go-gl/glfw/v3.3/glfw.PostEmptyEvent()
	/Users/mikenye/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/window.go:1021 +0x25 fp=0xc004da9d38 sp=0xc004da9d00 pc=0x423eba5
github.com/hajimehoshi/ebiten/v2/internal/glfw.PostEmptyEvent(...)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/glfw/glfw_notwindows.go:333
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).ScheduleFrame(0x5f022e0)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:563 +0x3f fp=0xc004da9d50 sp=0xc004da9d38 pc=0x42960bf
github.com/hajimehoshi/ebiten/v2.ScheduleFrame()
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/run.go:412 +0x38 fp=0xc004da9d68 sp=0xc004da9d50 pc=0x42aa9b8
runtime.deferreturn()
	/usr/local/go/src/runtime/panic.go:436 +0x33 fp=0xc004da9da8 sp=0xc004da9d68 pc=0x4036073
pw_slippymap/datasources.(*AircraftDB).SetCallsign(0xc00000e348, 0xd16?, {0xc0048ee3b8, 0x8})
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/datasources/aircraftdb.go:81 +0x1fb fp=0xc004da9e98 sp=0xc004da9da8 pc=0x45f69fb
pw_slippymap/datasources.ReadsbProtobuf({0x7ffeefbffaca, 0x2a}, 0xa3c?)
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/datasources/readsb.go:59 +0x645 fp=0xc004da9fa0 sp=0xc004da9e98 pc=0x45f83a5
main.main.func1()
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/main.go:449 +0x59 fp=0xc004da9fe0 sp=0xc004da9fa0 pc=0x464b2f9
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc004da9fe8 sp=0xc004da9fe0 pc=0x40687a1
created by main.main
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/main.go:449 +0x4a6

goroutine 1 [syscall, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwCreateWindow(0x480, 0x2d0, 0x2eb08460, 0x0, 0x0)
	_cgo_gotypes.go:674 +0x85
github.com/go-gl/glfw/v3.3/glfw.CreateWindow.func2(0x480, 0x2d0, 0x40cfbdf?, 0x0, 0x0)
	/Users/mikenye/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/window.go:348 +0xac
github.com/go-gl/glfw/v3.3/glfw.CreateWindow(0x6953e30?, 0x6953e30?, {0x0, 0x0}, 0x0, 0x0)
	/Users/mikenye/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/window.go:348 +0x11c
github.com/hajimehoshi/ebiten/v2/internal/glfw.CreateWindow(0x40486f5?, 0x466c620?, {0x0, 0x0}, 0x0, 0x0)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/glfw/glfw_notwindows.go:265 +0xc5
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).createWindow(0x5f022e0, 0xf?, 0x4009da0?)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:659 +0x90
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).init(0x5f022e0)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:884 +0x2cf
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).Run.func1.1()
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run_notsinglethread.go:40 +0x3e
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop.func1(0xc0002b22e8, 0xc0066e60c0)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:54 +0x6e
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop(0xc0002b22e8)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:55 +0x4f
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).Run(0x5f022e0, {0x4ae4460?, 0xc0002b22d0})
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run_notsinglethread.go:53 +0x3f3
github.com/hajimehoshi/ebiten/v2.RunGame({0x4ae3e38?, 0xc0064e2120})
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/run.go:191 +0x205
main.main()
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/main.go:473 +0x799

goroutine 5 [sleep]:
time.Sleep(0x3b9aca00)
	/usr/local/go/src/runtime/time.go:194 +0x12e
pw_slippymap/datasources.(*AircraftDB).forgetter(0xc00000e348)
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/datasources/aircraftdb.go:126 +0x48
created by pw_slippymap/datasources.NewAircraftDB
	/Users/mikenye/Development/github.com/plane-watch/pw-slippymap/datasources/aircraftdb.go:152 +0x117

goroutine 115 [select]:
net/http.(*persistConn).writeLoop(0xc0003f4240)
	/usr/local/go/src/net/http/transport.go:2392 +0x1a5
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:1751 +0x2556

goroutine 114 [IO wait]:
internal/poll.runtime_pollWait(0xc6f0540, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc007530198, 0xc004a98000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0xbd
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc007530180, {0xc004a98000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x415
net.(*netFD).Read(0xc007530180, {0xc004a98000, 0x1000, 0x1000})
	/usr/local/go/src/net/fd_posix.go:55 +0x51
net.(*conn).Read(0xc000136080, {0xc004a98000, 0x1000, 0x1000})
	/usr/local/go/src/net/net.go:183 +0xb1
net/http.(*persistConn).Read(0xc0003f4240, {0xc004a98000, 0x1000, 0x1000})
	/usr/local/go/src/net/http/transport.go:1929 +0x110
bufio.(*Reader).fill(0xc000138300)
	/usr/local/go/src/bufio/bufio.go:106 +0x294
bufio.(*Reader).Peek(0xc000138300, 0x1)
	/usr/local/go/src/bufio/bufio.go:144 +0xcc
net/http.(*persistConn).readLoop(0xc0003f4240)
	/usr/local/go/src/net/http/transport.go:2093 +0x2bc
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:1750 +0x24c5

goroutine 76 [chan receive]:
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Call(0xc0002b22e8, 0xc0066e60c0)
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:74 +0x6e
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).Run.func1()
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run_notsinglethread.go:39 +0x257
created by github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).Run
	/Users/mikenye/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run_notsinglethread.go:33 +0x3bb

rax    0x0
rbx    0x70000d2f2000
rcx    0x70000d2f0588
rdx    0x0
rdi    0x9603
rsi    0x6
rbp    0x70000d2f05b0
rsp    0x70000d2f0588
r8     0x70000d2f0450
r9     0x70000d2f0620
r10    0x70000d2f2000
r11    0x246
r12    0x9603
r13    0x3000000008
r14    0x6
r15    0x16
rip    0x7fff6e4f533a
rflags 0x246
cs     0x7
fs     0x0
gs     0x0
exit status 2

mikenye avatar May 03 '22 10:05 mikenye