Skip Menu |

This queue is for tickets about the DBD-DB2 CPAN distribution.

Report information
The Basics
Id: 52883
Status: resolved
Priority: 0/
Queue: DBD-DB2

People
Owner: opendev [...] us.ibm.com
Requestors: fgkenshin [...] 163.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.76
Fixed in: (no value)



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
PS:perl version -bash-3.00$ perl -v This is perl, v5.8.0 built for sun4-solaris
Hi Kenshin, The core dump seems to happen in the string fuction strlen, which might be called by DBI (not called anywhere in the setDiagnoseError method in DBD-DB2). Could you upgrade your DBI version and check if the same is reproducible. If the problem is still seen I would need a CLI trace for more analysis on this. Follow the steps in the link below to obtain a CLI trace. http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.trb.doc/doc/t0054958.html -- Thanks Praveen IBM OpenSource Application Development Team India Software Labs, Bangalore (India)
在 2009-12-17 23:45:50 星期四 时,IBMTORDB2 写到: Show quoted text
> Hi Kenshin, > > The core dump seems to happen in the string fuction strlen, which > might > be called by DBI (not called anywhere in the setDiagnoseError method > in > DBD-DB2). Could you upgrade your DBI version and check if the same is > reproducible. > > If the problem is still seen I would need a CLI trace for more > analysis > on this. Follow the steps in the link below to obtain a CLI trace. >
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.trb.doc/doc/t0054958.html i upgrade DBI to 1.601,because my perl vesion is 5.8.0,an rebuild DBD::DB2-1.76, core dump still exists。 the attach file is follow the http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.trb.doc/doc/t0054958.html,then Generated after running test.pl
Download p20778t1.cli
application/octet-stream 13k

Message body not shown because it is not plain text.

Hi Kenshin, From CLI trace it is clear that the Disconnect is taken place successfully. From the core dump that you have pasted the call to strlen is seen after call to setErrorFromDiagRecInfo of dbdimp.c, will need to check how the control reached here. Have you set the DBI trace level, if yes to what value? Also would require some inputs from your side to look more into this problem as it would take time for me to get hold of a Solaris box. The function setErrorFromDiagRecInfo is called only in 3 cases namely when the return code form database is either SQL_SUCCESS_WITH_INFO, SQL_NO_DATA_FOUND or SQL_ERROR. But from the CLI trace it is seen that none of this return code is received after disconnect. Could you put in a printf statement in function static SQLRETURN diagnoseError(....) to check what is the rc ( parameter to the said function ) value received before the core dump. -- Thanks Praveen IBM OpenSource Application Development Team India Software Labs, Bangalore (India)
Hi The issue is been fixed and is available in the new release 1.78 http://search.cpan.org/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.78.tar.gz -- Thanks Praveen IBM OpenSource Application Development Team India Software Labs, Bangalore (India)