Skip to content

A weird crash during repeated calls to fakeuseragent.Random() #9

@ashishb

Description

@ashishb
panic: runtime error: index out of range [-1]

goroutine 102 [running]:
math/rand.(*rngSource).Uint64(...)
	/opt/homebrew/Cellar/go/1.18.3/libexec/src/math/rand/rng.go:249
math/rand.(*rngSource).Int63(0xffffffffffffffff?)
	/opt/homebrew/Cellar/go/1.18.3/libexec/src/math/rand/rng.go:234 +0x90
math/rand.(*Rand).Int63(...)
	/opt/homebrew/Cellar/go/1.18.3/libexec/src/math/rand/rand.go:84
math/rand.(*Rand).Int31(...)
	/opt/homebrew/Cellar/go/1.18.3/libexec/src/math/rand/rand.go:98
math/rand.(*Rand).Int31n(0x140003b0060, 0xbb8)
	/opt/homebrew/Cellar/go/1.18.3/libexec/src/math/rand/rand.go:133 +0x50
math/rand.(*Rand).Intn(0x140016a7a18?, 0x14002236be0?)
	/opt/homebrew/Cellar/go/1.18.3/libexec/src/math/rand/rand.go:171 +0x34
github.com/EDDYCJY/fake-useragent/useragent.(*useragent).GetAllRandom(0x140016a7ab8?)
	/Users/ashishb/go/pkg/mod/github.com/!e!d!d!y!c!j!y/fake-useragent@v0.2.0/useragent/warehouse.go:50 +0x12c
github.com/EDDYCJY/fake-useragent.(*browser).Random(...)
	/Users/ashishb/go/pkg/mod/github.com/!e!d!d!y!c!j!y/fake-useragent@v0.2.0/browser.go:61
github.com/EDDYCJY/fake-useragent.Random(...)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions