From: opensource at videinfra dot com
Operating system: MAC OS X
PHP version: 5.1.6
PHP Bug Type: PDO related
Bug description: PDO Crashes Apache with null value in Postgres prepared
statement
Description:
------------
Apache2 crashes when call is made to execute prepared
statement with null parameters.
Usign PDO-PostgreSQL
Apache 2.0
PostgreSql 8.1
PHP 5,1.6
Reproduce code:
---------------
$dbh=new PDO("pgsql:yourdb");
$sth = $dbh->prepare('SELECT * from "table" WHERE "field1"= ? AND
"field2"= ?');
$sth->execute(array(null,null));
<crash>
Actual result:
--------------
Crash reporter output:
Thread 7 Crashed:
0 libpq.4.dylib 0x007b161e parseInput + 6
1 libpq.4.dylib 0x007b1eb6 PQgetResult + 31
2 libpq.4.dylib 0x007b2229 PQexecStart + 50
3 libpq.4.dylib 0x007b242d PQexec + 21
4 libphp5.so 0x020f18ab pgsql_stmt_dtor + 111
5 libphp5.so 0x020ed125 free_statement + 214
6 libphp5.so 0x022ebc06
zend_objects_store_free_object_storage + 58
7 libphp5.so 0x022bddce shutdown_executor + 947
8 libphp5.so 0x022cc63d zend_deactivate + 226
9 libphp5.so 0x0227d4db php_request_shutdown +
848
10 libphp5.so 0x0236cbcc php_handler + 2003
11 apache2 0x0001e430 ap_run_handler + 59
(config.c:152)
12 apache2 0x0001e833 ap_invoke_handler + 87
(config.c:366)
13 apache2 0x0000cb86 ap_process_request + 375
(http_request.c:249)
14 apache2 0x00006e1d
ap_process_http_connection + 297 (http_core.c:253)
15 apache2 0x0002ab62 ap_run_process_connection
+ 59 (connection.c:43)
16 apache2 0x0002ae80 ap_process_connection +
69 (connection.c:178)
17 apache2 0x0001b509 worker_thread + 545
(threadpool.c:683)
18 libapr-0.0.dylib 0x00715f51 dummy_worker + 22
(thread.c:106)
19 libSystem.B.dylib 0x90023d87 _pthread_body + 84
--
Edit bug report at http://bugs.php.net/?id=39115&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39115&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39115&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39115&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39115&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39115&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39115&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39115&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39115&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39115&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39115&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39115&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39115&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39115&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39115&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39115&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39115&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39115&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39115&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39115&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39115&r=mysqlcfg