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

Error message when stack size exceeded by 0 (zero!) bytes #110

Closed
ComradePashka opened this issue Oct 22, 2024 · 1 comment
Closed

Error message when stack size exceeded by 0 (zero!) bytes #110

ComradePashka opened this issue Oct 22, 2024 · 1 comment

Comments

@ComradePashka
Copy link

ComradePashka commented Oct 22, 2024

Hi!

Recently I created Solana Program using Anchor framework and got error message about exceeded stack size, so I "Boxed" accounts and got stack size exactly 4096 bytes, however error message remained:

Error: Function _ZN155_$LT$mint_ware..instructions..project_init..ProjectInit$u20$as$u20$anchor_lang..Accounts$LT$mint_ware..instructions..project_init..ProjectInitBumps$GT$$GT$12try_accounts17hc5baac49fbda26d4E Stack offset of 4096 exceeded max offset of 4096 by 0 bytes, please minimize large stack variables

Seems, that on line

if (Offset <= MaxOffset) {
comparision should trigger Error only when Offset is less than (<) MaxOffset, but not less-or-equal (<=)

Exceeding by 0 bytes shouldn't be an error, right?

Thank you!

@LucasSte
Copy link
Collaborator

LucasSte commented Dec 6, 2024

You're using an outdated version of platform tools. The comparison is actually less than, instead of less than or equal:

if (Offset < MaxOffset) {

@LucasSte LucasSte closed this as completed Dec 6, 2024
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