|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-05-31 13:54 UTC] justin dot hannus at lycos-inc dot com
Description: ------------ PHP v5.0.4 I'm getting a segfault from PDO_ODBC compiled with IBM-DB2v7.2. Seems like its happening somewhere in the shutdown process. Here's a backtrace, a wierd one but thats all gdb gives me. bt: #0 0x012c8a2c in ?? () #1 0x00b205d7 in exit () from /lib/tls/libc.so.6 #2 0x00b0ae3d in __libc_start_main () from /lib/tls/libc.so.6 #3 0x0807538d in _start () When pdo_odbc.so is commented out of my ini file the segfault goes away. I'm using php-5.0.4, PDO-0.3 (static) and PDO_ODBC-0.2 (shared) with IBM-DB2v7.2 on CentOS Linux 2.6.9. Also, in another post i sent to pecl.dev, I'm not even sure if PDO_ODBC supports IBM-DB2v7.2. Can someone confirm this? Justin Hannus Software Engineer | Lycos Inc. justin.hannus@lycos-inc.com Reproduce code: --------------- <?php print "hello\n"; ?> Expected result: ---------------- hello Actual result: -------------- hello Segmentation fault --- bt: #0 0x012c8a2c in ?? () #1 0x00b205d7 in exit () from /lib/tls/libc.so.6 #2 0x00b0ae3d in __libc_start_main () from /lib/tls/libc.so.6 #3 0x0807538d in _start () PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 23:00:02 2025 UTC |
Heres some more info with different test: code: <?php try { $dbo = new PDO($schema, $user, $pass, array ( PDO_ATTR_PERSISTENT => true) ); $dbo->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION); echo "PDO object created.\n"; } catch (PDOException $e) { die("Error connectiong: ".$e->getMessage()."\n"); } $sql = 'select p.PROD_ID from GR.PRODUCT as p where p.PROD_ID = 2520 for read only'; try { foreach ($dbo->query($sql) as $row) { print_r($row); } } catch (PDOException $e) { die("Error in query: ".$e->getMessage()."\n"); } ?> output: PDO object created. Array ( [PROD_ID] => 2520 [0] => 2520 ) /home/jhannus/local/src/php-5.0.4/ext/pdo/pdo_stmt.c(1942) : Freeing 0x08B37ABC (4 bytes), script=/home/jhannus/pdoTest.php /home/jhannus/local/src/php-5.0.4/Zend/zend_API.c(990) : Freeing 0x08B37A64 (35 bytes), script=/home/jhannus/pdoTest.php /home/jhannus/local/src/php-5.0.4/Zend/zend_hash.c(383) : Actual location (location was relayed) /home/jhannus/local/src/php-5.0.4/Zend/zend_hash.c(242) : Freeing 0x08B37A04 (43 bytes), script=/home/jhannus/pdoTest.php /home/jhannus/local/src/php-5.0.4/ext/pdo/pdo_stmt.c(735) : Freeing 0x08B379B4 (32 bytes), script=/home/jhannus/pdoTest.php /home/jhannus/local/src/php-5.0.4/Zend/zend_hash.c(169) : Actual location (location was relayed) Last leak repeated 1 time /home/jhannus/local/src/php-5.0.4/ext/pdo/pdo_stmt.c(829) : Freeing 0x08B3BCFC (16 bytes), script=/home/jhannus/pdoTest.php /home/jhannus/local/src/php-5.0.4/ext/pdo/pdo_stmt.c(470) : Freeing 0x08B3BBCC (5 bytes), script=/home/jhannus/pdoTest.php /home/jhannus/local/src/php-5.0.4/ext/pdo/pdo_stmt.c(2007) : Freeing 0x08B2A794 (16 bytes), script=/home/jhannus/pdoTest.php === Total 8 memory leaks detected === Segmentation fault bt: #0 0x014c4a2c in ?? () #1 0x00b205d7 in exit () from /lib/tls/libc.so.6 #2 0x081fde7d in main (argc=3, argv=0xbfe98ad4) at /home/jhannus/local/src/php-5.0.4/sapi/cli/php_cli.c:1062 From the above output one might think that its not pdo_odbc that causes the segfault but php only segfaults whith pdo_odbc enabled (with db2). Another interesting thing to note is that there looks like an extra key => value in the result array.> Please try your original build configuration (shared extensions) against PHP HEAD. Attempting to build a shared build of pdo_odbc fails for me with snapshot php5-200506141430: ./configure --with-pdo-odbc=ibm-db2,/opt/db2-base/IBMdb2/V7.1 --with-php-config=/home/jhannus/local/php/bin/php-config ... checking for ODBC v3 support for PDO... yes, shared checking for PDO includes... checking for PDO includes... /home/jhannus/local/php/include/php/ext checking for selected PDO ODBC flavour... ibm-db2 libs /opt/db2-base/IBMdb2/V7.1/lib, headers /opt/db2-base/IBMdb2/V7.1/include checking for SQLBindCol in -ldb2... no configure: error: Your ODBC library does not exist or there was an error. Check config.log for more information But when building statically it compiles fine. -Justin