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

Bug: panic: invalid argument to Intn on GOARCH=386 #202

Closed
carlwgeorge opened this issue Nov 30, 2018 · 4 comments
Closed

Bug: panic: invalid argument to Intn on GOARCH=386 #202

carlwgeorge opened this issue Nov 30, 2018 · 4 comments
Assignees
Labels

Comments

@carlwgeorge
Copy link

I'm working on packaging this for Fedora, and I'm getting an error in the test suite when building for Fedora 28, i686 architecture.

+ go test -buildmode pie -compiler gc -ldflags '-extldflags '\''-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '\'''
--- FAIL: TestClientRetryWait (3.00s)
	resty_test.go:41: Method: GET
	resty_test.go:42: Path: /set-retrywaittime-test
	resty_test.go:41: Method: GET
	resty_test.go:42: Path: /set-retrywaittime-test
panic: invalid argument to Intn [recovered]
	panic: invalid argument to Intn

goroutine 767 [running]:
testing.tRunner.func1(0x681b0240)
	/usr/lib/golang/src/testing/testing.go:742 +0x25d
panic(0x56961700, 0x569b2940)
	/usr/lib/golang/src/runtime/panic.go:502 +0x1ff
math/rand.(*Rand).Intn(0x68086440, 0x80000000, 0x566e8875)
	/usr/lib/golang/src/math/rand/rand.go:166 +0x86
math/rand.Intn(0x80000000, 0x4200c388)
	/usr/lib/golang/src/math/rand/rand.go:326 +0x33
gopkg.in/resty%2ev1.Backoff(0x68156ec4, 0x68156eb4, 0x4, 0x4, 0x680c4120, 0x2d)
	/builddir/build/BUILD/resty-1.10.2/_build/src/gopkg.in/resty.v1/retry.go:105 +0x205
gopkg.in/resty%2ev1.(*Request).Execute(0x68050320, 0x56874186, 0x3, 0x680c4120, 0x2d, 0x2, 0x680c4120, 0x568406b5)
	/builddir/build/BUILD/resty-1.10.2/_build/src/gopkg.in/resty.v1/request.go:476 +0x2d8
gopkg.in/resty%2ev1.(*Request).Get(0x68050320, 0x680c4120, 0x2d, 0x5687b335, 0x17, 0x680c4120)
	/builddir/build/BUILD/resty-1.10.2/_build/src/gopkg.in/resty.v1/request.go:415 +0x49
gopkg.in/resty%2ev1.TestClientRetryWait(0x681b0240)
	/builddir/build/BUILD/resty-1.10.2/_build/src/gopkg.in/resty.v1/retry_test.go:209 +0x34c
testing.tRunner(0x681b0240, 0x569b1b74)
	/usr/lib/golang/src/testing/testing.go:777 +0xbe
created by testing.(*T).Run
	/usr/lib/golang/src/testing/testing.go:824 +0x262
exit status 2
FAIL	gopkg.in/resty.v1	31.102s

full build log

This is with golang 1.10.5. Surprisingly the test passes with this version of golang on all the other architectures (x86_64, ppc64le, aarch64, s390x, and armv7hl). Builds for Fedora 29 with golang 1.11.2 pass on all architectures. If the software requires golang 1.11 I'm OK with that, I just won't build it for Fedora 28.

@jeevatkm
Copy link
Member

@carlwgeorge Thanks for reporting an issue. Resty will work go1.3 and above. BTW I have not specifically tested for GOARCH=386 on travis.

I will have a look and get back.

@jeevatkm jeevatkm self-assigned this Nov 30, 2018
@jeevatkm jeevatkm changed the title minimum required golang version Bug: panic: invalid argument to Intn on GOARCH=386 Dec 4, 2018
@jeevatkm jeevatkm added the bug label Dec 4, 2018
@jeevatkm
Copy link
Member

jeevatkm commented Dec 4, 2018

@carlwgeorge Could you try master branch and please let me know?

@jeevatkm jeevatkm closed this as completed Dec 4, 2018
@carlwgeorge
Copy link
Author

@jeevatkm Adding your commit as a patch to my RPM spec file fixed the build issue. Thanks!

https://src.fedoraproject.org/rpms/golang-gopkg-resty-1/c/d7ad12d96498885044a8a8328655a44a31ac0f00

@jeevatkm
Copy link
Member

jeevatkm commented Dec 5, 2018

@carlwgeorge Thanks for the confirmation. I will make a release of v1.10.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants