ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Memory leak debugging - current master passes all tests!

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Tue, 29 Jan 2019 09:15:50 -0500

On Mon, Jan 28, 2019 at 4:03 PM Peter Wu <peter@xxxxxxxxxxxxx> wrote:
If you have not already, consider enabling ASAN by default in your
development builds (cmake -DENABLE_ASAN=1). It works on Linux and macOS,
but not with MSVC. ASAN detect memory safety issues (use-after-free,
double-free, buffer overflows, etc.) and is faster than valgrind.

If you do need valgrind, note that ASAN is not compatible with it. In
this case, simply create another build directory without ASAN.

If you are just interested in memory safety checks, but not memory leak
debugging, simply disable the latter with:

    export ASAN_OPTIONS=detect_leaks=0

These ASAN options are documented at
https://github.com/google/sanitizers/wiki/AddressSanitizerFlags

Nice info.  I had wondered at some points how to run ASAN but not enough to do the (probably minimal) research.  Could I suggest putting the info in a Wiki page?  (When I look for info I look in the READMEs and the wiki; I rarely search the email archives unless I remember what I was looking for being there.)