#41419 [NEW]: PDO script crashes on all my builds of php on 4 machines
| From: | dmoree at coker dot edu | Date: | Thu, 17 May 2007 18:04:27 +0000 |
| Subject: | #41419 [NEW]: PDO script crashes on all my builds of php on 4 machines | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-112769@lists.php.net to get a copy of this message | ||
From: dmoree at coker dot edu
Operating system: Fedora Core 6
PHP version: 5.2.2
PHP Bug Type: PDO related
Bug description: PDO script crashes on all my builds of php on 4 machines
Description:
------------
I am using some PDO code obtained from IBM. This PDO driver allows for PHP
to connect to IBM UniData and UniVerse databases. This code does work as
I've been talking to the developer of it for the past 2 weeks and he as
also ran my code which has worked. I have done a call stack on it and will
place it below.
#0 0x00c81b8c in memcpy () from /lib/libc.so.6
#1 0x080e7af0 in u2_prepare (S=0xa33393c,
sql=0xa333834 "CALL PDOSUB ? ? ? \n?", sql_len=20)
at /root/php-5.1.6/ext/pdo_u2/u2_driver.c:798
#2 0x080e7c24 in u2_handle_preparer (dbh=0xa33082c,
sql=0xa333834 "CALL PDOSUB ? ? ? \n?", sql_len=20, stmt=0xa333404,
driver_options=0x0) at /root/php-5.1.6/ext/pdo_u2/u2_driver.c:833
#3 0x080e184c in zif_PDO_prepare (ht=1, return_value=0xa33098c,
return_value_ptr=0x0, this_ptr=0xa3218b4, return_value_used=1)
at /root/php-5.1.6/ext/pdo/pdo_dbh.c:557
#4 0x082199fb in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfc2c160)
at /root/php-5.1.6/Zend/zend_vm_execute.h:200
#5 0x0821aafd in execute (op_array=0xa32b79c)
at /root/php-5.1.6/Zend/zend_vm_execute.h:92
#6 0x081fead8 in zend_execute_scripts (type=8, retval=<value optimized
out>,
file_count=3) at /root/php-5.1.6/Zend/zend.c:1109
#7 0x081c37b4 in php_execute_script (primary_file=0xbfc2e590)
at /root/php-5.1.6/main/main.c:1737
#8 0x08275636 in main (argc=2, argv=0xbfc2e6e4)
at /root/php-5.1.6/sapi/cli/php_cli.c:1093
Reproduce code:
---------------
<?php
// UniData DSN
$dsn = "u2:dbtype=ud;host=10.40.0.16;acct=Collive";
$user = "dmoree";
$pass = "dewwater";
echo "<h2>UniData HTTP Query</h2>\n";
try{
$db = new PDO($dsn, $user, $pass);
}catch (PDOException $e){
if(strpos($e->getMessage(), "80011") > 0){
echo "Error: Invalid username or password!";
exit();
}elseif(strpos($e->getMessage(), "39129") > 0){
echo "Error: Not a valid account name!";
exit();
}
echo "Error: ".$e->getMessage();
exit();
}
$statement = $db->prepare("CALL PDOSUB :xcode :xparams :xoutdata
:xoutcode");
$db = null;
?>
Expected result:
----------------
Should just prepare the statement for execution.
Actual result:
--------------
Upon PHP reaching the prepare statement line it crashes with a
segmentation fault. If I run the statement as a query instead of preparing
it, it functions fine. If I prepare the statement without the word CALL it
functions fine. I have done lots of test over the past 2 days and have
singled it down the the word CALL being in the prepare statement. For some
reason, if CALL is put into the prepare statement, it crashes. It is
isolated to the word CALL only.
--
Edit bug report at http://bugs.php.net/?id=41419&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41419&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41419&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41419&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41419&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41419&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41419&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41419&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41419&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41419&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41419&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41419&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41419&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41419&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41419&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41419&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41419&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41419&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41419&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41419&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41419&r=mysqlcfg