From:             boing at boing dot com
Operating system: openbsd 3.8
PHP version:      5.1.4
PHP Bug Type:     Reproducible crash
Bug description:  FATAL:  erealloc():  Unable to allocate xxx bytes

Description:
------------
I'm getting this:

FATAL:  erealloc():  Unable to allocate 3358824 bytes

The process only allocates approximately 30Megs (according to top and ps).
 I've increased the ulimits to beyond 256Megs.  I've also run php test
scripts with different memory allocation and str_repeats and such to
create a large processes.  All work well.  In addition I wrote c code to
bang on realloc(3) in openbsd.  I know there is plenty of ram left.  But
this code does get pretty ugly with multiple levels of associative arrays.
 I'm happy to help out any way I can.

Reproduce code:
---------------
http://www.boing.com/phptest.tgz - contains the phptest.php script and in
a directory, the data file extensions.xml.gz.  I stripped down the
typo3.org cms code that pulls in their "new extensions" such that code to
reproduce is here.  I turned it into a standalone file.  And it all
started out as a research project...

php phptest.php

I've tried many different configure options, but this is the current
attempt: ./configure --prefix=/usr/local/php5
--with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-pgsql=/usr/local/pgsql --with-ldap=/usr/local/openldap --with-pear
--with-zlib  --with-libexpat-dir=/usr/local/shared

Expected result:
----------------
a file called extensions.bin that should be the serialized output of the
nasty looking array.  Hey I didn't write the original code, I'm just the
messenger. :)  I definitely don't expect it to not be able to allocate 3
megs.

Actual result:
--------------
FATAL:  erealloc():  Unable to allocate 3358824 bytes

-- 
Edit bug report at http://bugs.php.net/?id=38124&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38124&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38124&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38124&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38124&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38124&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38124&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38124&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38124&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38124&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38124&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38124&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38124&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38124&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38124&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38124&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38124&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38124&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38124&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38124&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38124&r=mysqlcfg

Reply via email to