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

Value exceeds 64 bits #190

Closed
hugo-dc opened this issue Apr 23, 2018 · 5 comments · Fixed by #247
Closed

Value exceeds 64 bits #190

hugo-dc opened this issue Apr 23, 2018 · 5 comments · Fixed by #247
Assignees
Labels

Comments

@hugo-dc
Copy link
Member

hugo-dc commented Apr 23, 2018

I wrote a new test case in order to validate that we get an OOG exception when there is a call sending a value and the value is higher than the current sender Balance. Instead the result is the following:

100%
Executing...
importGlobals
DEBUG printMemHex(0x14:0x20): 20 a1 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
InternalError: Value exceeds 64 bits.
Executing...
importGlobals
DEBUG printMemHex(0x14:0x20): 20 a1 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
InternalError: Value exceeds 64 bits.

if (safeLoadUint64(balance) < safeLoadUint64(value))

Here it is comparint the balance and value, both are u128 and it is being validated by a function that validates 64 bit numbers.

@axic
Copy link
Member

axic commented Apr 23, 2018

This is also an endianess issue.

@axic
Copy link
Member

axic commented Apr 23, 2018

Also there should be test cases for using > 64 bit values.

@jwasinger
Copy link
Contributor

jwasinger commented Apr 27, 2018

Related: ewasm/evm2wasm#219

@axic
Copy link
Member

axic commented May 15, 2018

The other problem here is that ensureSenderBalance is just broken, because it uses safeLoadUin128, which truncates the value into uin64_t.

ensureSenderBalance should be rewritten to properly handle the values.

@jakelang jakelang self-assigned this May 29, 2018
@jakelang jakelang removed their assignment May 29, 2018
@axic
Copy link
Member

axic commented Jun 1, 2018

Test case creation is tracked here: ewasm/tests#42

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.

4 participants