Edit report at http://bugs.php.net/bug.php?id=52389&edit=1
ID: 52389
Updated by: felipe@php.net
Reported by: miroslav dot zacek at skype dot net
Summary: Memory (de)allocation problem for pgsql notices
-Status: Open
+Status: Feedback
Type: Bug
Package: PostgreSQL related
Operating System: Linux (Kubuntu)
PHP Version: 5.3.2
Block user comment: N
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2010-07-22 05:08:28] aharvey@php.net
The original description without the double encoding:
In the ext/pgsql.c pgsql_globals->notices structure is allocated as
persistent but individual messages non persistent. Thus the destructor
_php_pgsql_notice_ptr_dtor happens to try to free memory that was
already freed by the garbage collector and the thread exits with
segmentation fault.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3cd3013 in _zend_mm_free_int (heap=0x7ffff844b5c0,
p=0x7ffff9397390)
at /usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2018
2018 if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
(gdb) backtrace
#0 0x00007ffff3cd3013 in _zend_mm_free_int (heap=0x7ffff844b5c0,
p=0x7ffff9397390) at
/usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2018
#1 0x00007ffff3cd3de1 in _efree (ptr=0x7ffff9397390) at
/usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2351
#2 0x00007fffeb4d3419 in _php_pgsql_notice_ptr_dtor
(ptr=0x7ffff9396708) at
/tmp/pgsql/pgsql.c:841
------------------------------------------------------------------------
[2010-07-21 15:50:43] miroslav dot zacek at skype dot net
Description:
------------
In the ext/pgsql.c pgsql_globals->notices structure is allocated as
persistent but individual messages non persistent. Thus the destructor
_php_pgsql_notice_ptr_dtor happens to try to free memory that was
already freed by the garbage collector and the thread exits with
segmentation fault. Program received signal SIGSEGV,
Segmentation fault. 0x00007ffff3cd3013 in _zend_mm_free_int
(heap=0x7ffff844b5c0, p=0x7ffff9397390) at
/usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2018 2018
if (ZEND_MM_IS_FREE_BLOCK(next_block)) { (gdb)
backtrace #0 0x00007ffff3cd3013 in _zend_mm_free_int
(heap=0x7ffff844b5c0, p=0x7ffff9397390) at
/usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2018 #1
0x00007ffff3cd3de1 in _efree (ptr=0x7ffff9397390) at
/usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2351 #2
0x00007fffeb4d3419 in _php_pgsql_notice_ptr_dtor (ptr=0x7ffff9396708) at
/tmp/pgsql/pgsql.c:841
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52389&edit=1