Skip to content

math/rand: Intn: panic index out of range #17629

@WanliTian

Description

@WanliTian

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.6.2 linux/amd64

What operating system and processor architecture are you using (go env)?

ubuntu 16.04 ts
Intel® Core™ i5-6200U CPU @ 2.30GHz × 4

panic: runtime error: index out of range

goroutine 550875 [running]:
panic(0xb494e0, 0xc82000a130)
        /home/eric/Code/Go/go/src/runtime/panic.go:481 +0x3e6
math/rand.(*rngSource).Int63(0xc820199500, 0x0)
        /home/eric/Code/Go/go/src/math/rand/rng.go:244 +0xc1
math/rand.(*Rand).Int63(0xc820231350, 0x98)
        /home/eric/Code/Go/go/src/math/rand/rand.go:46 +0x39
math/rand.(*Rand).Int31(0xc820231350, 0xc820d291e0)
        /home/eric/Code/Go/go/src/math/rand/rand.go:52 +0x21
math/rand.(*Rand).Int31n(0xc820231350, 0x1, 0x0)
        /home/eric/Code/Go/go/src/math/rand/rand.go:84 +0x8d
math/rand.(*Rand).Intn(0xc820231350, 0x1, 0xc8201daa24)
        /home/eric/Code/Go/go/src/math/rand/rand.go:101 +0x92

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions