Subject: | Aborts with GCC 4.8 Address Sanitizer pointing to error in sqlite lib |
When built with a perl 5.17.11 that was build with GCC 4.8 with the Address Sanitizer enabled, a test fails.
The Address Sanitizer reports points to sqlite3.c so it's probably a bug there not in DBD::SQlite itself.
Tim.
t/01_compile.t .............................. ok
# sqlite_version=3.7.12.1
=================================================================
==12614== ERROR: AddressSanitizer: global-buffer-overflow on address 0x000109a60309 at pc 0x109a2e895 bp 0x7fff59b98060 sp 0x7fff59b98058
READ of size 1 at 0x000109a60309 thread T0
#0 0x109a2e894 (/Users/timbo/.cpanm/work/1367178289.10768/DBD-SQLite-1.37/blib/arch/auto/DBD/SQLite/SQLite.bundle+0x109a2e894)
#1 0x109948e2b (/Users/timbo/.cpanm/work/1367178289.10768/DBD-SQLite-1.37/blib/arch/auto/DBD/SQLite/SQLite.bundle+0x109948e2b)
#2 0x109989cbd (/Users/timbo/.cpanm/work/1367178289.10768/DBD-SQLite-1.37/blib/arch/auto/DBD/SQLite/SQLite.bundle+0x109989cbd)
#3 0x10986cec4 (/Users/timbo/.cpanm/work/1367178289.10768/DBD-SQLite-1.37/blib/arch/auto/DBD/SQLite/SQLite.bundle+0x10986cec4)
#4 0x10986d0c6 (/Users/timbo/.cpanm/work/1367178289.10768/DBD-SQLite-1.37/blib/arch/auto/DBD/SQLite/SQLite.bundle+0x10986d0c6)
#5 0x10985ba4b (/Users/timbo/.cpanm/work/1367178289.10768/DBD-SQLite-1.37/blib/arch/auto/DBD/SQLite/SQLite.bundle+0x10985ba4b)
#6 0x1062ba686 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x100255686)
#7 0x1062299a1 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x1001c49a1)
#8 0x1060b91a3 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x1000541a3)
#9 0x109736b46 (/usr/local/perl5-blead-deb-thr-asan/lib/site_perl/5.17.11/darwin-thread-multi-2level/auto/DBI/DBI.bundle+0x4eb46)
#10 0x1062ba686 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x100255686)
#11 0x1062299a1 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x1001c49a1)
#12 0x1060d3ed4 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x10006eed4)
#13 0x1060661f4 (/usr/local/perl5-blead-deb-thr-asan/bin/perl+0x1000011f4)
#14 0x7fff8cca07e0 (/usr/lib/system/libdyld.dylib+0x27e0)
#15 0x1
0x000109a60309 is located 55 bytes to the left of global variable '*LC1423 (sqlite3.c)' (0x109a60340) of size 10
'*LC1423 (sqlite3.c)' is ascii string 'unix-none'
0x000109a60309 is located 4 bytes to the right of global variable '*LC1422 (sqlite3.c)' (0x109a60300) of size 5
'*LC1422 (sqlite3.c)' is ascii string 'unix'
Shadow bytes around the buggy address:
0x10002134c010: f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9 f9 f9 f9 f9
0x10002134c020: 00 00 00 00 07 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9
0x10002134c030: f9 f9 f9 f9 00 00 00 04 f9 f9 f9 f9 00 01 f9 f9
0x10002134c040: f9 f9 f9 f9 00 01 f9 f9 f9 f9 f9 f9 05 f9 f9 f9
0x10002134c050: f9 f9 f9 f9 00 00 00 00 00 00 00 07 f9 f9 f9 f9
=>0x10002134c060: 05[f9]f9 f9 f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9
0x10002134c070: 00 05 f9 f9 f9 f9 f9 f9 00 00 00 06 f9 f9 f9 f9
0x10002134c080: 00 01 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
0x10002134c090: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9
0x10002134c0a0: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00
0x10002134c0b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap righ redzone: fb
Freed Heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
ASan internal: fe
==12614== ABORTING
t/02_logon.t ................................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 31/37 subtests
Summary of my perl5 (revision 5 version 17 subversion 11) configuration:
Derived from: b5de49e55f04e3a6c36012d250a46eb301a2be38
Platform:
osname=darwin, osvers=12.3.0, archname=darwin-thread-multi-2level
uname='darwin timac.local 12.3.0 darwin kernel version 12.3.0: sun jan 6 22:37:10 pst 2013; root:xnu-2050.22.13~1release_x86_64 x86_64 '
config_args='-des -Doptimize=-g -O1 -DEBUGGING=both -Accflags=-fsanitize=address -fno-omit-frame-pointer -Aldflags=-fsanitize=address -Alddlflags=-fsanitize=address -Dusethreads -Dusemultiplicity -Dusesitecustomize -Dusedevel -Uversiononly -Dprefix=/usr/local/perl5-blead-deb-thr-asan -Dcc=gcc-mp-4.8 -Dld=gcc-mp-4.8'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc-mp-4.8', ccflags ='-fno-common -DPERL_DARWIN -fsanitize=address -fno-omit-frame-pointer -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
optimize='-g -O1',
cppflags='-fno-common -DPERL_DARWIN -fsanitize=address -fno-omit-frame-pointer -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.8.0 20130321 (prerelease)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 gcc-mp-4.8', ldflags =' -fsanitize=address -fstack-protector -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /usr/lib
libs=-lgdbm -ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -fsanitize=address -L/usr/local/lib -L/opt/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_SAWAMPERSAND
PERL_TRACK_MEMPOOL PERL_USE_DEVEL USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API USE_SITECUSTOMIZE
Locally applied patches:
uncommitted-changes
Built under darwin
Compiled at Mar 27 2013 23:51:38
%ENV:
PERLBREW_BASHRC_VERSION="0.44"
PERLBREW_HOME="/Users/timbo/.perlbrew"
PERLBREW_MANPATH="/Users/timbo/perl5/perlbrew/perls/perl-5.14.2/man"
PERLBREW_PATH="/Users/timbo/perl5/perlbrew/bin:/Users/timbo/perl5/perlbrew/perls/perl-5.14.2/bin"
PERLBREW_PERL="perl-5.14.2"
PERLBREW_ROOT="/Users/timbo/perl5/perlbrew"
PERLBREW_VERSION="0.44"
PERLCRITIC="/Users/timbo/.setdev/perlcriticrc"
PERLTIDY="/Users/timbo/.setdev/perltidyrc"
@INC:
/usr/local/perl5-blead-deb-thr-asan/lib/site_perl/5.17.11/darwin-thread-multi-2level
/usr/local/perl5-blead-deb-thr-asan/lib/site_perl/5.17.11
/usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/darwin-thread-multi-2level
/usr/local/perl5-blead-deb-thr-asan/lib/5.17.11