ID:               38124
 User updated by:  boing at boing dot com
 Reported By:      boing at boing dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Reproducible crash
 Operating System: openbsd 3.8
 PHP Version:      5.1.4
 New Comment:

Thanks for the speedy response!

I tried in linux also, works well in gentoo, not in openbsd.  :( But
openbsd has some weird stuff going on: propolice, etc.  Windows has
marks on it where I've been touchin in with the 10 foot poll.

course the usual bsd analities result in the linking stage:
main/.libs/php_sprintf.o(.text+0x24): In function `php_sprintf':
/usr/local/src/php5.2-200607172030/main/php_sprintf.c:38: warning:
vsprintf() is often misused, please use vsnprintf()
ext/pdo/.libs/pdo_dbh.o(.text+0x37): In function
`pdo_raise_impl_error':
/usr/local/src/php5.2-200607172030/ext/pdo/pdo_dbh.c:60: warning:
strcpy() is almost always misused, please use strlcpy()
ext/sqlite/libsqlite/src/.libs/btree.o(.text+0x46ba): In function
`checkRef':
/usr/local/src/php5.2-200607172030/ext/sqlite/libsqlite/src/btree.c:3201:
warning: sprintf() is often misused, please use snprintf()
ext/mysql/.libs/php_mysql.o(.text+0x5007): In function
`php_mysql_field_info':
/usr/local/src/php5.2-200607172030/ext/mysql/php_mysql.c:2418: warning:
strcat() is almost always misused, please use strlcat()

script results w/ php5.2-200607172030:  (same thing, slightly different
byte count, of course)

kusanagi:/usr/local/apache2/htdocs)unlimit
kusanagi:/usr/local/apache2/htdocs)limit
cputime      unlimited
filesize     unlimited
datasize     262144 kbytes
stacksize    32768 kbytes
coredumpsize unlimited
memoryuse    392364 kbytes
descriptors  1024
memorylocked 392364 kbytes
maxproc      512
kusanagi:/usr/local/apache2/htdocs)ls -la typo3temp/extensions.xml.gz
-rw-r--r--  1 boing  wheel  599305 Jul 17 02:32
typo3temp/extensions.xml.gz
kusanagi:/usr/local/apache2/htdocs)/usr/local/php52/bin/php
phptest.php
start handler<br>
new handler<br>
parsing......<br>
<p>The extensions list has been updated and now contains 1777 extension
entries.</p><br>
saving...<br>
FATAL:  erealloc():  Unable to allocate 3346466 bytes


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

[2006-07-17 20:01:49] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Works fine here (Linux).

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

[2006-07-17 13:02:48] boing at boing dot com

BTW - openbsd 3.8 package of php 5.0.4 exhibits the same behavior. 
package name:  php5-core-5.0.4p0

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

[2006-07-17 12:05:27] boing at boing dot com

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 this bug report at http://bugs.php.net/?id=38124&edit=1

Reply via email to