[BUG] Refactor recursive tree traversal to avoid Stack Overflow #14

Open
opened 2026-02-14 21:21:13 +00:00 by thabeta · 0 comments
Owner

The pack_unpack tests in src/lib.rs currently require a manually spawned thread with a 16MB stack to prevent crashes.

Issue: This indicates that the recursive visitor pattern used for tree traversal is not safe for default stack sizes (typically 2MB). Processing deep directory structures in production will likely lead to stack overflow crashes.

Proposed Fix: Refactor the tree traversal logic to use an iterative approach with a heap-allocated stack.

The pack_unpack tests in src/lib.rs currently require a manually spawned thread with a 16MB stack to prevent crashes. Issue: This indicates that the recursive visitor pattern used for tree traversal is not safe for default stack sizes (typically 2MB). Processing deep directory structures in production will likely lead to stack overflow crashes. Proposed Fix: Refactor the tree traversal logic to use an iterative approach with a heap-allocated stack.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_fs#14
No description provided.