Monday, October 23, 2017

Git broken on MacOS High Sierra

Today I updated to MacOS High Sierra and everything was fine until I tried to execute:
git push origin my_branch
I was greeted with this output:

failed MSpanList_Insert 0x96b000 0x419b0d8d161 0x0 0x0
fatal error: MSpanList_Insert
runtime stack:
runtime.throw(0x5f1530, 0x10)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/panic.go:530 +0x90 fp=0x7ffeefbff490 sp=0x7ffeefbff478
runtime.(*mSpanList).insert(0x8503a8, 0x96b000)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:933 +0x293 fp=0x7ffeefbff4c0 sp=0x7ffeefbff490
runtime.(*mheap).freeSpanLocked(0x84fba0, 0x96b000, 0x100, 0x0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:809 +0x4be fp=0x7ffeefbff528 sp=0x7ffeefbff4c0
runtime.(*mheap).grow(0x84fba0, 0x8, 0x0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:675 +0x2a0 fp=0x7ffeefbff580 sp=0x7ffeefbff528
runtime.(*mheap).allocSpanLocked(0x84fba0, 0x1, 0x0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:553 +0x4e3 fp=0x7ffeefbff5d8 sp=0x7ffeefbff580
runtime.(*mheap).alloc_m(0x84fba0, 0x1, 0x15, 0x0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:437 +0x119 fp=0x7ffeefbff608 sp=0x7ffeefbff5d8
runtime.(*mheap).alloc.func1()
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:502 +0x41 fp=0x7ffeefbff638 sp=0x7ffeefbff608
runtime.systemstack(0x7ffeefbff658)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/asm_amd64.s:307 +0xab fp=0x7ffeefbff640 sp=0x7ffeefbff638
runtime.(*mheap).alloc(0x84fba0, 0x1, 0x10000000015, 0x103cf)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mheap.go:503 +0x63 fp=0x7ffeefbff688 sp=0x7ffeefbff640
runtime.(*mcentral).grow(0x8517a0, 0x0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mcentral.go:209 +0x93 fp=0x7ffeefbff6f0 sp=0x7ffeefbff688
runtime.(*mcentral).cacheSpan(0x8517a0, 0x84a2f8)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mcentral.go:89 +0x47d fp=0x7ffeefbff730 sp=0x7ffeefbff6f0
runtime.(*mcache).refill(0x967000, 0x15, 0x7ffeefbff798)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/mcache.go:119 +0xcc fp=0x7ffeefbff768 sp=0x7ffeefbff730
runtime.mallocgc.func2()
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/malloc.go:642 +0x2b fp=0x7ffeefbff788 sp=0x7ffeefbff768
runtime.systemstack(0x7ffeefbff828)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/asm_amd64.s:307 +0xab fp=0x7ffeefbff790 sp=0x7ffeefbff788
runtime.mallocgc(0x180, 0x58ecc0, 0x0, 0x800000000)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/malloc.go:643 +0x869 fp=0x7ffeefbff868 sp=0x7ffeefbff790
runtime.newobject(0x58ecc0, 0x84a8b0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/malloc.go:781 +0x42 fp=0x7ffeefbff890 sp=0x7ffeefbff868
runtime.malg(0x8000, 0x84ac60)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/proc.go:2634 +0x27 fp=0x7ffeefbff8c8 sp=0x7ffeefbff890
runtime.mpreinit(0x84b420)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/os1_darwin.go:140 +0x1f fp=0x7ffeefbff8e0 sp=0x7ffeefbff8c8
runtime.mcommoninit(0x84b420)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/proc.go:494 +0x105 fp=0x7ffeefbff928 sp=0x7ffeefbff8e0
runtime.schedinit()
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/proc.go:434 +0x79 fp=0x7ffeefbff970 sp=0x7ffeefbff928
runtime.rt0_go(0x7ffeefbff9a0, 0x4, 0x7ffeefbff9a0, 0x0, 0x4, 0x7ffeefbffad0, 0x7ffeefbffae7, 0x7ffeefbffaf0, 0x7ffeefbffaf7, 0x0, ...)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/asm_amd64.s:138 +0x132 fp=0x7ffeefbff978 sp=0x7ffeefbff970
error: failed to push some refs to 'https://github.com/mijo-gracanin/repo.git'


Googling gave me some clues and grep -irl "/usr/local/Cellar/go/1.6.1" revealed that mentioned path is located in /usr/local/bin/git-lfs.

Updating brew and relinking git-lfs solved the issue.