Files
hakmem/core
Moe Charm (CI) 25a81713b4 Fix: Move g_hakmem_lock_depth++ to function start (27% → 70% success)
**Problem**: After previous fixes, 4T Larson success rate dropped 27% (4/15)

**Root Cause**:
In `log_superslab_oom_once()`, `g_hakmem_lock_depth++` was placed AFTER
`getrlimit()` call. However, the function was already called from within
malloc wrapper context where `g_hakmem_lock_depth = 1`.

When `getrlimit()` or other LIBC functions call `malloc()` internally,
they enter the wrapper with lock_depth=1, but the increment to 2 hasn't
happened yet, so getenv() in wrapper can trigger recursion.

**Fix**:
Move `g_hakmem_lock_depth++` to the VERY FIRST line after early return check.
This ensures ALL subsequent LIBC calls (getrlimit, fopen, fclose, fprintf)
bypass HAKMEM wrapper.

**Result**: 4T Larson success rate improved 27% → 70% (14/20 runs) 
+43% improvement, but 30% crash rate remains (continuing investigation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 03:03:07 +09:00
..