Skip to content

Conversation

LucasSte
Copy link
Collaborator

@LucasSte LucasSte commented May 6, 2025

Problem

When building a Solana contract with Rust 1.84.1, we face a stack overflow warning coming from drift sort, Rust's new default sorting algorithm. It allocates 4096 bytes on the stack to avoid heap allocations.

Solution

Allocate only 2048 bytes for SBPFv0.

@LucasSte LucasSte force-pushed the fix-error-msg branch 2 times, most recently from a6fd4cf to 0e666ae Compare May 7, 2025 13:55
@LucasSte LucasSte requested a review from Lichtso May 8, 2025 10:51
@LucasSte LucasSte marked this pull request as ready for review May 8, 2025 10:51
@LucasSte LucasSte merged commit 7d0f408 into anza-xyz:solana-1.84.1 May 8, 2025
11 checks passed
@LucasSte LucasSte deleted the fix-error-msg branch May 8, 2025 15:05
LucasSte added a commit to LucasSte/rust that referenced this pull request Aug 21, 2025
LucasSte added a commit to LucasSte/rust that referenced this pull request Aug 21, 2025
LucasSte added a commit to LucasSte/rust that referenced this pull request Sep 12, 2025
LucasSte added a commit to LucasSte/rust that referenced this pull request Oct 9, 2025
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

Successfully merging this pull request may close these issues.

2 participants