gvm: Installation not working

Fresh Ubuntu 18 LTS without any go installed:

gvm install go1.4
Downloading Go source...
Installing go1.4...
 * Compiling...
/home/bamboo/.gvm/scripts/install: line 84: go: command not found
ERROR: Failed to compile. Check the logs at /home/bamboo/.gvm/logs/go-go1.4-compile.log
ERROR: Failed to use installed version
gvm install go1.14 -pb -b
Installing go1.14...
 * Compiling...
/home/bamboo/.gvm/scripts/install: line 84: go: command not found
ERROR: Failed to compile. Check the logs at /home/bamboo/.gvm/logs/go-go1.14-compile.log
ERROR: Failed to use installed version
gvm install go1.14 -pb -B
Installing go1.14 from binary source
ERROR: Failed to extract binary go

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@lucianomda This appears to be an issue with go1.4 on certain versions of macos: https://github.com/golang/go/issues/17182

I was able to get it to work by bootstrapping with go1.7.1 instead of 1.4:

gvm install go1.7.1 -B
gvm use go1.7.1
export GOROOT_BOOTSTRAP=$GOROOT

I can then gvm install later versions of Go.

I am trying a new installation on macos 10.15.4, I didn’t have golang installed in my system, I went directly for a new installation with gvm. When I run gvm install go1.4 -B it seems to work. If I run gvm list I see

gvm gos (installed)

=> go1.4

But if I run go version I see this error

failed MSpanList_Insert 0x12be000 0x7c94ae0bd811 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x7ffa6b)
	/usr/local/go/src/runtime/panic.go:491 +0xad fp=0x7ffeefbfec70 sp=0x7ffeefbfec40
runtime.MSpanList_Insert(0x82af28, 0x12be000)
	/usr/local/go/src/runtime/mheap.c:692 +0x8f fp=0x7ffeefbfec98 sp=0x7ffeefbfec70
MHeap_FreeSpanLocked(0x827b20, 0x12be000, 0x100)
	/usr/local/go/src/runtime/mheap.c:583 +0x163 fp=0x7ffeefbfecd8 sp=0x7ffeefbfec98
MHeap_Grow(0x827b20, 0x8, 0x0)
	/usr/local/go/src/runtime/mheap.c:420 +0x1a8 fp=0x7ffeefbfed18 sp=0x7ffeefbfecd8
MHeap_AllocSpanLocked(0x827b20, 0x1, 0x1230a00)
	/usr/local/go/src/runtime/mheap.c:298 +0x365 fp=0x7ffeefbfed58 sp=0x7ffeefbfed18
mheap_alloc(0x827b20, 0x1, 0x7f0000000012, 0x7fff6a60e297)
	/usr/local/go/src/runtime/mheap.c:190 +0x121 fp=0x7ffeefbfed80 sp=0x7ffeefbfed58
runtime.MHeap_Alloc(0x827b20, 0x1, 0x10000000012, 0x977a9)
	/usr/local/go/src/runtime/mheap.c:240 +0x66 fp=0x7ffeefbfedb8 sp=0x7ffeefbfed80
MCentral_Grow(0x82f898, 0x122d000)
	/usr/local/go/src/runtime/mcentral.c:197 +0x8b fp=0x7ffeefbfee20 sp=0x7ffeefbfedb8
runtime.MCentral_CacheSpan(0x82f898, 0x7ffeefbfee90)
	/usr/local/go/src/runtime/mcentral.c:85 +0x167 fp=0x7ffeefbfee58 sp=0x7ffeefbfee20
runtime.MCache_Refill(0x12ba000, 0x12, 0x7ffeefbfeeb0)
	/usr/local/go/src/runtime/mcache.c:90 +0xa0 fp=0x7ffeefbfee80 sp=0x7ffeefbfee58
runtime.mcacheRefill_m()
	/usr/local/go/src/runtime/malloc.c:368 +0x57 fp=0x7ffeefbfeea0 sp=0x7ffeefbfee80
runtime.onM(0x6a2870)
	/usr/local/go/src/runtime/asm_amd64.s:273 +0x9a fp=0x7ffeefbfeea8 sp=0x7ffeefbfeea0
runtime.mallocgc(0x120, 0x590240, 0x0, 0x0)
	/usr/local/go/src/runtime/malloc.go:178 +0x85b fp=0x7ffeefbfef58 sp=0x7ffeefbfeea8
runtime.newobject(0x590240, 0x12ba000)
	/usr/local/go/src/runtime/malloc.go:353 +0x49 fp=0x7ffeefbfef80 sp=0x7ffeefbfef58
runtime.newG(0xb17fa)
	/usr/local/go/src/runtime/proc.go:233 +0x2a fp=0x7ffeefbfef98 sp=0x7ffeefbfef80
allocg(0x817ac0)
	/usr/local/go/src/runtime/proc.c:925 +0x1f fp=0x7ffeefbfefa8 sp=0x7ffeefbfef98
runtime.malg(0x8000, 0x817e40)
	/usr/local/go/src/runtime/proc.c:2106 +0x1f fp=0x7ffeefbfefd8 sp=0x7ffeefbfefa8
runtime.mpreinit(0x818680)
	/usr/local/go/src/runtime/os_darwin.c:137 +0x27 fp=0x7ffeefbfeff0 sp=0x7ffeefbfefd8
mcommoninit(0x818680)
	/usr/local/go/src/runtime/proc.c:201 +0xc9 fp=0x7ffeefbff018 sp=0x7ffeefbfeff0
runtime.schedinit()
	/usr/local/go/src/runtime/proc.c:138 +0x6e fp=0x7ffeefbff040 sp=0x7ffeefbff018
runtime.rt0_go(0x7ffeefbff078, 0x2, 0x7ffeefbff078, 0x0, 0x0, 0x2, 0x7ffeefbff2b8, 0x7ffeefbff2bb, 0x0, 0x7ffeefbff2c3, ...)
	/usr/local/go/src/runtime/asm_amd64.s:95 +0x116 fp=0x7ffeefbff048 sp=0x7ffeefbff040

Note that gvm install go1.4 -B only works if you’re on an x86 system. It will happily install an i386 binary on an ARM system, but that’s not going to solve any problem.

@johnlhamilton Seems that issue was hijacked. The original problem is that gvm can’t install go on Linux instances without Go already installed. I just tried this in Kali as well, and ran into the same issue. Installing the “golang” package with aptitude fixes the problem but that sort of defeats the purpose of having gvm. I’d rather not have a default system installation as a dependency to a tool that is supposed to enable seamless Go development.

I read a little bit of the shell scripts and have a basic understanding of how gvm works, although I’m fuzzy on how Go is compiled from source. The error from @piotrkochan is weird considering that Go is needed to compile Go?

gvm install go1.4
Downloading Go source...
Installing go1.4...
 * Compiling...
/home/bamboo/.gvm/scripts/install: line 84: go: command not found

Here is the problem code:

compile_go() {
	display_message " * Compiling..."
	[ -z "$GOROOT_BOOTSTRAP" ] && export GOROOT_BOOTSTRAP=$(go env GOROOT) 

@johnlhamilton thanks for the reply, it works for me too. Now I can finally get rid of my go instalation via homebrew 😃