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

Random Fuzzer panic: invalid argument to Intn #4362

Closed
4 tasks
npinto opened this issue May 17, 2019 · 1 comment · Fixed by #4365
Closed
4 tasks

Random Fuzzer panic: invalid argument to Intn #4362

npinto opened this issue May 17, 2019 · 1 comment · Fixed by #4365
Assignees
Labels

Comments

@npinto
Copy link
Contributor

npinto commented May 17, 2019

Summary of Bug

go test ./cmd/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=500 -SimulationGenesis= -SimulationVerbose=true -SimulationCommit=true -SimulationSeed=7601778 -SimulationPeriod=50 -v -timeout 24h

fails with the following error message:

--- FAIL: TestFullGaiaSimulation (0.11s)
panic: invalid argument to Intn [recovered]
        panic: invalid argument to Intn

goroutine 26 [running]:
testing.tRunner.func1(0xc0004b3e00)
        /snap/go/3739/src/testing/testing.go:830 +0x392
panic(0xe5c820, 0x1295c00)
        /snap/go/3739/src/runtime/panic.go:522 +0x1b5
math/rand.(*Rand).Intn(0xc0000f8ff0, 0x0, 0xc0004b0b40)
        /snap/go/3739/src/math/rand/rand.go:169 +0x9c
github.com/cosmos/cosmos-sdk/x/simulation.GetMemberOfInitialState(0xc0000f8ff0, 0xc00003d720, 0x3, 0x3, 0x1)
        /home/cosmos/go/src/github.com/cosmos/cosmos-sdk/x/simulation/transition_matrix.go:61 +0x57
github.com/cosmos/cosmos-sdk/x/simulation.newMockValidators(0xc0000f8ff0, 0xc001240000, 0x11, 0x24, 0x3fe8ce8eddf631bd, 0xc4, 0x3fef72b3d35c098b, 0xc00003d720, 0x3, 0x3, ...)
        /home/cosmos/go/src/github.com/cosmos/cosmos-sdk/x/simulation/mock_tendermint.go:37 +0x168
github.com/cosmos/cosmos-sdk/x/simulation.initChain(0xc0000f8ff0, 0x3fe8ce8eddf631bd, 0xc4, 0x3fef72b3d35c098b, 0xc00003d720, 0x3, 0x3, 0xc0000eab90, 0x3, 0x3, ...)
        /home/cosmos/go/src/github.com/cosmos/cosmos-sdk/x/simulation/simulate.go:47 +0x1e8
github.com/cosmos/cosmos-sdk/x/simulation.SimulateFromSeed(0x12dac80, 0xc0004b3e00, 0x12accc0, 0xc0000c2008, 0xc0000ee7e0, 0x1153ba8, 0x73fe72, 0xc00007fc20, 0xf, 0xf, ...)
        /home/cosmos/go/src/github.com/cosmos/cosmos-sdk/x/simulation/simulate.go:80 +0x604
github.com/cosmos/cosmos-sdk/cmd/gaia/app.TestFullGaiaSimulation(0xc0004b3e00)
        /home/cosmos/go/src/github.com/cosmos/cosmos-sdk/cmd/gaia/app/sim_test.go:376 +0x375
testing.tRunner(0xc0004b3e00, 0x1153b68)
        /snap/go/3739/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
        /snap/go/3739/src/testing/testing.go:916 +0x35a
FAIL    github.com/cosmos/cosmos-sdk/cmd/gaia/app       0.234s

Version

$ gaiad version --long
gaia: 0.34.3-128-g3153e934
git commit: 3153e93446ad5cda029b96c408c2bbfb1b91adc1
build tags: netgo,ledger
go version go1.12.5 linux/amd64
$ gaiacli version --long
gaia: 0.34.3-128-g3153e934
git commit: 3153e93446ad5cda029b96c408c2bbfb1b91adc1
build tags: netgo,ledger
go version go1.12.5 linux/amd64

Steps to Reproduce

go test ./cmd/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=500 -SimulationGenesis= -SimulationVerbose=true -SimulationCommit=true -SimulationSeed=7601778 -SimulationPeriod=50 -v -timeout 24h


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
npinto added a commit to npinto/cosmos-sdk that referenced this issue May 17, 2019
Add a new seed that elicits the bug described in cosmos#4362
@rigelrozanski
Copy link
Contributor

Thanks for submitting this bug - I'll tryn' fix right away

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

Successfully merging a pull request may close this issue.

2 participants