Bug #51091 [Com]: Persistent PDO Connections Crash
| From: | dxm007 at gmail dot com | Date: | Mon, 28 Jun 2010 03:16:02 +0000 |
| Subject: | Bug #51091 [Com]: Persistent PDO Connections Crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151918@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51091&edit=1
ID: 51091
Comment by: dxm007 at gmail dot com
Reported by: achristianson at yakabod dot com
Summary: Persistent PDO Connections Crash
Status: Feedback
Type: Bug
Package: Reproducible crash
Operating System: CentOS 5.4
PHP Version: 5.3.1
Assigned To: dmitry
New Comment:
Hi, I've been trying to setup Menalto Gallery and after I got through
entire setup
of a fresh installation (to verify php, MSSQL, IIS were working fine), I
pointed
the gallery to my existing database and flat files. Because my data
came from an
older version of the Gallery, it invokes upgrade wizard which dies every
single
time on step 2. I've created a crash dump with adplus and it appears to
be
exactly the same bug as what's reported here.
This is 100% repeatable on my machine. I'm using PHP 5.3.2 with Windows
2008
Server R2, IIS7 and MSSQL 2008 R2. I've also been able to get past the
crash by
adding "zend.enable_gc = Off" to php.ini
Previous Comments:
------------------------------------------------------------------------
[2010-04-20 18:11:48] dmitry@php.net
I'm not able to reproduce it. May be it's already fixed. Could you
verify?
------------------------------------------------------------------------
[2010-02-19 16:47:46] johannes@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: dmitry
Dmitry, can you take a look? - Thanks.
------------------------------------------------------------------------
[2010-02-19 16:09:24] achristianson at yakabod dot com
I gave it a try with
zend.enable_gc = Off
The segmentation fault no longer occurs
------------------------------------------------------------------------
[2010-02-19 15:34:36] rasmus@php.net
Looks like a gc issue. Confirm by setting:
zend.enable_gc = Off
in your php.ini
------------------------------------------------------------------------
[2010-02-19 15:29:20] achristianson at yakabod dot com
Description:
------------
* create persistent connection to database; store it to a variable
* create an additional persistent connection to database: store it in
the same variable
* allocate a bunch of memory
* PHP segfaults
Reproduce code:
---------------
<?php
$db = connect();
$db = connect();
for($i = 0; $i < 10000; $i++)
{
$exampleArray[] = new ExampleObject();
}
class ExampleObject { }
function connect()
{
return new PDO( 'mysql:host=<db host>;dbname=<db name>', '<db
user>',
'<db password>',
array( PDO::ATTR_PERSISTENT => true ));
}
Expected result:
----------------
no segmentation fault
Actual result:
--------------
[New Thread 0xb7f396c0 (LWP 3416)]
Program received signal SIGSEGV, Segmentation fault.
0x0853a746 in zobj_mark_grey (obj=0xb7b8e07c, pz=0xbfd1f0c8) at
/root/php-5.3.1/Zend/zend_gc.c:383
383 p = Z_OBJPROP_P(pz)->pListHead;
(gdb) bt
#0 0x0853a746 in zobj_mark_grey (obj=0xb7b8e07c, pz=0xbfd1f0c8) at
/root/php-5.3.1/Zend/zend_gc.c:383
#1 0x0853a81e in gc_mark_roots () at /root/php-
5.3.1/Zend/zend_gc.c:410
#2 0x0853af64 in gc_collect_cycles () at /root/php-
5.3.1/Zend/zend_gc.c:628
#3 0x0853a1a9 in gc_zobj_possible_root (zv=0xa06bac8) at /root/php-
5.3.1/Zend/zend_gc.c:221
#4 0x08539f78 in gc_zval_possible_root (zv=0xa06bac8) at /root/php-
5.3.1/Zend/zend_gc.c:143
#5 0x08508570 in _zval_ptr_dtor (zval_ptr=0xbfd1f1ec,
__zend_filename=0x88fb070 "/root/php-5.3.1/Zend/zend_vm_execute.h",
__zend_lineno=28199) at /root/php-5.3.1/Zend/zend_gc.h:183
#6 0x085d7d24 in ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER
(execute_data=0x9cccd20) at /root/php-
5.3.1/Zend/zend_vm_execute.h:28199
#7 0x08543e68 in execute (op_array=0x9d12f70) at /root/php-
5.3.1/Zend/zend_vm_execute.h:104
#8 0x08518b68 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /root/php-5.3.1/Zend/zend.c:1194
#9 0x084aecdb in php_execute_script (primary_file=0xbfd216a4) at
/root/php-5.3.1/main/main.c:2225
#10 0x085e4fa0 in main (argc=2, argv=0xbfd21804) at /root/php-
5.3.1/sapi/cli/php_cli.c:1190
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51091&edit=1