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] v2.1.0 IntBetween still panic()'s... #169

Open
sean- opened this issue Feb 20, 2024 · 2 comments
Open

[BUG] v2.1.0 IntBetween still panic()'s... #169

sean- opened this issue Feb 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sean-
Copy link
Contributor

sean- commented Feb 20, 2024

Describe the bug
This looks like a continuation of #164

To Reproduce
This may still need to be entirely fixed. I can reproduce this about once every 50-100 runs or so. Using https://github.com/sean-/bench-go-histograms as the reproducer:

$ go test -test.bench=PromDuration -benchmem -count 200
goos: darwin
goarch: arm64
pkg: github.com/sean-/bench-go-histograms
Benchmark_PromDuration-10    	 5184980	       229.5 ns/op	       0 B/op	       0 allocs/op
Benchmark_PromDuration-10    	 5846218	       217.5 ns/op	       0 B/op	       0 allocs/op
[snip]
Benchmark_PromDuration-10    	 5678696	       234.6 ns/op	       0 B/op	       0 allocs/op
Benchmark_PromDuration-10    	 5885458	       226.5 ns/op	       0 B/op	       0 allocs/op
Benchmark_PromDuration-10    	 5580679	       225.2 ns/op	       0 B/op	       0 allocs/op
Benchmark_PromDuration-10    	panic: runtime error: index out of range [-1]

goroutine 635 [running]:
math/rand.(*rngSource).Uint64(...)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/math/rand/rng.go:249
math/rand.(*rngSource).Int63(0x9?)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/math/rand/rng.go:234 +0x8c
math/rand.(*Rand).Int63(...)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/math/rand/rand.go:96
math/rand.(*Rand).Int63n(0x140000a8c30, 0x2540be400)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/math/rand/rand.go:128 +0x68
math/rand.(*Rand).Intn(0xb?, 0x14000130000?)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/math/rand/rand.go:185 +0x44
github.com/jaswdr/faker/v2.Faker.IntBetween({{0x102946538?, 0x140000a8c30?}}, 0x1?, 0x2540be400?)
	/Users/seanc/go/pkg/mod/github.com/jaswdr/faker/[email protected]/faker.go:182 +0xb0
github.com/sean-/bench-go-histograms.randDuration(...)
	/Users/seanc/go/src/github.com/sean-/bench-go-histograms/bench_test.go:22
github.com/sean-/bench-go-histograms.Benchmark_PromDuration.func1(0x1400007e000)
	/Users/seanc/go/src/github.com/sean-/bench-go-histograms/bench_test.go:151 +0x64
testing.(*B).RunParallel.func1()
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/testing/benchmark.go:797 +0xbc
created by testing.(*B).RunParallel in goroutine 610
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/testing/benchmark.go:790 +0x104
exit status 2
FAIL	github.com/sean-/bench-go-histograms	15.354s

JFYI. The rate of this happening is now quite small, but it's not zero, either. I don't know if you want to open a new issue, or

@sean- sean- added the bug Something isn't working label Feb 20, 2024
@jaswdr
Copy link
Owner

jaswdr commented Feb 27, 2024

Ack, I'm working to fix it.

@jaswdr
Copy link
Owner

jaswdr commented Feb 28, 2024

@sean- can you confirm which version of Go are you using? I'm not able to reproduce it with 1.22.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants