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/sha512: invalid opcode on plan9/amd64 #19316

Closed
0intro opened this issue Feb 28, 2017 · 2 comments
Closed

crypto/sha512: invalid opcode on plan9/amd64 #19316

0intro opened this issue Feb 28, 2017 · 2 comments

Comments

@0intro
Copy link
Member

0intro commented Feb 28, 2017

Since CL 36630, crypto/sha512 is failing on plan9/amd64.

sys: trap: invalid opcode pc=0x2f2c99
PC=0x2f2c99

goroutine 6 [running]:
crypto/sha512.blockAVX2(0x420462c98, 0x420462cd8, 0x80, 0x80)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/crypto/sha512/sha512block_amd64.s:344 +0x59 fp=0x420462a80 sp=0x420462a38
crypto/sha512.block(0x420462c98, 0x420462cd8, 0x80, 0x80)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/crypto/sha512/sha512block_amd64.go:22 +0x59 fp=0x420462ab0 sp=0x420462a80
crypto/sha512.(*digest).Write(0x420462c98, 0x420462b80, 0x10, 0x80, 0x70, 0x0, 0x0)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/crypto/sha512/sha512.go:177 +0x234 fp=0x420462b00 sp=0x420462ab0
crypto/sha512.(*digest).checkSum(0x420462c98, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/crypto/sha512/sha512.go:226 +0x12e fp=0x420462c10 sp=0x420462b00
crypto/sha512.Sum512_224(0x420462e40, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/crypto/sha512/sha512.go:275 +0xe1 fp=0x420462d80 sp=0x420462c10
crypto/sha512.TestGolden(0x4204aa4e0)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/crypto/sha512/sha512_test.go:271 +0x117 fp=0x420462fa8 sp=0x420462d80
testing.tRunner(0x4204aa4e0, 0x341410)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:659 +0x9d fp=0x420462fd0 sp=0x420462fa8
runtime.goexit()
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/runtime/asm_amd64.s:2148 +0x1 fp=0x420462fd8 sp=0x420462fd0
created by testing.(*T).Run
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:701 +0x2df

goroutine 1 [chan receive]:
testing.(*T).Run(0x4204aa410, 0x337c8b, 0xa, 0x341410, 0x25f31b)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:702 +0x309
testing.runTests.func1(0x4204aa410)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:888 +0x6c
testing.tRunner(0x4204aa410, 0x420481e10)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:659 +0x9d
testing.runTests(0x4204540e0, 0x4182a0, 0x4, 0x4, 0x20d399)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:886 +0x2c6
testing.(*M).Run(0x420481f20, 0x420481f78)
	/tmp/gobuilder/plan9-amd64-9front-4dbcb53d0b58/go/src/testing/testing.go:828 +0x101
main.main()
	crypto/sha512/_test/_testmain.go:58 +0xc9

ax    0x8c3d37c819544da2
bx    0x73e1996689dcd4d6
cx    0x1dfab7ae32ff9c82
dx    0xf6d2b697bd44da8
di    0x420462cd8
si    0x420462c98
bp    0x420462a70
sp    0x420462a38
r8    0x679dd514582f9fcf
r9    0x77e36f7304c48942
r10   0x3f9d85a86a1d36c8
r11   0x1112e6ad91d692a1
r12   0x348440
r13   0x420462f20
r14   0x0
r15   0x11
ip    0x2f2c99
flags 0x10202
cs    0x2b
fs    0x0
gs    0x0
FAIL	crypto/sha512	0.026s

See https://build.golang.org/log/f92d91722e9c0db53d97943573b9e6701221f2b7

@0intro 0intro added this to the Go1.9Maybe milestone Feb 28, 2017
@0intro 0intro self-assigned this Feb 28, 2017
@0intro
Copy link
Member Author

0intro commented Feb 28, 2017

The checkAVX2 test doesn't appear to be correct, because it always
returns the value of support_bmi2, even if the value of support_avx2 is false.

On our machine, BMI2 is supported, but AVX2 is not supported. In this case,
checkAVX2 returns true, which doesn't seem to be the correct behavior.

@gopherbot
Copy link

CL https://golang.org/cl/37590 mentions this issue.

@golang golang locked and limited conversation to collaborators Feb 28, 2018
@rsc rsc unassigned 0intro Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants