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
{{ message }}
Repository navigation
memtrack: VLA from map2check_map_non_static_alloca is a leak and takes size in bytes (SD-12) #38
map2check_map_non_static_alloca (used for variable-length arrays) differs from the legacy call in two ways. Documented as SD-12 in docs/semantic-deltas.md (PR #35).
It marks the record dynamic, so with map2check_set_memcleanup() on, a VLA that goes out of scope reports MEMSAFETY_MEMCLEANUP.
It stores size in bytes; the legacy contract passes an element count and multiplies by size_of_primitive. A caller following the legacy contract registers a block that is too small, and loads past it report MEMSAFETY_DEREF.
Reproduce (links against libmap2check.a, no features):
Legacy:map2check_non_static_alloca calls map2check_alloca(name, ptr, size * size_of_primitive, ...), a static slot (lib_old/AnalysisModeMemtrack.c:366-377 on origin/refactory_memory_log).
Likely cause:entry.set_malloc() and size as usize in map2check_map_non_static_alloca (rust/src/ffi.rs). The Rust semantics were reconstructed without the original source (see docs/api-deltas.md).
Activity
docs: link suspected regressions to their issues (#5)