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

Closed
bradfitz opened this issue May 2, 2019 · 5 comments
Closed
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker Soon This needs to be done soon. (regressions, serious bugs, outages) Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz 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
@bradfitz bradfitz added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. arch-wasm WebAssembly issues labels May 2, 2019
@bradfitz bradfitz added this to the Go1.13 milestone May 2, 2019
@gopherbot
Copy link

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

@bradfitz
Copy link
Contributor Author

bradfitz commented May 2, 2019

Looks like the failure is actually from crypto/rand.

@bradfitz
Copy link
Contributor Author

bradfitz 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
Updates #31812

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

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

/cc @cherrymui @neelance

@bradfitz bradfitz added the Soon This needs to be done soon. (regressions, serious bugs, outages) label May 14, 2019
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators May 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker Soon This needs to be done soon. (regressions, serious bugs, outages) Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants