Subject: | DB2 using $dbh->disconect() then core dump |
64bit SunOS SE-M4K 5.10 Generic_137137-09 sun4u sparc SUNW,SPARC-Enterprise
DB2 database:v9.7
DBD::DB2: DBD-DB2-1.76 (cpan)
DBI: 1.45 $DBI::VERSION = "1.45"; # ==> ALSO update the version in
the pod text below!
bash-3.00# perl Makefile.PL
Configuring DBD::DB2...
Remember to actually read the README and CAVEATS files!
Using DB2 in "/opt/IBM/db2/V9.7/"
System: perl5.008 DBI1.45 sunos se-m4k 5.10 generic_137137-09 sun4u
sparc sunw,sparc-enterprise sun4-solaris dl_dlopen.xs
Compiler: gcc -O -fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
Includes: -I"/opt/IBM/db2/V9.7//include"
-I"/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI"
-I"/usr/local/lib/perl5/5.8.0/sun4-solaris/auto/DBI"-I"/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI"
Libraries: -L/opt/IBM/db2/V9.7//lib64 -ldb2
Checking if your kit is complete...
Looks good
Checking if your kit is complete...
Looks good
Writing Makefile for DBD::DB2::Constants
Writing Makefile for DBD::DB2
bash-3.00# make
cp DB2.pm blib/lib/DBD/DB2.pm
cp lib/Bundle/DBD/DB2.pm blib/lib/Bundle/DBD/DB2.pm
cp DB2.pod blib/lib/DBD/DB2.pod
cp Constants.pm ../blib/lib/DBD/DB2/Constants.pm
AutoSplitting ../blib/lib/DBD/DB2/Constants.pm
(../blib/lib/auto/DBD/DB2/Constants)
/usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap
/usr/local/lib/perl5/5.8.0/ExtUtils/typemap Constants.xs >
Constants.xsc && mv Constants.xsc Constants.c
gcc -c -I"/opt/IBM/db2/V9.7//include" -fno-strict-aliasing
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.74\"
-DXS_VERSION=\"1.74\" -fPIC
"-I/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE" Constants.c
Running Mkbootstrap for DBD::DB2::Constants ()
chmod 644 Constants.bs
rm -f ../blib/arch/auto/DBD/DB2/Constants/Constants.so
LD_RUN_PATH="" gcc -G -L/usr/local/lib Constants.o -o
../blib/arch/auto/DBD/DB2/Constants/Constants.so
chmod 755 ../blib/arch/auto/DBD/DB2/Constants/Constants.so
cp Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
chmod 644 ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
/usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap
/usr/local/lib/perl5/5.8.0/ExtUtils/typemap DB2.xs > DB2.xsc && mv
DB2.xsc DB2.c
gcc -c -I"/opt/IBM/db2/V9.7//include"
-I"/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI"
-I"/usr/local/lib/perl5/5.8.0/sun4-solaris/auto/DBI"-I"/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI"
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" -fPIC
"-I/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE" DB2.c
gcc -c -I"/opt/IBM/db2/V9.7//include"
-I"/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI"
-I"/usr/local/lib/perl5/5.8.0/sun4-solaris/auto/DBI"-I"/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBI"
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" -fPIC
"-I/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE" dbdimp.c
dbdimp.c: In function `diagnoseError':
dbdimp.c:51: warning: unreachable code at beginning of switch statement
Running Mkbootstrap for DBD::DB2 ()
chmod 644 DB2.bs
rm -f blib/arch/auto/DBD/DB2/DB2.so
LD_RUN_PATH="/opt/IBM/db2/V9.7//lib64" gcc -G -L/usr/local/lib DB2.o
dbdimp.o -o blib/arch/auto/DBD/DB2/DB2.so -L/opt/IBM/db2/V9.7//lib64
-ldb2
ld: 致命的: 文件 /opt/IBM/db2/V9.7//lib64/libdb2.so:错误的 ELF 类
型:ELFCLASS64
ld: 致命的: 文件处理错误。无输出写到blib/arch/auto/DBD/DB2/DB2.so
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/DB2/DB2.so'
when i rewrite Makefile.PL using /opt/IBM/db2/V9.7/lib32/ to link,it's ok
when using this test.pl,it will core dump
#!/usr/local/bin/perl -w
use DBI;
use strict;
# Open a connection
my $dbh = DBI->connect("dbi:DB2:dbnms", "db2admin","db2admin",
{RaiseError => 1});
# use VALUES to retrieve value from special register
my $stmt = "Values CURRENT DATE";
my $sth = $dbh->prepare($stmt);
$sth->execute();
# associate variables with output columns...
my $col1;
$sth->bind_col(1,\$col1);
while ($sth->fetch) { print "Today is: $col1\n"; }
$sth->finish();
$dbh->disconnect();
bash-3.00# ./test.pl
Today is: 2009-12-16
段错误 (core dumped)
this core dump may cause at disconnect
bash-3.00# pstack core
core 'core' of 28002: /usr/local/bin/perl -w ./testdb2.pl
ff032090 strlen (2851bc, 1f8360, fef6f690, 1150f8, 0, ffbff388) + 50
fef67ec4 setErrorFromDiagRecInfo (2851bc, 1, 1, fef6f690, 0, 20002) + 134
fef67d44 diagnoseError (ffff0000, 1, 1, ffffffff, fef6fce8, 1) + a8
fef69348 db2_db_disconnect (0, 1f8360, 0, 0, 252e08, 0) + 1c0
fef64084 XS_DBD__DB2__db_disconnect (2822f0, 2393f0, 0, 252e08, 112270,
fef63e28) + 25c
fefdd598 XS_DBI_dispatch (2393f0, 2851bc, 1203b8, 0, 0, 1f8360) + 1790
0008090c Perl_pp_entersub (111c00, 252e14, 0, 1, 252e0c, 252e18) + 560
00078e60 Perl_runops_standard (111c00, 0, ffc00000, 800000, 114400,
1f6c10) + 30
00027428 S_run_body (1, 0, 0, fffffff8, ff352a00, 114af0) + 134
00027074 perl_run (114c80, 114800, 3, ffbff9b4, ffffffff, 2) + 8c
000240b0 main (3, ffbff9b4, ffbff9c4, 114a40, ff350100, 0) + 90
00023eb8 _start (0, 0, 0, 0, 0, 0) + 5c