GOOS=js GOARCH=wasm go run fails? (panic: newosproc: not implemented)


We’re developing a glue layer to unify GopherJS and Go’s Wasm targetting, and we encountered unfamiliar errors on TravisCI. Does anyone know what it is?

$ PATH=$(go env GOROOT)/misc/wasm:$PATH GOOS=js GOARCH=wasm go test

go: finding v1.0.2-0.20190103094518-b38746756334

panic: newosproc: not implemented

fatal error: panic on system stack

runtime stack:

runtime.throw(0x46b8f, 0x15)

/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/panic.go:608 +0x6

panic(0x1c200, 0x5e950)

/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/panic.go:451 +0x69




/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:1940 +0x14

runtime.newm(0x4c2a8, 0xc02c500)

/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:1919 +0xb

runtime.startm(0x0, 0x100000001)

/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:2066 +0x19


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:2147 +0x4

runtime.newproc1(0x4c1a8, 0xc03c778, 0x0, 0xc000180, 0x11e40002)

/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:3414 +0x38


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:3309 +0x2


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/asm_wasm.s:171 +0x2



goroutine 1 [running]:


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/asm_wasm.s:182 fp=0xc03c728 sp=0xc03c720 pc=0x13810000

runtime.newproc(0x0, 0x4c1a8)

/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:3308 +0x2 fp=0xc03c768 sp=0xc03c728 pc=0x12360002


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:240 +0x2 fp=0xc03c780 sp=0xc03c768 pc=0x11e40002


<autogenerated>:1 +0x19 fp=0xc03c7a0 sp=0xc03c780 pc=0x137a0019


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/proc.go:147 +0x9 fp=0xc03c7e0 sp=0xc03c7a0 pc=0x11e20009


/home/travis/.gimme/versions/go1.11.linux.amd64/src/runtime/asm_wasm.s:425 +0x1 fp=0xc03c7e8 sp=0xc03c7e0 pc=0x13a70001

FAIL 2.424s

The command "PATH=$(go env GOROOT)/misc/wasm:$PATH GOOS=js GOARCH=wasm go test" exited with 1.


1 Like

It looks like a function is getting called that uses newosproc, which isn’t implemented for GOOS=js.

Based on that, I’d expect running GOOS=js GOARCH=wasm go test on your own computer to have the same error.

This error doesn’t happen on my machine.

Additionally, this error doesn’t happen with downloaded Go.

I was wondering what is the difference between the pre-installed Go and the original Go.

That’s a good question — “pre-installed” is actually installed using gimme to download the version of Go requested.

If you install a copy of go 1.11 using gimme 1.11 on your system, do the tests fail?

Hmm, local gimme-go succeeded to run the test :thinking:

$ gimme 1.11
$ GIMME_GO=~/.gimme/versions/go1.11.darwin.amd64/bin/go
$ cd ./gopherwasm/
$ PATH=$($GIMME_GO env GOROOT)/misc/wasm:$PATH GOOS=js GOARCH=wasm $GIMME_GO test
ok       0.646s

I’ve run into what I believe is this same issue. See I am able to run the tests on my local machine just fine.

Is there any update here? Maybe a workaround I can use?

I was able to find a workaround, which is pretty similar to the workaround used in gopherwasm.

See this commit:

It basically involves skipping the default installation step for Go 1.12 and installing it manually instead.

Any updates?

I’m getting the same error on a minimal example.

$ GOOS=js GOARCH=wasm go test -v -exec="$(go env GOROOT)/misc/wasm/go_js_wasm_exec"
panic: newosproc: not implemented
fatal error: panic on system stack