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
- Fix memory leak in define_macro by properly freeing sb name buffer
- Add macro_cleanup() to free all macro data structures on exit
- Remove debug_log.h and DEBUG_LOG macros (no longer needed)
- Simplify sb_kill() to directly free memory instead of delayed free
- Update CLAUDE.md and CI workflow to reflect fixed memory issues
- Stress tests now pass with 100% success rate with or without ASAN
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Important**: Unit tests only run when ASAN is enabled. Without ASAN, MASP has known memory corruption bugs that cause crashes. Tests are automatically skipped when `ENABLE_ASAN=OFF`.
-`test/include/`: self-contained test dependencies
111
108
112
109
### Memory Safety
113
110
114
-
**Critical**: MASP has known memory corruption bugs that cause crashes (SIGABRT) without AddressSanitizer. ASAN is enabled by default and should only be disabled for production builds where performance is critical.
111
+
Memory management has been improved with the following changes:
112
+
- String buffer (`sb`) now properly frees memory in `sb_kill()`
113
+
- Removed old free-list mechanism that could cause corruption
114
+
- Added `macro_cleanup()` function to properly free macro data structures on exit
115
+
- Hash table key strings are properly managed via obstacks
116
+
- No memory leaks detected (verified with macOS `leaks` tool)
117
+
- Stress tests pass with 100% success rate with or without ASAN
115
118
116
-
When running with ASAN in CI/CD:
117
-
-Leak detection is disabled (`detect_leaks=0`)
118
-
-Known minor leaks (~36KB at exit) are not critical
119
-
-Focus is on crashes, buffer overflows, and use-after-free
119
+
ASAN configuration:
120
+
-ASAN is enabled by default in CMake (`-DENABLE_ASAN=ON`)
121
+
-Leak detection is disabled in CI (`detect_leaks=0`) for macOS compatibility
122
+
-Production builds can safely disable ASAN with `-DENABLE_ASAN=OFF`
0 commit comments