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

Getting runtime error: invalid memory address or nil pointer dereference while trying to validate genesis file #13550

Closed
HelmiTrabelsi opened this issue Oct 14, 2022 · 1 comment · Fixed by #13553
Assignees

Comments

@HelmiTrabelsi
Copy link

Summary of Bug

When I try to validate the genesis.json I get this invalid memory address or nil pointer dereference. I tried to run the same cmd with the same genesis file on an arch-based Linux machine and it works correctly.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x12906d8]

goroutine 1 [running]:
math/big.(*Int).Sign(...)
math/big/int.go:39
github.com/cosmos/cosmos-sdk/types.Dec.IsNegative(...)
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/types/decimal.go:208
github.com/cosmos/cosmos-sdk/x/staking/types.validateMinCommissionRate({0x25383e0?, 0x0?})
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/x/staking/types/params.go:225 +0x58
github.com/cosmos/cosmos-sdk/x/staking/types.Params.Validate({0x6722feb7b0000, 0x64, 0x7, 0x2710, {0xc00143a9c8, 0x6}, {0x0}})
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/x/staking/types/params.go:134 +0xcf
github.com/cosmos/cosmos-sdk/x/staking.ValidateGenesis(0xc000021380)
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/x/staking/genesis.go:46 +0x85
github.com/cosmos/cosmos-sdk/x/staking.AppModuleBasic.ValidateGenesis({{0x70000c0016bf758, 0x22ffffffffffffff}}, {0x31c84f8, 0xc0014406d0}, {0xc0000981b8?, 0xc000e04f48?}, {0xc00017e9c0, 0x18e, 0x1a0})
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/x/staking/module.go:70 +0xf1
github.com/cosmos/cosmos-sdk/types/module.BasicManager.ValidateGenesis(0xc000d8d500?, {0x31c84f8, 0xc0014406d0}, {0x7f75d0cbba78, 0xc0013804c0}, 0x0?)
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/types/module/module.go:101 +0x117
github.com/cosmos/cosmos-sdk/x/genutil/client/cli.ValidateGenesisCmd.func1(0xc000c1fb80?, {0x469d750, 0x0, 0x0?})
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/x/genutil/client/cli/validate_genesis.go:47 +0x21f
github.com/spf13/cobra.(*Command).execute(0xc000c1fb80, {0x469d750, 0x0, 0x0})
github.com/spf13/cobra@v1.5.0/command.go:872 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc000c1ea00)
github.com/spf13/cobra@v1.5.0/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.5.0/command.go:918
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/cobra@v1.5.0/command.go:911
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x20562e0?, {0x255ef6c, 0x6}, {0xc0010d0ea0, 0x14})
github.com/cosmos/cosmos-sdk@v0.46.2-0.20220831122102-a95c62680975/server/cmd/execute.go:36 +0x20f
main.main()
github.com/evmos/evmos/v9/cmd/evmosd/main.go:20 +0x45

Version

Ubuntu 20.04.1
go version 1.19.2

Steps to Reproduce

evmosd validate-genesis

@PinkFromTheFuture
Copy link

I can reproduce it on an Kubuntu system (ubuntu based)
But the command works well on an EndeavourOS machine (arch based)

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

Successfully merging a pull request may close this issue.

3 participants