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

'decoder.go / encoder.go' overflows int issue when cross compile c(for android) #245

Closed
Lunagram opened this issue Nov 12, 2018 · 5 comments

Comments

@Lunagram
Copy link

I've cross-compile cosmos-sdk v0.26.1-rc1 with c(androideabi).
However, an error has occurred.

[Got message]
../../../../vendor/github.com/tendermint/go-amino/decoder.go:246:44: constant -62135596800 overflows int
../../../../vendor/github.com/tendermint/go-amino/decoder.go:246:44: constant 253402300800 overflows int
../../../../vendor/github.com/tendermint/go-amino/encoder.go:147:38: constant -62135596800 overflows int
../../../../vendor/github.com/tendermint/go-amino/encoder.go:147:38: constant 253402300800 overflows int

[Please change both files.]
1. go-amino/decoder.go:246
return 0, n, InvalidTimeErr(fmt.Sprintf("seconds have to be > %d and < %d, got: %d",
minSeconds, maxSeconds, res))

to

return 0, n, InvalidTimeErr(fmt.Sprintf("seconds have to be > %d and < %d, got: %d",
int64(minSeconds), int64(maxSeconds), res))

2. go-amino/encoder.go:147
return InvalidTimeErr(fmt.Sprintf("seconds have to be >= %d and < %d, got: %d",
minSeconds, maxSeconds, s))

to

return InvalidTimeErr(fmt.Sprintf("seconds have to be >= %d and < %d, got: %d",
int64(minSeconds), int64(maxSeconds), s))

Thank you for your hard work.

@liamsi
Copy link
Contributor

liamsi commented Nov 12, 2018

Thanks for raising this issue! This should have been fixed with #242 though. Did you try to cross-compile amino from the latest master, or the tagged release 0.14.1?
Thanks again!

@liamsi
Copy link
Contributor

liamsi commented Nov 12, 2018

@Lunagram
Copy link
Author

Lunagram commented Nov 12, 2018

I'm, sorry. I accidentally made a pull request to the master brench.

@liamsi
Copy link
Contributor

liamsi commented Nov 12, 2018

No problem. We can change the base branch to develop. Thanks! I'm still sure this problem doesn't exist in the latest release though. Can you try to cross-compile amino 0.14.1? Does the problem still persist?

@Lunagram
Copy link
Author

The issue has been resolved with 0.14.1! Thank you!

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

No branches or pull requests

2 participants