Finding Memory Leaks in C/C++ Programs via Neuro-Symbolic Augmented Static Analysis
Huihui Huang, Jieke Shi, Bo Wang, Zhou Yang, and David Lo

TL;DR
MemHint is a neuro-symbolic static analysis pipeline that improves memory leak detection in C/C++ by combining LLM semantic understanding with symbolic reasoning, surpassing existing tools.
Contribution
It introduces a novel approach that integrates LLMs and Z3-based symbolic reasoning into static analysis to recognize project-specific memory management functions.
Findings
MemHint detects 52 memory leaks in real-world projects, outperforming CodeQL and Infer.
The approach confirms 49 leaks and submits 4 CVEs, demonstrating practical effectiveness.
Cost per bug detected is approximately $1.7, showing efficiency.
Abstract
Memory leaks remain prevalent in real-world C/C++ software. Static analyzers such as CodeQL provide scalable program analysis but frequently miss such bugs because they cannot recognize project-specific custom memory-management functions and lack path-sensitive control-flow modeling. We present MemHint, a neuro-symbolic pipeline that addresses both limitations by combining LLMs' semantic understanding of code with Z3-based symbolic reasoning. MemHint parses the target codebase and applies an LLM to classify each function as a memory allocator, deallocator, or neither, producing function summaries that record which argument or return value carries memory ownership, extending the analyzer's built-in knowledge beyond standard primitives such as malloc and free. A Z3-based validation step checks each summary against the function's control-flow graph, discarding those whose claimed memory…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
