gonum/netlib

lapack/netlib: Dgelqf panics testlapack.DgelqfTest for medium work case

Closed this issue · 1 comments

What are you trying to do?

Run netlib lapack tests as part of #51.

What did you do?

go test -run Dgelqf

What did you expect to happen?

Successful test.

What actually happened?

$ CGO_LDFLAGS="-L/usr/local -lopenblas" go test -run Dgelqf
--- FAIL: TestDgelqf (0.01s)
panic: runtime error: makeslice: len out of range [recovered]
	panic: runtime error: makeslice: len out of range

goroutine 19 [running]:
testing.tRunner.func1(0xc0000e4100)
	.../go/src/testing/testing.go:830 +0x388
panic(0x5f61a0, 0x6773f0)
	.../go/src/runtime/panic.go:522 +0x1b5
gonum.org/v1/gonum/lapack/testlapack.DgelqfTest(0xc0000e4100, 0x67a900, 0xa01f10)
	.../src/gonum.org/v1/gonum/lapack/testlapack/dgelqf.go:91 +0x3c0
gonum.org/v1/netlib/lapack/netlib.TestDgelqf(0xc0000e4100)
	.../src/gonum.org/v1/netlib/lapack/netlib/lapack_test.go:152 +0x43
testing.tRunner(0xc0000e4100, 0x633658)
	.../go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
	.../go/src/testing/testing.go:916 +0x357
exit status 2
FAIL	gonum.org/v1/netlib/lapack/netlib	0.018s

What version of Go, Gonum, Gonum/netlib and C implementation are you using?

gonum: 70a1e933af10e87000d2ccabdd509b87d8626153
netlib: b131843
OpenBLAS: 9e4d190f4f25c6e2e2a1ea1ed849c5b79513f9b7

Does this issue reproduce with the current master?

Yes.

Additional information

The failure happens when m is 10 for the medium work case; the lwork query call returns 10, so the lwork calculation, int(work[0]) - 2*m, gives -10 resulting the illegal makeslice length.

This was fixed in #55 .