php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42942 pdo_pgsql: segfault with multiple rows and prepared statements
Submitted: 2007-10-12 09:14 UTC Modified: 2008-05-20 01:00 UTC
From: php at benjaminschulz dot com Assigned: pajoye (profile)
Status: No Feedback Package: PDO related
PHP Version: 5CVS-2007-10-12 (CVS) OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at benjaminschulz dot com
New email:
PHP Version: OS:

 

 [2007-10-12 09:14 UTC] php at benjaminschulz dot com
Description:
------------
Hi,
i can't provide reproduce code. All i can say is that i use prepared statements with multiple rows (INSERT .. VALUES (..), (...)) and on a table with huge data php segfaults.
If executed with 100 rows per Statement PHP fails with "zend_mm_heap corrupted", this core was created with 20 rows. The rows contain binary data and are all about 1-3mb.

Here is the backtrace, i hope it helps:

Core was generated by `php -q index.php'.
Program terminated with signal 11, Segmentation fault.
#0  _zend_mm_free_int (heap=0x85971f8, p=<value optimized out>) at /usr/src/php5/Zend/zend_alloc.c:1932
1932            if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
(gdb) bt
#0  _zend_mm_free_int (heap=0x85971f8, p=<value optimized out>) at /usr/src/php5/Zend/zend_alloc.c:1932
#1  0x082cecac in zend_hash_destroy (ht=0x876b210) at /usr/src/php5/Zend/zend_hash.c:531
#2  0x082c4ab7 in _zval_dtor_func (zvalue=0x86f6724) at /usr/src/php5/Zend/zend_variables.c:43
#3  0x082b8e09 in _zval_ptr_dtor (zval_ptr=0xbfe86b94) at /usr/src/php5/Zend/zend_variables.h:35
#4  0x082f101a in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe88cc0) at /usr/src/php5/Zend/zend_execute.h:155
#5  0x082e23a8 in execute (op_array=0x869c9e0) at /usr/src/php5/Zend/zend_vm_execute.h:87
#6  0x082c4de4 in zend_execute_scripts (type=8, retval=<value optimized out>, file_count=3) at /usr/src/php5/Zend/zend.c:1134
#7  0x08282d70 in php_execute_script (primary_file=0xbfe8b098) at /usr/src/php5/main/main.c:2006
#8  0x083431d7 in main (argc=3, argv=0xbfe8b1b4) at /usr/src/php5/sapi/cli/php_cli.c:1140


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-12 17:38 UTC] pajoye@php.net
Can you try again with php 5.2.6? or 5.3 snaps?
 [2008-05-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 20 18:00:01 2025 UTC