-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Large Stack Variables Error in Anchor 0.29.0 #2835
Comments
After I do this, the error still appears, but when I import the code into solana playground, the compiled program can be called normally. |
Does it only happen in Also, this error is more of a warning and usually doesn't cause runtime errors. Does it work if you test it locally? |
In local testing the instruction is called correctly, but when I build and deploy to devnet the instruction is called with an error |
Also seeing something similar but in a different place.
I suspect there is something up with the latest solana program or cli. I'm on |
Hey @acheroncrypto we upgraded a different program to v29 and got a Stack offset exceeded max offset by a huge amount. Could the bumps change cause an increased stack usage by any chance? |
Yes, the bumps change increased the stack usage slightly but it shouldn't be a huge amount. Did you also upgrade to Some people have reported an issue regards to it but not a lot. Does #2766 fix your issue? |
I did yeah, I haven't checked, will do and get back. Could it be possible the new struct is over allocating if you cross a threshold of accounts? |
I think it may be getting copied multiple times since the fields are |
okay I will investigate a bit further and get back |
Related: anza-xyz/agave#252 |
Solana 1.18.8 includes fixes to memory related issues (anza-xyz/agave#362). Try to see if upgrading fixes this problem. |
stack offset problems associated with bumps still exist |
same here, i was getting some errors with stack size in 0.28.0 and thought of giving 0.29.0 a try again because someone told me that 0.29.0 reduces heap stack a little. in 0.28.0 my stack would only exceed by 40 bytes or so in 0.29.0 it exceeds by a whopping 1368 bytes (even if I try https://github.com/febo/anchor boxed bumps) And before we blame it in the handler, my entire handler is commented out, it just returns |
@acheroncrypto I dont think the issue is fixed in 1.18.8. Can you think of anything that changed in 1.18 that could be causing this |
Same issue here, Boxing helps, but not enough |
We still get issues with |
I encountered an error when I tried to compile my Solana program (https://github.com/chenmoonmo/anchor-dex):
Error: Function ZN157$LT$anchor_dex..instructions..init_pool..InitializePool$u20$as$u20$anchor_lang..Accounts$LT$anchor_dex..instructions..init_pool..InitializePoolBumps$GT$$GT$12try_accounts17hc6503ec5b47d6f18E Stack offset of 5672 exceeded max offset of 4096 by 1576 bytes, please minimize large stack variables
how can i fix it?
rustc 1.76.0
anchor-cli 0.29.0
solana-cli 1.18.3
solana-program 1.18.3
The text was updated successfully, but these errors were encountered: