keybase / go-crypto

[mirror] Go supplementary cryptography libraries
https://godoc.org/golang.org/x/crypto
BSD 3-Clause "New" or "Revised" License
50 stars 20 forks source link

Go 1.11 build failure #69

Open logic opened 6 years ago

logic commented 6 years ago

When building using the new Go 1.11 beta in Fedora rawhide, I observed an error testing bn256:

Testing: "/builddir/build/BUILD/go-crypto-670ebd3adf7a737d69ffe83a777a8e34eadc1b32/_build/src/github.com/keybase/go-crypto/bn256"                                                                                 
+ GOPATH=/builddir/build/BUILD/go-crypto-670ebd3adf7a737d69ffe83a777a8e34eadc1b32/_build:/usr/share/gocode                                                                                                        
+ go test -buildmode pie -compiler gc -ldflags '-extldflags '\''-Wl,-z,relro   -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '\'''                                                                     
--- FAIL: TestG1Marshal (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x55560c9af661]

goroutine 28 [running]:
testing.tRunner.func1(0xc0000c0400)
        /usr/lib/golang/src/testing/testing.go:792 +0x389
panic(0x55560ca49a20, 0x55560cb438a0)
        /usr/lib/golang/src/runtime/panic.go:513 +0x1bd
math/big.(*Int).Mul(0xc000491660, 0xc000490fa0, 0x0, 0x0)
        /usr/lib/golang/src/math/big/int.go:161 +0xe1
github.com/keybase/go-crypto/bn256.(*curvePoint).MakeAffine(0xc000491000, 0x0, 0x55560c9c3cd9)
        /builddir/build/BUILD/go-crypto-670ebd3adf7a737d69ffe83a777a8e34eadc1b32/_build/src/github.com/keybase/go-crypto/bn256/curve.go:254 +0xfb                                                                 
github.com/keybase/go-crypto/bn256.(*G1).Marshal(0xc000447f70, 0xc00009e100, 0xc000048f70, 0x40)
        /builddir/build/BUILD/go-crypto-670ebd3adf7a737d69ffe83a777a8e34eadc1b32/_build/src/github.com/keybase/go-crypto/bn256/bn256.go:96 +0x4e                                                                  
github.com/keybase/go-crypto/bn256.TestG1Marshal(0xc0000c0400)
        /builddir/build/BUILD/go-crypto-670ebd3adf7a737d69ffe83a777a8e34eadc1b32/_build/src/github.com/keybase/go-crypto/bn256/bn256_test.go:228 +0xf2                                                            
testing.tRunner(0xc0000c0400, 0x55560ca711d0)
        /usr/lib/golang/src/testing/testing.go:827 +0xc1
created by testing.(*T).Run
        /usr/lib/golang/src/testing/testing.go:878 +0x355
exit status 2
FAIL    github.com/keybase/go-crypto/bn256      0.181s
error: Bad exit status from /var/tmp/rpm-tmp.s5SKKU (%check)
    Bad exit status from /var/tmp/rpm-tmp.s5SKKU (%check)

It appears that this was fixed upstream (golang/crypto@8b1d31080a7692e075c4681cb2458454a1fe0706), and I've pulled a modified version of this into the Fedora package I've built (it doesn't apply cleanly at this point, as upstream has diverged a bit too much).

Anyway, figured you might want to know. :smiley:

maxtaco commented 6 years ago

thanks for the pointer, we'll merge in those changes from upstream