g10k is affected by gosuri/uilive#44, causing it to hang indefinitely on macOS on arm64 when it calls os.Exit.
$ timeout -v 3 go run . -version
g10k Build time: UTC
timeout: sending signal TERM to command ‘go’
interestingly this does not happen if an amd64 binary is executed via Rosetta:
$ GOARCH=amd64 timeout -v 3 go run . -version
g10k Build time: UTC
It can also be fixed by downgrading uilive to 0.0.3:
$ go get github.com/gosuri/uilive@v0.0.3
go: downgraded github.com/gosuri/uilive v0.0.4 => v0.0.3
$ go mod vendor
$ timeout -v 3 go run . -version
g10k Build time: UTC
Since uilive has not been updated in years, I would recommend replacing it entirely. I'm not sure what it's used for.
For reference, this is the stack trace of all goroutines I get when triggering a SIGQUIT:
$ go run . -version
g10k Build time: UTC
^\SIGQUIT: quit
PC=0x1988384f8 m=0 sigcode=0
goroutine 0 gp=0x1031b82c0 m=0 mp=0x1031b8e80 [idle]:
runtime.pthread_cond_wait(0x1031b93e8, 0x1031b93a8)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/sys_darwin.go:488 +0x20 fp=0x16d2ae9e0 sp=0x16d2ae9b0 pc=0x102bb2460
runtime.semasleep(0xffffffffffffffff)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/os_darwin.go:77 +0x80 fp=0x16d2aea40 sp=0x16d2ae9e0 pc=0x102b8f850
runtime.notesleep(0x1031b8fd8)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/lock_sema.go:62 +0x80 fp=0x16d2aea70 sp=0x16d2aea40 pc=0x102b68050
runtime.mPark(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:1967
runtime.stopm()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:3008 +0x84 fp=0x16d2aeaa0 sp=0x16d2aea70 pc=0x102b997f4
runtime.findRunnable()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:3796 +0xda4 fp=0x16d2aec70 sp=0x16d2aeaa0 pc=0x102b9b2a4
runtime.schedule()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:4164 +0x90 fp=0x16d2aecb0 sp=0x16d2aec70 pc=0x102b9c500
runtime.goschedImpl(0x6b4ddc9dc1e0, 0x0)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:4345 +0x21c fp=0x16d2aed10 sp=0x16d2aecb0 pc=0x102b9cbcc
runtime.gosched_m(0xd00?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:4350 +0x20 fp=0x16d2aed30 sp=0x16d2aed10 pc=0x102b9cd10
runtime.mcall()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:339 +0x54 fp=0x16d2aed40 sp=0x16d2aed30 pc=0x102bca934
goroutine 1 gp=0x6b4ddc9dc1e0 m=nil [runnable]:
runtime.Gosched()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:391 +0x18 fp=0x6b4ddcaf9570 sp=0x6b4ddcaf9550 pc=0x102b95298
internal/runtime/exithook.Run(0x0)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/internal/runtime/exithook/hooks.go:61 +0x3c fp=0x6b4ddcaf95d0 sp=0x6b4ddcaf9570 pc=0x102b5fe2c
runtime.runExitHooks(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:358
os.runtime_beforeExit(0x6b4ddcab04e0?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:340 +0x20 fp=0x6b4ddcaf95f0 sp=0x6b4ddcaf95d0 pc=0x102bc57e0
os.Exit(0x0)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/os/proc.go:75 +0x30 fp=0x6b4ddcaf9610 sp=0x6b4ddcaf95f0 pc=0x102c0c9c0
main.main()
/Users/Max/Downloads/g10k/g10k.go:259 +0x918 fp=0x6b4ddcaf9f30 sp=0x6b4ddcaf9610 pc=0x102dc7498
runtime.main()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:290 +0x2b4 fp=0x6b4ddcaf9fd0 sp=0x6b4ddcaf9f30 pc=0x102b94f14
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddcaf9fd0 sp=0x6b4ddcaf9fd0 pc=0x102bcc9e4
goroutine 2 gp=0x6b4ddc9dc780 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:462 +0xbc fp=0x6b4ddca2af90 sp=0x6b4ddca2af70 pc=0x102bc58bc
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:468
runtime.forcegchelper()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:375 +0xb4 fp=0x6b4ddca2afd0 sp=0x6b4ddca2af90 pc=0x102b95234
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddca2afd0 sp=0x6b4ddca2afd0 pc=0x102bcc9e4
created by runtime.init.7 in goroutine 1
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:363 +0x24
goroutine 3 gp=0x6b4ddc9dcd20 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:462 +0xbc fp=0x6b4ddca2b770 sp=0x6b4ddca2b750 pc=0x102bc58bc
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:468
runtime.bgsweep(0x6b4ddca42000)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgcsweep.go:279 +0x9c fp=0x6b4ddca2b7b0 sp=0x6b4ddca2b770 pc=0x102b80e7c
runtime.gcenable.gowrap1()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgc.go:214 +0x20 fp=0x6b4ddca2b7d0 sp=0x6b4ddca2b7b0 pc=0x102b73110
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddca2b7d0 sp=0x6b4ddca2b7d0 pc=0x102bcc9e4
created by runtime.gcenable in goroutine 1
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgc.go:214 +0x6c
goroutine 4 gp=0x6b4ddc9dcf00 m=nil [GC scavenge wait]:
runtime.gopark(0x6b4ddca42000?, 0x102e39b18?, 0x1?, 0x0?, 0x6b4ddc9dcf00?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:462 +0xbc fp=0x6b4ddca2bf60 sp=0x6b4ddca2bf40 pc=0x102bc58bc
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:468
runtime.(*scavengerState).park(0x1031b7dc0)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgcscavenge.go:425 +0x5c fp=0x6b4ddca2bf90 sp=0x6b4ddca2bf60 pc=0x102b7ec4c
runtime.bgscavenge(0x6b4ddca42000)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgcscavenge.go:653 +0x44 fp=0x6b4ddca2bfb0 sp=0x6b4ddca2bf90 pc=0x102b7f184
runtime.gcenable.gowrap2()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgc.go:215 +0x20 fp=0x6b4ddca2bfd0 sp=0x6b4ddca2bfb0 pc=0x102b730d0
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddca2bfd0 sp=0x6b4ddca2bfd0 pc=0x102bcc9e4
created by runtime.gcenable in goroutine 1
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mgc.go:215 +0xac
goroutine 17 gp=0x6b4ddca843c0 m=nil [GOMAXPROCS updater (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:462 +0xbc fp=0x6b4ddca26770 sp=0x6b4ddca26750 pc=0x102bc58bc
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:468
runtime.updateMaxProcsGoroutine()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:7095 +0xf4 fp=0x6b4ddca267d0 sp=0x6b4ddca26770 pc=0x102ba2c74
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddca267d0 sp=0x6b4ddca267d0 pc=0x102bcc9e4
created by runtime.defaultGOMAXPROCSUpdateEnable in goroutine 1
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:7083 +0x48
goroutine 18 gp=0x6b4ddca845a0 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0xb8?, 0xa5?, 0x102bc6494?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:462 +0xbc fp=0x6b4ddca2a580 sp=0x6b4ddca2a560 pc=0x102bc58bc
runtime.runFinalizers()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mfinal.go:210 +0x100 fp=0x6b4ddca2a7d0 sp=0x6b4ddca2a580 pc=0x102b72180
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddca2a7d0 sp=0x6b4ddca2a7d0 pc=0x102bcc9e4
created by runtime.createfing in goroutine 1
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mfinal.go:172 +0x4c
goroutine 19 gp=0x6b4ddca84780 m=nil [cleanup wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:462 +0xbc fp=0x6b4ddca26f40 sp=0x6b4ddca26f20 pc=0x102bc58bc
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/proc.go:468
runtime.(*cleanupQueue).dequeue(0x1031b8100)
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mcleanup.go:522 +0xfc fp=0x6b4ddca26f90 sp=0x6b4ddca26f40 pc=0x102b6f45c
runtime.runCleanups()
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mcleanup.go:718 +0x54 fp=0x6b4ddca26fd0 sp=0x6b4ddca26f90 pc=0x102b6fb24
runtime.goexit({})
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/asm_arm64.s:1447 +0x4 fp=0x6b4ddca26fd0 sp=0x6b4ddca26fd0 pc=0x102bcc9e4
created by runtime.(*cleanupQueue).createGs in goroutine 1
/opt/homebrew/Cellar/go/1.26.1/libexec/src/runtime/mcleanup.go:672 +0xcc
r0 0x104
r1 0x0
r2 0x1259800
r3 0x0
r4 0x0
r5 0xa0
r6 0x0
r7 0x0
r8 0x16d2ae8c8
r9 0x0
r10 0x8c00
r11 0x8c0000008c02
r12 0x8c0000008c02
r13 0x8c00
r14 0x0
r15 0x8c0000008c00
r16 0x131
r17 0x2060fcf78
r18 0x0
r19 0x1031b93a8
r20 0x1031b93e8
r21 0x204b3b1e0
r22 0x0
r23 0x0
r24 0x1259800
r25 0x1259801
r26 0x1259900
r27 0x1031a5000
r28 0x1031b82c0
r29 0x16d2ae940
lr 0x1988780dc
sp 0x16d2ae8b0
pc 0x1988384f8
fault 0x1988384f8
exit status 2
g10k is affected by gosuri/uilive#44, causing it to hang indefinitely on macOS on arm64 when it calls os.Exit.
interestingly this does not happen if an amd64 binary is executed via Rosetta:
It can also be fixed by downgrading uilive to 0.0.3:
Since uilive has not been updated in years, I would recommend replacing it entirely. I'm not sure what it's used for.
For reference, this is the stack trace of all goroutines I get when triggering a SIGQUIT: