From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20401 invoked by alias); 10 Nov 2013 06:32:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20329 invoked by uid 48); 10 Nov 2013 06:32:11 -0000 From: "Joost.VandeVondele at mat dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/59061] Port leaksanitizer Date: Sun, 10 Nov 2013 06:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg00888.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59061 --- Comment #6 from Joost VandeVondele --- (In reply to Kostya Serebryany from comment #5) > > That's great... works even for Fortran code :-) > Wow! well, many thanks to those people making sanitizer happen, also in gcc. > > In performance-critical scenarios, LSan can also be used without ASan > > instrumentation. > > > > But it is unclear from that description how that would work.. any hints ? > > Clang supports -fsanitize=leak which simply links a standalone lsan library > (no instrumentation at compile time required). > Perhaps gcc can add such option too. I agree that such an option would be useful (see also below). For now, I put '-fsanitize=address' for the link step only, which has the same effect. Additionally, it seems important to have -g -fno-omit-frame-pointer in the options. Maybe gcc should add these options for best 'user experience', for example as part of -fsanitize=address/leak. Power users can always override with -fsanitize=leak -fomit-frame-pointer. > But: we do not test -fsanitize=leak on anything other than tiny tests, > so we truly support only the lsan+asan use case. It would be great to have -fsanitize=leak robust. For our testing purposes we can not have the overhead of -fsanitize=address (which for Fortran is largely, but not completely, covered by -fcheck=bounds). Anyway, first test on our codebase (~1Mloc) suggests it works well (modulo PR59063). I'll add -fsanitize=x to my nightly gcc trunk tester. > We'll need to update the wiki page to have this all explained in detail, > thanks for raising these questions. One more example for the wiki, that's how we can run this with cp2k ;-) time ASAN_OPTIONS="detect_leaks=1" ../../exe/Linux-x86-64-leaks/cp2k.sdbg C.inp 2>&1 | python /data/vjoost/gnu/bugs/asan_symbolize.py