Closed iabyn closed 5 years ago
Thanks @iabyn - think I see where the problem is.
Need to build a Perl with address sanatizer to reproduce first.
@iabyn do you have a list of the sanitizer options used when building your perl binary?
Could you post the output from running perl -V
please? Think that would show them.
On Wed, Apr 17, 2019 at 02:55:16PM -0700, Paul Marquess wrote:
@iabyn do you have a list of the sanitizer options used when building your perl binary?
Could you post the output from running
perl -V
please? Think that would show them.
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
when running the tests, you need to set these env vars:
PERL_DESTRUCT_LEVEL=2
to avoid lots of false positives, and possibly
ASAN_OPTIONS=detect_leaks=1
if leak detection isn't enabled by default for that clang.
-- Any [programming] language that doesn't occasionally surprise the novice will pay for it by continually surprising the expert. -- Larry Wall
Thanks @iabyn, will give that a go
Reproduced the issue
Direct leak of 136 byte(s) in 1 object(s) allocated from:
#0 0x4f47d0 in malloc ??:?
#1 0x4f47d0 in ?? ??:0
#2 0xafeda0 in Perl_safesysmalloc /home/paul/base/zip/perl/perl-5.28.1/util.c:153
#3 0xafeda0 in ?? ??:0
#4 0x7fb56bddc713 in ParseOpenInfo /home/paul/perl/ext/DB_File/DB_File.xs:1276
#5 0x7fb56bddc713 in ?? ??:0
#6 0x7fb56bd87857 in XS_DB_File_DoTie_ /home/paul/perl/ext/DB_File/DB_File.xs:1585
#7 0x7fb56bd87857 in ?? ??:0
...
Issue fixed in change de98123c5d272f5da7d2cfc433276fb9fe8efd7b. Closing issue.
ParseOpenInfo() initially mallocs a DB_File_type buf. If it then croaks for any reason, this buffer leaks. This shows up in bleadperl as failing tests under clang's Address Sanitizer. A sample failure script (reduced from db-btree.t) is