Skip to content

Commit ba4e372

Browse files
hbgitclaude
andcommitted
fix(valgrind): suppress libstdc++ static-init exception pool
ctest -T memcheck flagged "Defects: 1 (Potential Memory Leak)" on every test binary — including HeapLogTest, which has no real memory defect (ERROR SUMMARY: 0). The block is the 72,704-byte libstdc++ emergency exception pool allocated once by eh_alloc.cc's static initializer and intentionally never freed; with -static-libstdc++ the frame appears as _GLOBAL__sub_I_eh_alloc.cc in the binary itself, so the existing __cxa_get_globals suppression never matched. Suppression stack captured with --gen-suppressions=all in the exact CI environment (Ubuntu 22.04, clang-16, Valgrind 3.18 via the map2check-dev Docker image). With it, the full 6-test ctest -T memcheck suite reports 0 defects and exits 0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ca2692c commit ba4e372

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

valgrind.supp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@
2626
}
2727

2828
# --- libstdc++: pool de emergência para exceções (alocado uma vez, by design) ---
29+
# 72.704 bytes "still reachable" alocados pelo inicializador estático de
30+
# eh_alloc.cc; nunca liberados de propósito (usados para lançar bad_alloc
31+
# em OOM). O ctest -T memcheck conta como "Potential Memory Leak" sem esta
32+
# supressão. Stack verificado no ambiente do CI (Ubuntu 22.04, clang-16,
33+
# -static-libstdc++, Valgrind 3.18).
34+
{
35+
libstdcpp-eh-pool-static-init
36+
Memcheck:Leak
37+
match-leak-kinds: reachable
38+
fun:malloc
39+
fun:_GLOBAL__sub_I_eh_alloc.cc
40+
}
41+
# Variante para libstdc++ linkada dinamicamente (mesmo pool, outro stack).
2942
{
3043
libstdcpp-eh-pool
3144
Memcheck:Leak

0 commit comments

Comments
 (0)