ID:               40479
 Comment by:       soletan at toxa dot de
 Reported By:      rrossi at maggioli dot it
 Status:           No Feedback
 Bug Type:         Reproducible crash
 Operating System: Suse Linux 9.0
 PHP Version:      5.2.1
 New Comment:

Ran into the same problem and read most of the posts in this report.
Well, I don't expect PHP developers to ever find this bug. Don't you get
annoyed by template-driven posts asking for information they can't use?

HERE COMES MY ADVICE: Reading hints on expecting a race condition lead
me to installing suhosin, which is an extension to PHP increasing its
integrity and security. Guess what, it helped me out of this trouble.
This is no ad, so I won't provide a link here. Just google the name ...

Maybe PHP developers shouldn't use templates requesting tons of
backtracks providing obviously useless information, but invest some time
in revising observers for the internal memory management of PHP as this
is obviously causing the trouble.


Previous Comments:
------------------------------------------------------------------------

[2009-03-03 11:22:34] hakan dot koseoglu at gmail dot com

The same problem appears from a allegedly successful compilation op PHP
5.2.9 on RHEL5 64 bit using -m32 CFLAG so that the binaries are 32 bit.

The compilation appears to complete successfully:


Apache 2.0.59 compiled w/o any problems with the following configure
and it works fine.
./configure --prefix=/apps/apache2 --with-expat=builtin

PHP is configured with the following options:
./configure --with-apxs2=/apps/apache2/bin/apxs
--build=i386-redhat-linux --with-pic --with-gd --with-zlib
--with-config-file-path=/apps/apache2/conf --with-libdir=/lib/
--enable-debug

And after the successful run, make test was run with the following
errors:

[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-tests.php'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x08c71270 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:144, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0xD03365E6)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-test-info.php'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x097cdd80 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:160, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0x512474AC)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-test-info.php'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x097cdb78 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:160, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0x512474AC)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-test-info.php'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x097cd9ac status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:160, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0x512474AC)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-test-info.php'
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(160) :  Freeing
0x097CD9AC (108 bytes), script=/apps/source/php-5.2.9/run-test-info
.php
/apps/source/php-5.2.9/ext/standard/php_fopen_wrapper.c(312) : Actual
location (location was relayed)
Last leak repeated 2 times
=== Total 3 memory leaks detected ===
[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-tests.php'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x08c734c4 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:292, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0xD03365E6)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script:  '-'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x086d7038 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:160, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0x4C780131)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script:  '-'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x086d6e30 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:160, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0x4C780131)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script:  '-'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x086d6c64 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:160, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0x4C780131)
                At least 4 bytes overflown
---------------------------------------
[Tue Mar  3 11:16:22 2009]  Script:  '-'
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(160) :  Freeing
0x086D6C64 (108 bytes), script=-
/apps/source/php-5.2.9/ext/standard/php_fopen_wrapper.c(312) : Actual
location (location was relayed)
Last leak repeated 2 times
=== Total 3 memory leaks detected ===
[Tue Mar  3 11:16:22 2009]  Script: 
'/apps/source/php-5.2.9/run-tests.php'
---------------------------------------
/apps/source/php-5.2.9/main/streams/plain_wrapper.c(421) : Block
0x08c73f44 status:
Beginning:      OK (allocated on
/apps/source/php-5.2.9/main/streams/plain_wrapper.c:292, 108 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0xD03365E6)
                At least 4 bytes overflown
---------------------------------------
zend_mm_heap corrupted
/bin/sh: line 23: 32041 Segmentation fault     
TEST_PHP_EXECUTABLE=/apps/source/php-5.2.9/sapi/cli/php
TEST_PHP_SRCDIR=/apps/source/ph
p-5.2.9 CC="gcc" /apps/source/php-5.2.9/sapi/cli/php -n -c
/apps/source/php-5.2.9/tmp-php.ini -d 'open_basedir=' -d
'output_buffering=0
' -d 'memory_limit=-1' /apps/source/php-5.2.9/run-tests.php -n -c
/apps/source/php-5.2.9/tmp-php.ini -d extension_dir=/apps/
source/php-5.2.9/modules/ ` if test "x" != "x"; then for i in ""; do .
$i; /apps/source/php-5.2.9/build/shtool echo -n -- " -d
extension=$dlname";
 done; fi; if test "x" != "x"; then for i in ""; do . $i;
/apps/source/php-5.2.9/build/shtool echo -n -- " -d
zend_extension_debug=/app
s/source/php-5.2.9/modules/$dlname"; done; fi`
make: [test] Error 139 (ignored)

I think this is because the configure script assesses the intmax_t as 4
as opposed to 8 and all of the integers are overflowing with 4 bytes.
Just a guess but comparing to an other environment where I managed to
compile it successfully, these appear to be the main differences in
config.log.

------------------------------------------------------------------------

[2009-02-25 18:50:44] lcvalentine at gmail dot com

Apache/2.0.63 (Win32) PHP/5.2.8

FWIW, this happens when running as a service.  Running in the console
it's fine.

I found it in response to bug #46842, after rolling back from
Apache/2.2.  I cannot say for sure if they are related.

------------------------------------------------------------------------

[2009-02-20 18:34:02] php at wijzijnhet dot nl

Just ran into the same problem problem on PHP5.3b1, so it seems this
error is bug is still around.
Unfortunately, I don't have a simple script to reproduce the problem.
My config.nice:

'./configure' \
'--prefix=/opt' \
'--with-apxs2=/usr/bin/apxs2' \
'--disable-short-tags' \
'--with-openssl' \
'--with-zlib' \
'--enable-bcmath' \
'--with-bz2=/bin/bzip2' \
'--enable-calendar' \
'--with-curl' \
'--with-curlwrappers' \
'--enable-exif' \
'--enable-ftp' \
'--with-gd' \
'--with-jpeg-dir=/usr/lib' \
'--with-png-dir=/usr/lib' \
'--with-xpm-dir=/usr/lib' \
'--with-ttf' \
'--with-t1lib' \
'--enable-gd-native-ttf' \
'--enable-gd-jis-conv' \
'--with-gettext' \
'--with-imap' \
'--with-imap-ssl' \
'--with-ldap' \
'--with-ldap-sasl' \
'--enable-mbstring' \
'--with-mcrypt' \
'--with-mhash' \
'--with-ming' \
'--with-mysql=mysqlnd' \
'--with-mysqli=mysqlnd' \
'--with-ncurses' \
'--with-pdo-mysql' \
'--with-pspell' \
'--with-readline' \
'--with-snmp' \
'--enable-soap' \
'--enable-sockets' \
'--without-sqlite' \
'--enable-sqlite-utf8' \
'--with-tidy' \
'--enable-wddx' \
'--with-xmlrpc' \
'--with-xsl' \
'--enable-zip' \
'--with-pear' \
'--with-kerberos' \
'--with-config-file-path=/etc/php5-3' \

System configuration:
OS: Ubuntu Linux 8.10
Apache 2.2.9

------------------------------------------------------------------------

[2009-01-27 16:10:11] dominik at dadadom dot de

Interestingly enough, changing values in php.ini helps:

http://trac.macports.org/ticket/18004#comment:10

------------------------------------------------------------------------

[2009-01-23 05:18:43] pablo at dalloglio dot net

This script may help to reproduce the bug.
It is a stupid script, but sometimes the two
generated files (teste.txt, teste1.txt)
are different. But they should be identical.

<?php
file_put_contents('teste.txt',
str_repeat("ABCDEFGHIJKLMNOPQRSTUVWXYZ\n", 10000));

$output = file_get_contents('teste.txt');

for ($n=1; $n<=10000; $n++)
{
    $output = str_replace('G', 'G', $output);
}
file_put_contents('teste2.txt', $output);
?>

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/40479

-- 
Edit this bug report at http://bugs.php.net/?id=40479&edit=1

Reply via email to