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

Stack Size increased with 1.18.x (platform-tools) #35543

Closed
adrena-orex opened this issue May 4, 2024 · 2 comments
Closed

Stack Size increased with 1.18.x (platform-tools) #35543

adrena-orex opened this issue May 4, 2024 · 2 comments
Labels
community Community contribution

Comments

@adrena-orex
Copy link

Problem

Programs built with solana 1.18.x experience new stack size related issues.

Details

We started having issues after migrating from solana 1.16.16 and anchor 0.28.0 to solana 1.18.11 and anchor 0.29.0.

Started getting messages when building informing us of our ix using too much stack, i.e:

Error: Function _ZN145_$LT$adrena..instructions..add_custody..AddCustody$u20$as$u20$anchor_lang..Accounts$LT$adrena..instructions..add_custody..AddCustodyBumps$GT$$GT$12try_accounts17h13b564b67762dd31E Stack offset of 4232 exceeded max offset of 4096 by 136 bytes, please minimize large stack variables

Then at runtime:

'Program 76FLzSMB8xPPt2y4ZKWeMiQBnXnqvU2xyJtc4PogsxMa consumed 2523 of 200000 compute units',
'Program 76FLzSMB8xPPt2y4ZKWeMiQBnXnqvU2xyJtc4PogsxMa failed: Access violation in stack frame 5 at address 0x200005ff0 of size 8'

Hotfixed the issue by splitting IXs and migrating accounts to use zero_copy.

We have noticed that the init of accounts takes a lot of stack, 800 bytes+. Can't have more than 3 accounts to init within the same instruction atm.

Note: Even when testnet tests works, it may still fail on devnet.

Setup:

orex> solana --version
solana-cli 1.18.11 (src:c78a9720; feat:3469865029, client:SolanaLabs)
orex> anchor --version
anchor-cli 0.29.0
orex> solana cluster-version                                                                                             
1.18.12
orex> solana config get
Config File: /Users/orex/.config/solana/cli/config.yml
RPC URL: https://api.devnet.solana.com 
WebSocket URL: wss://api.devnet.solana.com/ (computed)
Keypair Path: /Users/orex/.config/solana/id.json 
Commitment: processed

Using https://github.com/anza-xyz/platform-tools/releases v1.41 to compile.

Related

Found an issue here talking about platform tools growing stack usage.

Proposed Solution

@adrena-orex adrena-orex added the community Community contribution label May 4, 2024
Copy link
Contributor

github-actions bot commented May 4, 2024

This repository is no longer in use. Please re-open this issue in the agave repo: https://github.com/anza-xyz/agave

@github-actions github-actions bot closed this as completed May 4, 2024
@code-brewer
Copy link

I have the same issue with 1.18.10 . Any solution to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

No branches or pull requests

2 participants