develooper Front page | perl.perl5.porters | Postings from April 2019

Re: Storable and Leaky hooks which die

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
April 17, 2019 08:41
Subject:
Re: Storable and Leaky hooks which die
Message ID:
20190417084138.GC6612@iabyn.com
On Tue, Apr 16, 2019 at 09:02:11PM -0600, Karl Williamson wrote:
> On 4/16/19 8:12 PM, Tony Cook wrote:
> > On Wed, Apr 17, 2019 at 04:00:32AM +0200, Tomasz Konojacki wrote:
> > > On Wed, 17 Apr 2019 11:18:26 +1000
> > > Tony Cook <tony@develop-help.com> wrote:
> > > 
> > > > For some reason I'm not seeing any leaks from an ASAN build.
> > > > 
> > > >   ./Configure -des -Dusedevel -Accflags=-fsanitize=address -Aldflags=-fsanitize=address -DDEBUGGING -Doptimize=-O0\ -g -Dcc=/opt/gcc-8.2.0/bin/gcc
> > > > 
> > > > valgrind picked up a leak of the ptr table from your example which is
> > > > fixed in 1d7b2a7e3a7a0e05c254d065923488b768eb3ce0.
> > > > 
> > > > Tony
> > > 
> > > To enable leak detection in ASAN you need -fsanitize=leak flag.
> > > -fsanitize=address is just for memory errors.
> > 
> > Yeah, I tried that too (ie. both address and leak).
> > 
> > https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
> > 
> > implies that -fsanitize=leak isn't needed if you have
> > -fsanitize=address.
> > 
> > Tony
> > 
> 
> But it also says you need to set
>  export ASAN_OPTIONS=detect_leaks=1

I use the clang that comes with Fedora 29:

    $ clang --version
    clang version 7.0.1 (Fedora 7.0.1-6.fc29)

With that version, leak detection is enabled by default with
-fsanitize=address, and until very recently I was manually disabling it
with 'export ASAN_OPTIONS=detect_leaks=0'

My full invocation is

$ export PERL_DESTRUCT_LEVEL=2
$ ( sh Configure -des -Dusedevel -Dprefix=/home/davem/perl5/git/bleed.out -Uinstallusrbinperl -Duseithreads -Doptimize='-g'  -Accflags='-DDEBUGGING -ggdb -fsanitize=address' -Aldflags='-fsanitize=address' -Dcc=clang && TEST_JOBS=8  HARNESS_OPTIONS=j8  make  -j 8 test_harness) > stdout.log 2> stderr.log

However, I note that Tony's Storage patch seems to have fixed the issue
ASan was complaining about. So I'll revert my "skip leaky Storable tests"
commit.

I've been working to make blead clean under ASan leak detection - so far
just under a threaded debugging build. I'm just left some with DB_File
failures.  It's possible that other build options may still leak. It's
also possible that valgrind will spot issues (or false positives) that ASan
doesn't and vice/versa. Karl has recently pointed out to me that
t/comp/colon.t fails under valgrind, although I haven't looked at that in
detail yet.


-- 
"I do not resent criticism, even when, for the sake of emphasis,
it parts for the time with reality".
    -- Winston Churchill, House of Commons, 22nd Jan 1941.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About