mroth / scmpuff

:1234: Numeric file shortcuts for common git commands
https://mroth.github.io/scmpuff/
MIT License
384 stars 22 forks source link

Constantly getting Go stack trace errors #23

Closed milesj closed 7 years ago

milesj commented 8 years ago

No matter what commands I run, I randomly get Go stack traces like the following:

[15:58:34] miles_johnson:lux > gcm "Commit message"
failed MSpanList_Insert 0x444000 0xa24e9024f6cd 0x0 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x28cf90, 0x10)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:530 +0x90 fp=0x7fff5fbff050 sp=0x7fff5fbff038
runtime.(*mSpanList).insert(0x3a8928, 0x444000)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:933 +0x293 fp=0x7fff5fbff080 sp=0x7fff5fbff050
runtime.(*mheap).freeSpanLocked(0x3a8120, 0x444000, 0x100, 0x0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:809 +0x4be fp=0x7fff5fbff0e8 sp=0x7fff5fbff080
runtime.(*mheap).grow(0x3a8120, 0x8, 0x0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:675 +0x2a0 fp=0x7fff5fbff140 sp=0x7fff5fbff0e8
runtime.(*mheap).allocSpanLocked(0x3a8120, 0x1, 0x0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:553 +0x4e3 fp=0x7fff5fbff198 sp=0x7fff5fbff140
runtime.(*mheap).alloc_m(0x3a8120, 0x1, 0x15, 0x0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:437 +0x119 fp=0x7fff5fbff1c8 sp=0x7fff5fbff198
runtime.(*mheap).alloc.func1()
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:502 +0x41 fp=0x7fff5fbff1f8 sp=0x7fff5fbff1c8
runtime.systemstack(0x7fff5fbff218)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:307 +0xab fp=0x7fff5fbff200 sp=0x7fff5fbff1f8
runtime.(*mheap).alloc(0x3a8120, 0x1, 0x10000000015, 0xe9cf)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:503 +0x63 fp=0x7fff5fbff248 sp=0x7fff5fbff200
runtime.(*mcentral).grow(0x3a9d20, 0x0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mcentral.go:209 +0x93 fp=0x7fff5fbff2b0 sp=0x7fff5fbff248
runtime.(*mcentral).cacheSpan(0x3a9d20, 0x3a4478)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mcentral.go:89 +0x47d fp=0x7fff5fbff2f0 sp=0x7fff5fbff2b0
runtime.(*mcache).refill(0x440000, 0x15, 0x7fff5fbff358)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/mcache.go:119 +0xcc fp=0x7fff5fbff328 sp=0x7fff5fbff2f0
runtime.mallocgc.func2()
    /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:642 +0x2b fp=0x7fff5fbff348 sp=0x7fff5fbff328
runtime.systemstack(0x7fff5fbff3e8)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:307 +0xab fp=0x7fff5fbff350 sp=0x7fff5fbff348
runtime.mallocgc(0x180, 0x257ba0, 0x0, 0x800000000)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:643 +0x869 fp=0x7fff5fbff428 sp=0x7fff5fbff350
runtime.newobject(0x257ba0, 0x3a47b0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:781 +0x42 fp=0x7fff5fbff450 sp=0x7fff5fbff428
runtime.malg(0x8000, 0x3a4a20)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/proc.go:2634 +0x27 fp=0x7fff5fbff488 sp=0x7fff5fbff450
runtime.mpreinit(0x3a4d60)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/os1_darwin.go:140 +0x1f fp=0x7fff5fbff4a0 sp=0x7fff5fbff488
runtime.mcommoninit(0x3a4d60)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/proc.go:494 +0x105 fp=0x7fff5fbff4e8 sp=0x7fff5fbff4a0
runtime.schedinit()
    /usr/local/Cellar/go/1.6/libexec/src/runtime/proc.go:434 +0x79 fp=0x7fff5fbff530 sp=0x7fff5fbff4e8
runtime.rt0_go(0x7fff5fbff568, 0x7, 0x7fff5fbff568, 0x0, 0x0, 0x7, 0x7fff5fbff748, 0x7fff5fbff750, 0x7fff5fbff757, 0x7fff5fbff75a, ...)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:138 +0x132 fp=0x7fff5fbff538 sp=0x7fff5fbff530

I recently upgrade to Sierra, and upgraded all my brew dependencies. I'm not entirely sure which is causing the problem.

creature commented 7 years ago

I had this problem too. From some research that turned up similar issues, it seems that Go binaries built with a 1.4.x version of Go are liable to segfault under macOS Sierra, and rebuilding with a 1.7.x version fixes it.

Scmpuff doesn't have any dependencies beyond Go, so it's straightforward for Homebrew to build it from source: brew reinstall -s scmpuff worked for me, and I haven't seen any segfaults since. If you haven't got Go installed, you might need to run brew install golang first.

milesj commented 7 years ago

@creature Thanks for this. Will give it a shot and report back.

hugovk commented 7 years ago

@creature Thank you, looks like that has fixed it for me too.

mroth commented 7 years ago

I plan to push a new release of this once Go 1.8 is released and hits homebrew, which should cause the homebrew bottles to be automatically rebuilt and address this issue for people who installed that way.

milesj commented 7 years ago

Reporting in that this also worked for me. Looking forward to the new version 👍

mroth commented 7 years ago

@milesj the new version should now be pushed as v0.2.1. Binaries on that page, and PR for homebrew is at homebrew/homebrew-core#10086.