php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24542 x = func1(func2(x)) does not work
Submitted: 2003-07-08 13:20 UTC Modified: 2003-07-15 02:26 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: sysop at kluware dot de Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.3.2 OS: FreeBSD 4.8 Stable
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-07-08 13:20 UTC] sysop at kluware dot de
Description:
------------
We are using IMP/JORDE an our IMAP server. With PHP 4.3.2 (and 4.3.3RC1) we get an error when we try to send very large attachments (> 1.5 MB).

IMP aborts with an error like 


Fatal error: Allowed memory size of 16777216 bytes exhausted at (null):0 (tried 
to allocate 7565911 bytes) in /var/spool/www/via/phproject/addons/E-
Mail/imp/compose.php on line 345




Reproduce code:
---------------
When analysing the code at line 345, we found that 

$contents = chunk_split(base64_encode($contents),76,"\n");

does not realibly work, while

 $contents1 = base64_encode($contents);
 $contents = chunk_split($contents1,76,"\n");

doese the job ...


Expected result:
----------------
both codelines should have the same result ...


Actual result:
--------------
1. Fatal error: Allowed memory size of 16777216 bytes exhausted at (null):0 (tried 
to allocate 7565911 bytes) in /var/spool/www/via/phproject/addons/E-
Mail/imp/compose.php on line 345


2. ok

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-08 13:25 UTC] gschlossnagle@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is not a bug, simply representative of the different 
ways that PHP needs to manage temporary variables.  At any 
rate, for handling multiple copies of message bodies that 
large (as your code does), you memory limit is too low.
 [2003-07-08 13:42 UTC] sysop at kluware dot de
So you think thats an error of HORDE/IMP coders? 

We even tried an 2 MB attachment with 32MB memory limit, and it dies on example 1, on example 2 it run with 8MB memory limit. On 4.3.1 all was fine, also.

So we think there could be a problem on memory management ...

Thanx for your quick answer ...
 [2003-07-08 14:18 UTC] sysop at kluware dot de
Forgot to reopen it. Transmitted bugreport to HORDE.ORG waiting for their answer, ... But why did it run before upgrading to 4.3 ?
 [2003-07-09 18:09 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

And if this still happens, provide a short reproducing script. (if you're not able to provide one, ask for the horder folks to do it for you..)

 [2003-07-15 02:26 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 18:01:33 2024 UTC