Segmentation fault in test 02simple.t

From: Frederic Bleuzet (fbleuzet_at_microstrategy.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 15:45:52 -0400
To: <dbi-users@perl.org>

Hi all,

The "make test" fails in 02simple.t with a segmentation fault.

The DBI version is 1.43
The DBD::ODBC version I'm trying to install is 1.09
The platform is AIX 5.2 compiling with cc_r
The perl version is 5.8.4 (see below for the -V output)
The DSN points to a SQL Server database.

The segmentation fault occurs in the test 02simple.t at the iteration 19 (Test 19: test connection success when DBI DSN is invalid)

After some tracing I could spot the problem in the function dbd_db_login6, line 447 while evaluating the statement:
        if (!imp_drh->connects) {

I could check that the values of imp_drh is not null, so probably the pointer references an invalid memory address. I didn't dare to troubleshoot further...

Is there any suggestion for the next step in finding the problem?

Fred

Output from the test:

bash-2.01# perl -I blib/lib -I blib/arch t/02simple.t
1..21
ok 1
 Test 2: connecting to the database
ok 2
 Test 3: create test table
Using fields: COL_A smallint NOT NULL PRIMARY KEY , COL_B varchar(8000), COL_C text, COL_D datetime
ok 3
 Test 4: check existance of test table
(unknown owner).PERL_DBD_TEST
ok 4
 Test 5: insert test data
ok 5
 Test 6: select test data
1|foo|foo varchar|
2|bar|bar varchar|
3|bletch|bletch varchar|
4|80char|THIS IS A STRING LONGER THAN 80 CHARS. THIS SHOULD BE CHECKED FOR TRUNCATION AND COMPARED WITH ITSELF.|
5|gt250char|THIS IS A STRING LONGER THAN 80 CHARS. THIS SHOULD BE CHECKED FOR TRUNCATION AND COMPARED WITH ITSELF. THIS IS A STRING LONGER THAN 80 CHARS. THIS SHOULD BE CHECKED FOR TRUNCATION AND COMPARED WITH ITSELF. THIS IS A STRING LONGER THAN 80 CHARS. THIS SHOULD BE CHECKED FOR TRUNCATION AND COMPARED WITH ITSELF. THIS IS A STRING LONGER THAN 80 CHARS. THIS SHOULD BE CHECKED FOR TRUNCATION AND COMPARED WITH ITSELF.|
retrieved 103 byte string OK
retrieved 418 byte string OK
ok 6
 Tests 7,8: test LongTrun***
ok 7
ok 8
 Test 9: test ColAttributes
Column count is: 4
1: COL_A = 5 5 yes
2: COL_B = 12 12 yes
3: COL_C = -1 -1 yes
4: COL_D = 93 93 yes

ok 9
 Test 10: test $DBI::err
ok 10
 Test 11: test date or timestamp values
1998-05-14 00:00:00.000
ok 11
 Test 12: test group by queries
1, 1
2, 1
3, 1
4, 1
5, 1
ok 12
 Test 13: test data_sources
Data sources:
        DBI:ODBC:BUILD_DB

ok 13
 Test 14: test ping method
ok 14
 Test 15: test storing of DBH parameter
ok 15
Attrib not true (1)
 Test 16: test connecting twice to the same db.
ok 16
 Test 17: test get_info
 connected to Microsoft SQL Server
ok 17
 Test 18: test automatically finish when execute run again
ok 18
 Test 19: test connection success when DBI DSN is invalid
Segmentation fault (core dumped)

Perl version:
bash-2.01# perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=aix, osvers=5.2.0.0, archname=aix-thread-multi
    uname='aix nestine 2 5 002526bd4c00 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc_r', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong',
    optimize='-O',
    cppflags=''
    ccversion='6.0.0.0', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -brtl -L/usr/local/lib -b32'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc -lbsd
    perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc -lbsd
    libc=/lib/libc.a, so=a, useshrplib=true, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE:/usr/local/lib/perl5/5.8.4/aix-thread-multi/CORE/perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc -L/usr/local/lib'

Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under aix
  Compiled at Jul 22 2004 12:42:42
  @INC:
    /usr/local/lib/perl5/5.8.4/aix-thread-multi
    /usr/local/lib/perl5/5.8.4
    /usr/local/lib/perl5/site_perl/5.8.4/aix-thread-multi
    /usr/local/lib/perl5/site_perl/5.8.4
    /usr/local/lib/perl5/site_perl
    .