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

sdk: Do not derive AbiEnum on InstructionError for Solana builds #35038

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

joncinque
Copy link
Contributor

Problem

The AbiEnumVisitor derivation on InstructionError blows out the stack space for Solana builds, giving the error:

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

Summary of Changes

Since these tests aren't useful for on-chain program builds, and only run with the nightly compiler anyway, don't derive the trait for on-chain programs.

Fixes #35003

@joncinque joncinque added the v1.18 PRs that should be backported to v1.18 label Feb 1, 2024
Copy link
Contributor

mergify bot commented Feb 1, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0569304) 81.6% compared to head (1409c4a) 81.6%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #35038   +/-   ##
=======================================
  Coverage    81.6%    81.6%           
=======================================
  Files         830      830           
  Lines      224828   224821    -7     
=======================================
+ Hits       183504   183516   +12     
+ Misses      41324    41305   -19     

@joncinque joncinque merged commit 3646291 into solana-labs:master Feb 1, 2024
46 checks passed
@joncinque joncinque deleted the abi-not-solana branch February 1, 2024 23:00
mergify bot pushed a commit that referenced this pull request Feb 1, 2024
joncinque added a commit that referenced this pull request Feb 2, 2024
…ds (backport of #35038) (#35045)

sdk: Do not derive AbiEnum on InstructionError for Solana builds (#35038)

(cherry picked from commit 3646291)

Co-authored-by: Jon C <[email protected]>
@Lu-Derik
Copy link

I am using solana 1.18.18 and anchor 0.30.1, but I still have this same error. Can I just simply ignore this error as the program seemly works well in my testing.

$ anchor --version
anchor-cli 0.30.1
$ solana --version
solana-cli 1.18.18 (src:83047136; feat:4215500110, client:SolanaLabs)

Error:
Error: Function ZN141$LT$arec_sol..instructions..init_arec..InitArec$u20$as$u20$anchor_lang..Accounts$LT$arec_sol..instructions..init_arec..InitArecBumps$GT$$GT$12try_accounts17h2545e1ac6684da4dE Stack offset of 4872 exceeded max offset of 4096 by 776 bytes, please minimize large stack variables
Error: Function ZN149$LT$arec_sol..instructions..mint_arec..MintArtToken$u20$as$u20$anchor_lang..Accounts$LT$arec_sol..instructions..mint_arec..MintArtTokenBumps$GT$$GT$12try_accounts17hbb07c5d632ca833eE Stack offset of 4616 exceeded max offset of 4096 by 520 bytes, please minimize large stack variables
Finished release [optimized] target(s) in 0.16s
Finished test profile [unoptimized + debuginfo] target(s) in 0.17s
Running unittests src/lib.rs (/home/ldru/solana/arec-sol/target/debug/deps/arec_sol-b267794b86ffef59)

@joncinque
Copy link
Contributor Author

The issue you're seeing is unrelated to the bug fixed in this PR, and is related to Anchor. There is some info about it at anza-xyz#1186

@solana-labs solana-labs locked as resolved and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
v1.18 PRs that should be backported to v1.18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack error log on 1.18.0 release
3 participants