You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stack frame for each function in SBFv1 is limited to 4kb. Although there is a soft error telling people to minimize stack variables, we still emit binaries for those contracts that override their stack. This can lead to undefined behavior during execution.
Furthermore, the logic to emit the existing warnings is broken, because it does not detect all cases.
Proposed Solution
Fix the detection logic and improve it with a more meaningful message, informing the calculated frame size.
Detect when we write function call arguments over existing data on the stack.
Stop compilation in the above cases.
Check if there is a way to surface these error to rustc for better user experience.
Check if there are any passes on either rustc or LLVM that interferes with stack usage.
Assist Anchor in decreasing stack usage of their functions before a compiler release.
The text was updated successfully, but these errors were encountered:
LucasSte
changed the title
Do not emit a binary when a function access a stack offset outside its frame.
Do not emit a binary when a function access a stack offset outside its frame
Jun 13, 2024
Problem
The stack frame for each function in SBFv1 is limited to 4kb. Although there is a soft error telling people to minimize stack variables, we still emit binaries for those contracts that override their stack. This can lead to undefined behavior during execution.
Furthermore, the logic to emit the existing warnings is broken, because it does not detect all cases.
Proposed Solution
The text was updated successfully, but these errors were encountered: