-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Returning more than 4 variables from an external function causes an OOG error #1083
Comments
Since 0.4.0 there's a check to see if code exists at the specified address. If not, there's an invalid jump ("oog"). Practically that means you cannot use |
True, but you can deploy code with browser-solidity and pass the address. The issue also appears when executing the code in a pyetheruem test environment. |
Your above example can be deployed, because I don't have the issue you're reporting (neither 4 or 5 arguments work, because of the invalid address). If I deploy a non-abstract |
Try to deploy the first two contracts:
And you will see that calling foo in the 2nd contract will cause OOG if you pass the address from the first contract. |
On |
Thanks for checking @pirapira. I haven't tested it against geth, but it fails in browser-solc and with pyethereum. In browser |
@Georgi87 are you sure that a valid |
Yes, I am sure. The abstract This deployed
If there are issues reproducing this issue with browser-solc or pyetheruem I am ready to help. Ping me on gitter. |
I was able to reproduce this with |
Thanks for checking @axic |
The root cause here is that the memory resize costs are not properly taken into account for the return value. Before 0.4.0 we retained more gas with a call (not because of potential memory resize but because of potential account creation). Probably the best solution here would be to touch the memory before the call, though ethereum/EIPs#90 would be a better solution. |
Calling foo with the address of Events (
test_contract.foo(events_contract.address
) will fail at runtime with OOG if I return a, b, c, d, e:However, if I remove e from contracts and do the same transaction it works:
I added the two sources to this gist for testing:
https://ethereum.github.io/browser-solidity/#version=soljson-latest.js&optimize=true&gist=a7010392fd44542a8ff1e2ab3fd405d5
Tested with:
Version: 0.4.0+commit.acd334c.Linux.g++
Version: 0.4.1-develop.2016.09.09+commit.79867f4.Linux.g++
The text was updated successfully, but these errors were encountered: