Golang终端中的错误

huangapple go评论84阅读模式
英文:

Golang error in terminal

问题

我在按下多次回车键时,在我的OSX终端中遇到了Golang错误。在OSX Sierra和Golang版本1.4.2之间存在已知问题。虽然我没有Golang版本1.4.2,但堆栈跟踪指向了它,所以我的假设是某个应用程序正在使用旧版本。

有没有办法我可以启用详细日志记录或找出导致错误的util/daemon?以下是堆栈跟踪:

failed MSpanList_Insert 0x370000 0x672c197df0740 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x279a4b)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:491 +0xad fp=0x7fff5fbff000 sp=0x7fff5fbfefd0
runtime.MSpanList_Insert(0x298e28, 0x370000)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:692 +0x8f fp=0x7fff5fbff028 sp=0x7fff5fbff000
MHeap_FreeSpanLocked(0x295a20, 0x370000, 0x100)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:583 +0x163 fp=0x7fff5fbff068 sp=0x7fff5fbff028
MHeap_Grow(0x295a20, 0x8, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:420 +0x1a8 fp=0x7fff5fbff0a8 sp=0x7fff5fbff068
MHeap_AllocSpanLocked(0x295a20, 0x1, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:298 +0x365 fp=0x7fff5fbff0e8 sp=0x7fff5fbff0a8
mheap_alloc(0x295a20, 0x1, 0x12, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:190 +0x121 fp=0x7fff5fbff110 sp=0x7fff5fbff0e8
runtime.MHeap_Alloc(0x295a20, 0x1, 0x10000000012, 0x1f2e9)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:240 +0x66 fp=0x7fff5fbff148 sp=0x7fff5fbff110
MCentral_Grow(0x29d798, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mcentral.c:197 +0x8b fp=0x7fff5fbff1b0 sp=0x7fff5fbff148
runtime.MCentral_CacheSpan(0x29d798, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mcentral.c:85 +0x167 fp=0x7fff5fbff1e8 sp=0x7fff5fbff1b0
runtime.MCache_Refill(0x36c000, 0x12, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mcache.c:90 +0xa0 fp=0x7fff5fbff210 sp=0x7fff5fbff1e8
runtime.mcacheRefill_m()
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.c:368 +0x57 fp=0x7fff5fbff230 sp=0x7fff5fbff210
runtime.onM(0x1f3ff8)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:273 +0x9a fp=0x7fff5fbff238 sp=0x7fff5fbff230
runtime.mallocgc(0x120, 0x198de0, 0x0, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.go:178 +0x849 fp=0x7fff5fbff2e8 sp=0x7fff5fbff238
runtime.newobject(0x198de0, 0x36c000)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.go:353 +0x49 fp=0x7fff5fbff310 sp=0x7fff5fbff2e8
runtime.newG(0x3645a)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.go:233 +0x2a fp=0x7fff5fbff328 sp=0x7fff5fbff310
allocg(0x288380)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:925 +0x1f fp=0x7fff5fbff338 sp=0x7fff5fbff328
runtime.malg(0x8000, 0x288420)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:2106 +0x1f fp=0x7fff5fbff368 sp=0x7fff5fbff338
runtime.mpreinit(0x2887e0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/os_darwin.c:137 +0x27 fp=0x7fff5fbff380 sp=0x7fff5fbff368
mcommoninit(0x2887e0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:201 +0xc9 fp=0x7fff5fbff3a8 sp=0x7fff5fbff380
runtime.schedinit()
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:138 +0x55 fp=0x7fff5fbff3d0 sp=0x7fff5fbff3a8
runtime.rt0_go(0x7fff5fbff408, 0x3, 0x7fff5fbff408, 0x0, 0x0, 0x3, 0x7fff5fbff608, 0x7fff5fbff60f, 0x7fff5fbff616, 0x0, ...)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:95 +0x116 fp=0x7fff5fbff3d8 sp=0x7fff5fbff3d0
英文:

I'm getting Golang errors in my OSX terminal when I press enter multiple times. There's a known issue with OSX Sierra and Golang version 1.4.2. I don't have Golang version 1.4.2 but the stacktrace is referring to that so my assumption is that there is an application somewhere using the old version.

Is there a way I can enable verbose logging or find out the util/daemon that is causing the error? The stacktrace is below:

failed MSpanList_Insert 0x370000 0x672c197df0740 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x279a4b)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:491 +0xad fp=0x7fff5fbff000 sp=0x7fff5fbfefd0
runtime.MSpanList_Insert(0x298e28, 0x370000)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:692 +0x8f fp=0x7fff5fbff028 sp=0x7fff5fbff000
MHeap_FreeSpanLocked(0x295a20, 0x370000, 0x100)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:583 +0x163 fp=0x7fff5fbff068 sp=0x7fff5fbff028
MHeap_Grow(0x295a20, 0x8, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:420 +0x1a8 fp=0x7fff5fbff0a8 sp=0x7fff5fbff068
MHeap_AllocSpanLocked(0x295a20, 0x1, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:298 +0x365 fp=0x7fff5fbff0e8 sp=0x7fff5fbff0a8
mheap_alloc(0x295a20, 0x1, 0x12, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:190 +0x121 fp=0x7fff5fbff110 sp=0x7fff5fbff0e8
runtime.MHeap_Alloc(0x295a20, 0x1, 0x10000000012, 0x1f2e9)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mheap.c:240 +0x66 fp=0x7fff5fbff148 sp=0x7fff5fbff110
MCentral_Grow(0x29d798, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mcentral.c:197 +0x8b fp=0x7fff5fbff1b0 sp=0x7fff5fbff148
runtime.MCentral_CacheSpan(0x29d798, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mcentral.c:85 +0x167 fp=0x7fff5fbff1e8 sp=0x7fff5fbff1b0
runtime.MCache_Refill(0x36c000, 0x12, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/mcache.c:90 +0xa0 fp=0x7fff5fbff210 sp=0x7fff5fbff1e8
runtime.mcacheRefill_m()
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.c:368 +0x57 fp=0x7fff5fbff230 sp=0x7fff5fbff210
runtime.onM(0x1f3ff8)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:273 +0x9a fp=0x7fff5fbff238 sp=0x7fff5fbff230
runtime.mallocgc(0x120, 0x198de0, 0x0, 0x0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.go:178 +0x849 fp=0x7fff5fbff2e8 sp=0x7fff5fbff238
runtime.newobject(0x198de0, 0x36c000)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.go:353 +0x49 fp=0x7fff5fbff310 sp=0x7fff5fbff2e8
runtime.newG(0x3645a)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.go:233 +0x2a fp=0x7fff5fbff328 sp=0x7fff5fbff310
allocg(0x288380)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:925 +0x1f fp=0x7fff5fbff338 sp=0x7fff5fbff328
runtime.malg(0x8000, 0x288420)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:2106 +0x1f fp=0x7fff5fbff368 sp=0x7fff5fbff338
runtime.mpreinit(0x2887e0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/os_darwin.c:137 +0x27 fp=0x7fff5fbff380 sp=0x7fff5fbff368
mcommoninit(0x2887e0)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:201 +0xc9 fp=0x7fff5fbff3a8 sp=0x7fff5fbff380
runtime.schedinit()
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:138 +0x55 fp=0x7fff5fbff3d0 sp=0x7fff5fbff3a8
runtime.rt0_go(0x7fff5fbff408, 0x3, 0x7fff5fbff408, 0x0, 0x0, 0x3, 0x7fff5fbff608, 0x7fff5fbff60f, 0x7fff5fbff616, 0x0, ...)
	/usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:95 +0x116 fp=0x7fff5fbff3d8 sp=0x7fff5fbff3d0

答案1

得分: 0

尝试运行brew upgrade go命令,因为这个问题在较新的版本中似乎已经解决了。即使你最初没有使用brew进行安装,安装路径是相同的,所以brew应该可以解决这个问题。

英文:

Give brew upgrade go a try as this seems to be resolved in later versions, even if you didn't install with brew originally, the install path is the same so brew should solve it for you.

答案2

得分: 0

(将我的评论作为答案移动,以标记此问题为已解决)。

最终解决了。我手动检查了我的实用工具,并将 direnv(github.com/direnv/direnv)确定为有问题的实用工具。我可能是使用旧版本的 Go 编译它的。

英文:

(Moving my comment as an answer to mark this question as resolved).

Ended up fixing it. Manually went through my utilities and isolated direnv (github.com/direnv/direnv) as the problematic utility. I must have compiled it using old Go version.

huangapple
  • 本文由 发表于 2017年7月4日 20:09:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/44905618.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定