Files
hakmem/run_with_debug.sh
Moe Charm (CI) 4ef0171bc0 feat: Add ACE allocation failure tracing and debug hooks
This commit introduces a comprehensive tracing mechanism for allocation failures within the Adaptive Cache Engine (ACE) component. This feature allows for precise identification of the root cause for Out-Of-Memory (OOM) issues related to ACE allocations.

Key changes include:
- **ACE Tracing Implementation**:
  - Added  environment variable to enable/disable detailed logging of allocation failures.
  - Instrumented , , and  to distinguish between "Threshold" (size class mismatch), "Exhaustion" (pool depletion), and "MapFail" (OS memory allocation failure).
- **Build System Fixes**:
  - Corrected  to ensure  is properly linked into , resolving an  error.
- **LD_PRELOAD Wrapper Adjustments**:
  - Investigated and understood the  wrapper's behavior under , particularly its interaction with  and  checks.
  - Enabled debugging flags for  environment to prevent unintended fallbacks to 's  for non-tiny allocations, allowing comprehensive testing of the  allocator.
- **Debugging & Verification**:
  - Introduced temporary verbose logging to pinpoint execution flow issues within  interception and  routing. These temporary logs have been removed.
  - Created  to facilitate testing of the tracing features.

This feature will significantly aid in diagnosing and resolving allocation-related OOM issues in  by providing clear insights into the failure pathways.
2025-12-01 16:37:59 +09:00

17 lines
483 B
Bash
Executable File

#!/bin/bash
export HAKMEM_DEBUG_LEVEL=5
for i in $(seq 1 50); do
seed=$RANDOM
echo "=== Run $i seed=$seed ==="
./bench_random_mixed_hakmem 100000 512 $seed 2>&1 | tail -100 > /tmp/debug_$i.log
exitcode=$?
if [ $exitcode -eq 139 ]; then
echo "CRASH on run $i seed=$seed!"
cp /tmp/debug_$i.log crash_debug_output.log
echo "Last 50 lines before crash:"
tail -50 /tmp/debug_$i.log
exit 0
fi
done
echo "No crash in 50 runs"