Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/cipher: wasm: Cannot perform Construct on a neutered ArrayBuffer #31812

Open
bradfitz opened this issue May 2, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@bradfitz
Copy link
Member

commented May 2, 2019

I update the js/wasm builder from v8 to v12 and we now see:

https://storage.googleapis.com/go-build-log/643472f1/js-wasm_8d578b31.log

##### Testing packages.
ok  	archive/tar	5.361s
ok  	archive/zip	19.521s
ok  	bufio	5.000s
ok  	bytes	33.349s
ok  	compress/bzip2	1.545s
ok  	compress/flate	6.292s
ok  	compress/gzip	5.855s
ok  	compress/lzw	3.224s
ok  	compress/zlib	4.874s
ok  	container/heap	4.244s
ok  	container/list	4.117s
ok  	container/ring	4.176s
ok  	context	4.445s
ok  	crypto	3.836s
ok  	crypto/aes	3.900s
--- FAIL: TestXOR (0.24s)
panic: JavaScript error: Cannot perform Construct on a neutered ArrayBuffer [recovered]
	panic: JavaScript error: Cannot perform Construct on a neutered ArrayBuffer

goroutine 21 [running]:
testing.tRunner.func1(0x468f00)
	/workdir/go/src/testing/testing.go:830 +0x38
panic(0x4b6c0, 0x181e020)
	/workdir/go/src/runtime/panic.go:619 +0x20
syscall/js.Value.New(0x7ff800030000000d, 0x441dc8, 0x3, 0x3, 0x20)
	/workdir/go/src/syscall/js/js.go:357 +0x37
syscall/js.typedArrayOf(0x20340, 0x1810680, 0x29e00)
	/workdir/go/src/syscall/js/typedarray.go:85 +0x3d
syscall/js.TypedArrayOf(0x20340, 0x1810680, 0x1a4)
	/workdir/go/src/syscall/js/typedarray.go:57 +0x2
crypto/rand.(*reader).Read(0x2390a0, 0x181c1c0, 0x1a4, 0x1a4, 0x1a4, 0x0, 0x0)
	/workdir/go/src/crypto/rand/rand_js.go:23 +0x3
io.ReadAtLeast(0x80a00, 0x2390a0, 0x181c1c0, 0x1a4, 0x1a4, 0x1a4, 0x1a4, 0x0, 0x0)
	/workdir/go/src/io/io.go:310 +0x6
io.ReadFull(...)
	/workdir/go/src/io/io.go:329
crypto/cipher_test.TestXOR(0x468f00)
	/workdir/go/src/crypto/cipher/xor_test.go:28 +0x28
testing.tRunner(0x468f00, 0x63528)
	/workdir/go/src/testing/testing.go:865 +0xe
created by testing.(*T).Run
	/workdir/go/src/testing/testing.go:916 +0x2d
FAIL	crypto/cipher	4.573s
ok  	crypto/des	4.177s
ok  	crypto/dsa	4.368s
2019/05/02 22:01:34 Failed: exit status 1


Error: tests failed: dist test failed: go_test:crypto/cipher: exit status 1
@gopherbot

This comment has been minimized.

Copy link

commented May 2, 2019

Change https://golang.org/cl/175099 mentions this issue: all: disable broken js/wasm tests from nodejs v8 to v12 upgrade

@bradfitz

This comment has been minimized.

Copy link
Member Author

commented May 2, 2019

Looks like the failure is actually from crypto/rand.

@bradfitz

This comment has been minimized.

Copy link
Member Author

commented May 2, 2019

Another case of #31702 needing similar fix as https://go-review.googlesource.com/c/go/+/174304 ?

gopherbot pushed a commit that referenced this issue May 2, 2019

crypto/cipher: disable broken js/wasm test from nodejs v8 to v12 upgrade
Updates #31812

Change-Id: Id9898f89205c116009e25033afb5b9026594e80f
Reviewed-on: https://go-review.googlesource.com/c/go/+/175099
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@bradfitz

This comment has been minimized.

Copy link
Member Author

commented May 14, 2019

This is continuing to cause trybot failures for people elsewhere, most recently via crypto/x509 tests.

/cc @cherrymui @neelance

@bradfitz bradfitz added the Soon label May 14, 2019

@gopherbot

This comment has been minimized.

Copy link

commented May 15, 2019

Change https://golang.org/cl/177537 mentions this issue: syscall/js: replace TypedArrayOf with ReadBytes/WriteBytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.