-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem
Currently, stackman provides stack switching but no built-in overflow detection. Users must manually implement guard pages or canaries.
Proposal
Add optional stack overflow detection helpers:
-
Guard zone utilities:
stackman_guard_init(void *stack, size_t size, size_t guard_bytes)- Initialize guard patternstackman_guard_check(void *stack, size_t size, size_t guard_bytes)- Verify guard intact
-
Stack usage tracking:
stackman_stack_usage(void *stack_base, size_t size)- Measure actual usage via stack painting
Benefits
- Easier debugging of stack-related crashes
- Production overflow detection
- Helps users size stacks appropriately
Implementation
Could be a separate header (stackman_debug.h) to keep core library minimal.
Related
test_04 already uses basic guard bytes for validation - could formalize this pattern.
Metadata
Metadata
Assignees
Labels
No labels