0

I am still getting these errors upon Anchor build despite others claiming it has been solved by simply upgrading to solana-cli versions 18.2.0 and higher.

Error: Function _ZN112_$LT$solana_program..instruction..InstructionError$u20$as$u20$solana_frozen_abi..abi_example..AbiEnumVisitor$GT$13visit_for_abi17hf6d5ed38e659ed87E Stack offset of 4608 exceeded max offset of 4096 by 512 bytes, please minimize large stack variables

Error: Function _ZN147_$LT$lending..instructions..create_loan..CreateLoan$u20$as$u20$anchor_lang..Accounts$LT$lending..instructions..create_loan..CreateLoanBumps$GT$$GT$12try_accounts17h3b0541fc6820fe84E Stack offset of 4120 exceeded max offset of 4096 by 24 bytes, please minimize large stack variables

Error: Function _ZN147_$LT$lending..instructions..obtain_loan..ObtainLoan$u20$as$u20$anchor_lang..Accounts$LT$lending..instructions..obtain_loan..ObtainLoanBumps$GT$$GT$12try_accounts17h3772087e39923fa3E Stack offset of 4536 exceeded max offset of 4096 by 440 bytes, please minimize large stack variables

However, when I downgrade back to solana-cli version 1.16.25, the errors go away. But then my problem lies in deploying the program to mainnet, hence why I wish to upgrade in the first place.

1 Answer 1

0

The problem is associated with the solana-program crate. Explicitly setting it to 1.18.2 solved it for me.

 cargo update -p solana-program@<SOLANA_PROGRAM_VERSION> --precise 1.18.2

Replace <SOLANA_PROGRAM_VERSION> with the version your project is using.

you'll need to search for the solana-program that your program is using in the Cargo.lock file or use cargo tree

cargo tree | grep solana-program
1
  • 1
    Thanks. I have tried to update as you said, but unfortunately I have dependencies which are locked to versions of solana-program < 1.18.0. I'll come back to this after going through the crate inter-dependency nightmare with an update. Commented Jul 10 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.