-
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
[Codegen] Recursive fallback function call runs out of gas via legacy but does not via IR #13216
Comments
I'm labeling this |
I think this may be spurious after all - and just a crazy thing happening here :-). What I guess will happen is that the last recursive call to |
Or to be even clearer: the maximum forwarded gas is 63/64 of the available gas. |
Several of the recursive calls may manage to return with the available gas - when I added some event to the code example (which of course skews gas costs, so it won't be exactly the same), I saw somewhere between 100 and 200 calls succeeding. |
@ekpyron Isn't |
That's true... although my guess would be that one could construct similar cases without that... on the other hand, trying that, it's not that easy :-). Overwriting the free memory pointer there, may mainly result in weird data to be passed during the recursive call, though. |
Hm... or maybe I was wrong before and there's something else happening here... maybe worth another look in any case :-). |
Okay, in the meantime I will work on avoiding writes to free memory ptr while generating test cases. For the time being, I could template all memory writes to start at |
Make it What's strictly speaking always well-defined is would be
(given that And
But we also need to make sure not to restrict this too much in order not to miss anything... |
This would be
What does this mean? |
I meant choosing between either of them. And actually But in any case, I don't think we should fully restrict to those cases, i.e. your suggestion of using a fixed offset may be better. We want the fuzzer to occasionally dirty previously allocated memory after all. |
@bshastry what is the impact of this bug (High, Medium, Low)? |
I would say low if at all. There is the possibility that this is not a bug because overwriting the free memory pointer is essentially undefined behavior. |
Legacy: FAILURE
IR: Pass
The text was updated successfully, but these errors were encountered: