core: Occasional cgo crashing on app startup on macOS
Describe the bug
When starting an app on macOS, it occasionally crashes during cgo execution. This seems to have started happening relatively recently.
How to reproduce
Run the docs many times on macOS until they crash.
Example code
No response
Relevant output
SIGSEGV: segmentation violation
PC=0x1080b28a4 m=0 sigcode=2 addr=0x0
signal arrived during cgo execution
goroutine 1 gp=0x140000021c0 m=0 mp=0x106d09e20 [syscall, locked to thread]:
runtime.cgocall(0x1056fc848, 0x1400004d1a8)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/cgocall.go:157 +0x44 fp=0x1400004d160 sp=0x1400004d120 pc=0x1048c3274
github.com/goki/vulkan._Cfunc_callVkCreateGraphicsPipelines(0x15906a218, 0x15672e660, 0x1, 0x15672e700, 0x0, 0x14013378b10)
_cgo_gotypes.go:8402 +0x34 fp=0x1400004d1a0 sp=0x1400004d160 pc=0x104bd9a94
github.com/goki/vulkan.CreateGraphicsPipelines.func1(0x15906a218, 0x15672e660, 0x1, 0x15672e700, 0x0, 0x14013378b10)
/Users/kaioreilly/go/pkg/mod/github.com/goki/vulkan@v1.0.7/vulkan.go:643 +0xe8 fp=0x1400004d200 sp=0x1400004d1a0 pc=0x104c05d98
github.com/goki/vulkan.CreateGraphicsPipelines(0x15906a218, 0x15672e660, 0x1, {0x1400004d478, 0x1, 0x0?}, 0x0, {0x14013378b10, 0x1, 0x1})
/Users/kaioreilly/go/pkg/mod/github.com/goki/vulkan@v1.0.7/vulkan.go:643 +0x84 fp=0x1400004d340 sp=0x1400004d200 pc=0x104c05ae4
cogentcore.org/core/vgpu.(*Pipeline).Config(0x14011070800, 0x88?)
/Users/kaioreilly/cogent/core/vgpu/pipeline.go:197 +0x470 fp=0x1400004d540 sp=0x1400004d340 pc=0x104c38580
cogentcore.org/core/vgpu.(*System).Config(0x14012cfb208)
/Users/kaioreilly/cogent/core/vgpu/system.go:283 +0x100 fp=0x1400004d5c0 sp=0x1400004d540 pc=0x104c3ea80
cogentcore.org/core/vgpu/vdraw.(*Drawer).ConfigSys(0x14012cfb208)
/Users/kaioreilly/cogent/core/vgpu/vdraw/config.go:106 +0x7bc fp=0x1400004d750 sp=0x1400004d5c0 pc=0x104c4db1c
cogentcore.org/core/vgpu/vdraw.(*Drawer).ConfigSurface(0x14012cfb208, 0x14012cb2b00, 0x0?)
/Users/kaioreilly/cogent/core/vgpu/vdraw/vdraw.go:53 +0x9c fp=0x1400004d790 sp=0x1400004d750 pc=0x104c501cc
cogentcore.org/core/system/driver/desktop.(*App).NewWindow.func2()
/Users/kaioreilly/cogent/core/system/driver/desktop/app.go:139 +0xbc fp=0x1400004d7e0 sp=0x1400004d790 pc=0x104d89e0c
cogentcore.org/core/system/driver/base.(*App).RunOnMain(0x140003c86c0?, 0x106d07200?)
/Users/kaioreilly/cogent/core/system/driver/base/app.go:90 +0xac fp=0x1400004d820 sp=0x1400004d7e0 pc=0x104bd71dc
cogentcore.org/core/system/driver/desktop.(*App).NewWindow(0x106d07200, 0x140003c86c0?)
/Users/kaioreilly/cogent/core/system/driver/desktop/app.go:135 +0x3cc fp=0x1400004db70 sp=0x1400004d820 pc=0x104d8964c
cogentcore.org/core/core.newRenderWindow({0x140000bf530, 0x22}, {0x105727282, 0x10}, 0x140003c86c0)
/Users/kaioreilly/cogent/core/core/renderwindow.go:108 +0xa0 fp=0x1400004dbd0 sp=0x1400004db70 pc=0x104f54c80
cogentcore.org/core/core.(*Stage).newRenderWindow(0x14000240960)
/Users/kaioreilly/cogent/core/core/mainstage.go:348 +0x1e0 fp=0x1400004dc70 sp=0x1400004dbd0 pc=0x104f4e1b0
cogentcore.org/core/core.(*Stage).runWindow(0x14000240960)
/Users/kaioreilly/cogent/core/core/mainstage.go:226 +0x620 fp=0x1400004dd30 sp=0x1400004dc70 pc=0x104f4d8c0
cogentcore.org/core/core.(*Stage).run(0x14000240960?)
/Users/kaioreilly/cogent/core/core/stage.go:280 +0x8c fp=0x1400004dd60 sp=0x1400004dd30 pc=0x104f6784c
cogentcore.org/core/core.(*Stage).Run(0x14000000000?)
/Users/kaioreilly/cogent/core/core/stage.go:259 +0x8c fp=0x1400004dd90 sp=0x1400004dd60 pc=0x104f6770c
cogentcore.org/core/core.(*Body).RunWindow(0x1?)
/Users/kaioreilly/cogent/core/core/mainstage.go:69 +0x34 fp=0x1400004ddb0 sp=0x1400004dd90 pc=0x104f4c914
cogentcore.org/core/core.(*Body).RunMainWindow(0x105fc2520?)
/Users/kaioreilly/cogent/core/core/mainstage.go:59 +0x134 fp=0x1400004de10 sp=0x1400004ddb0 pc=0x104f4c7b4
main.main()
/Users/kaioreilly/cogent/core/docs/docs.go:123 +0x73c fp=0x1400004df40 sp=0x1400004de10 pc=0x1056db2ac
runtime.main()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:271 +0x28c fp=0x1400004dfd0 sp=0x1400004df40 pc=0x1048fa57c
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x1400004dfd0 sp=0x1400004dfd0 pc=0x104930bc4
goroutine 2 gp=0x14000002c40 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000074f90 sp=0x14000074f70 pc=0x1048fa9a8
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:408
runtime.forcegchelper()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:326 +0xb8 fp=0x14000074fd0 sp=0x14000074f90 pc=0x1048fa838
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000074fd0 sp=0x14000074fd0 pc=0x104930bc4
created by runtime.init.6 in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:314 +0x24
goroutine 18 gp=0x14000104380 m=nil [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000070760 sp=0x14000070740 pc=0x1048fa9a8
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:408
runtime.bgsweep(0x14000110000)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgcsweep.go:318 +0x108 fp=0x140000707b0 sp=0x14000070760 pc=0x1048e5638
runtime.gcenable.gowrap1()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:203 +0x28 fp=0x140000707d0 sp=0x140000707b0 pc=0x1048d97d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140000707d0 sp=0x140000707d0 pc=0x104930bc4
created by runtime.gcenable in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:203 +0x6c
goroutine 19 gp=0x14000104540 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0x105e926e8?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000070f60 sp=0x14000070f40 pc=0x1048fa9a8
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:408
runtime.(*scavengerState).park(0x106d06fc0)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgcscavenge.go:425 +0x5c fp=0x14000070f90 sp=0x14000070f60 pc=0x1048e2fbc
runtime.bgscavenge(0x14000110000)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgcscavenge.go:658 +0xac fp=0x14000070fb0 sp=0x14000070f90 pc=0x1048e357c
runtime.gcenable.gowrap2()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:204 +0x28 fp=0x14000070fd0 sp=0x14000070fb0 pc=0x1048d9778
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000070fd0 sp=0x14000070fd0 pc=0x104930bc4
created by runtime.gcenable in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:204 +0xac
goroutine 20 gp=0x14000104a80 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x1401307f3a0?, 0x20?, 0x40?, 0x1000000010?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000088d80 sp=0x14000088d60 pc=0x1048fa9a8
runtime.runfinq()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mfinal.go:194 +0x108 fp=0x14000088fd0 sp=0x14000088d80 pc=0x1048d88a8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000088fd0 sp=0x14000088fd0 pc=0x104930bc4
created by runtime.createfing in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mfinal.go:164 +0x80
goroutine 21 gp=0x14000104e00 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000071730 sp=0x14000071710 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x140000717d0 sp=0x14000071730 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140000717d0 sp=0x140000717d0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 34 gp=0x1400048e000 m=nil [GC worker (idle)]:
runtime.gopark(0x106d75660?, 0x1?, 0xdf?, 0xbe?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000494730 sp=0x14000494710 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x140004947d0 sp=0x14000494730 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140004947d0 sp=0x140004947d0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 3 gp=0x14000003500 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99eec4ce?, 0x3?, 0xac?, 0xe8?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000075730 sp=0x14000075710 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x140000757d0 sp=0x14000075730 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140000757d0 sp=0x140000757d0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 35 gp=0x1400048e1c0 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99df9764?, 0x3?, 0xea?, 0x5d?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000494f30 sp=0x14000494f10 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x14000494fd0 sp=0x14000494f30 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000494fd0 sp=0x14000494fd0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 4 gp=0x140000036c0 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99eebd7b?, 0x1?, 0x7c?, 0xda?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000075f30 sp=0x14000075f10 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x14000075fd0 sp=0x14000075f30 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000075fd0 sp=0x14000075fd0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 36 gp=0x1400048e380 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99f04a4b?, 0x1?, 0x6a?, 0xc9?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000495730 sp=0x14000495710 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x140004957d0 sp=0x14000495730 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140004957d0 sp=0x140004957d0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 5 gp=0x14000003880 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99eec47b?, 0x1?, 0x93?, 0x2e?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000076730 sp=0x14000076710 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x140000767d0 sp=0x14000076730 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140000767d0 sp=0x140000767d0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 37 gp=0x1400048e540 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99f04a21?, 0x3?, 0x83?, 0x29?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000495f30 sp=0x14000495f10 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x14000495fd0 sp=0x14000495f30 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000495fd0 sp=0x14000495fd0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 38 gp=0x1400048e700 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99ef3328?, 0x3?, 0x37?, 0x99?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000496730 sp=0x14000496710 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x140004967d0 sp=0x14000496730 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x140004967d0 sp=0x140004967d0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 6 gp=0x14000003a40 m=nil [GC worker (idle)]:
runtime.gopark(0x3b4f99f044ec?, 0x3?, 0x38?, 0x5b?, 0x0?)
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/proc.go:402 +0xc8 fp=0x14000076f30 sp=0x14000076f10 pc=0x1048fa9a8
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1310 +0xd8 fp=0x14000076fd0 sp=0x14000076f30 pc=0x1048db8d8
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x14000076fd0 sp=0x14000076fd0 pc=0x104930bc4
created by runtime.gcBgMarkStartWorkers in goroutine 1
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/mgc.go:1234 +0x28
goroutine 12 gp=0x14000584fc0 m=nil [runnable]:
runtime.mapaccess1_faststr(0x105fca900, 0x14003212000, {0x14000294d20, 0x8})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/map_faststr.go:13 +0x3d4 fp=0x1400008fec0 sp=0x1400008fec0 pc=0x1048d2354
cogentcore.org/core/spell.(*Model).createSuggestKeys(0x14000260280, {0x14003350a99, 0x9})
/Users/kaioreilly/cogent/core/spell/model.go:115 +0x78 fp=0x1400008ff60 sp=0x1400008fec0 pc=0x105147b98
cogentcore.org/core/spell.(*Model).addSuggestionsForWords(0x14000260280, {0x14003542000, 0x7fc0, 0x0?})
/Users/kaioreilly/cogent/core/spell/model.go:68 +0x60 fp=0x1400008ffa0 sp=0x1400008ff60 pc=0x105147650
cogentcore.org/core/spell.(*Model).SetDicts.gowrap1()
/Users/kaioreilly/cogent/core/spell/model.go:60 +0x34 fp=0x1400008ffd0 sp=0x1400008ffa0 pc=0x1051475b4
runtime.goexit({})
/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/asm_arm64.s:1222 +0x4 fp=0x1400008ffd0 sp=0x1400008ffd0 pc=0x104930bc4
created by cogentcore.org/core/spell.(*Model).SetDicts in goroutine 1
/Users/kaioreilly/cogent/core/spell/model.go:60 +0x13c
r0 0x1
r1 0x107257200
r2 0x15672ee60
r3 0x2a
r4 0x52204000
r5 0x2a
r6 0x0
r7 0x19796bd7
r8 0x1
r9 0x15987e628
r10 0x179f41
r11 0xcd0d0
r12 0x156703fcc
r13 0x29
r14 0x156700000
r15 0xa0008000
r16 0xd79600010724c080
r17 0x0
r18 0x0
r19 0x15987e200
r20 0x15672e700
r21 0x15987b5a0
r22 0x15987e628
r23 0x15987e628
r24 0x15672e790
r25 0x0
r26 0x0
r27 0x0
r28 0x0
r29 0x16b547190
lr 0x1080b2878
sp 0x16b5429a0
pc 0x1080b28a4
fault 0x0
Platform
macOS
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (10 by maintainers)
@glycerine thanks for the tips on signal handlers – I was not aware of any of those constraints wrt cgo, and I’m not sure if the vulkan wrapper folks did any of the necessary steps – it is an abandonware package that I got working…