php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33774 Recieving "FATAL: emalloc()" error
Submitted: 2005-07-19 19:02 UTC Modified: 2005-07-27 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: brandonnimon at comcast dot net Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 4.4.0 OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: brandonnimon at comcast dot net
New email:
PHP Version: OS:

 

 [2005-07-19 19:02 UTC] brandonnimon at comcast dot net
Description:
------------
I am programming a PHP program and have recently upgraded to PHP 4.4.0 (from 4.3.11). The current program I had did not have any issues. But I wrote more of the program and ran into a "FATAL:  emalloc() [could not allocate 25948985 bytes]". I don't have the exact error, since my error log got wiped.
I reverted back to 4.3.11 to see if it would give me any real errors (since I knew there were some core updates in 4.4.0). It gave me 1.8GB of real errors and corrupted my error log. I ran the test again on a fresh error log, stopped it sooner (less than a second) which gave me 660000 lines of errors. There are some problems with my program (and they happened to be in/cause and infinite loop:
[Tue Jul 19 09:10:21 2005] [error] PHP Warning:  array_shift(): The argument should be an array in c:\\program files\\apache group\\apache\\htdocs\\guestbookadmin\\commoncode.php on line 170
[Tue Jul 19 09:10:21 2005] [error] PHP Notice:  Undefined variable:  active_entries in c:\\program files\\apache group\\apache\\htdocs\\guestbookadmin\\commoncode.php on line 169
But it seems that 4.3.11 should limit the number of errors logged, and 4.4.0 should display more than an emalloc() error.

The only change I've made to my PHP file, other than upload settings, is the max script time is set to 24 hours and max memory alotment is 250MB (plenty of memory to go around).

Reproduce code:
---------------
http://67.181.154.141:81/guestbookadminsource/ there should be a list of the page's .source files. This site is only up while I am awake (7:30am - 11:00pm PST -weekdays; 10:00am - 12:00am PST -weekends). You can either click on each file to show highlighted source, or click the "edit" link on the right to get the source.
The files you need (I think -- worst comes to worst, copy all the files as PHP files and run the program, it will self-install) to reproduce the errors are commoncode.php, logintest.php, settings.php, manage.php, hycodeii.php, inout.php.

To reproduce:
-open inout.php and add a few posts (enter the info at the top).
-login to guestbook admin by opening manage.php and type "admin", password: "password".
-You should see a list of the entries you just put in. Hit "accept" on any of them.
-The system will seem to lockup. Hit "stop" and check your error log.

Expected result:
----------------
If you are running my program, it should say "entry #.. has been accepted" and move that entry to the active entry list.

As for PHP, it shouldn't just say "FATAL: emalloc()..." it should have what actually happend (like with 4.3.11, but shorter).

Actual result:
--------------
I think you've gotten the drift of what actually happens. To recap:
4.4.0 stops the browser, and posts "FATAL: emalloc()..." to the error log.
4.3.11 posts an infinite amout of errors to the error log.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-19 19:05 UTC] brandonnimon at comcast dot net
I think you will also need entryformat.php once you have some entries in.
 [2005-07-19 19:12 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-07-19 19:58 UTC] brandonnimon at comcast dot net
Available source: http://67.181.154.141:81/guestbookadminsource/

The errors in my program are fixed, but that is not this bug is about (read expected result). The program was just missing a couple variables from a newly created function. I did not update the source, so the bug can be analized.
 [2005-07-19 20:45 UTC] tony2001@php.net
Please reread my previous post. 
Reopen the report only when you have a *single* script max. 10-20 lines long (it can be bigger, but I doubt that someone will have enough willingness to debug 300Kb of code).
 [2005-07-27 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-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 17:05:52 2022 UTC