php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23106 imap_fetch_overview hangs with 1000s of messages
Submitted: 2003-04-07 23:41 UTC Modified: 2003-04-21 09:21 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: charlesb at ekit-inc dot com Assigned:
Status: No Feedback Package: IMAP related
PHP Version: 4.3.1 OS: solaris/i86
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: charlesb at ekit-inc dot com
New email:
PHP Version: OS:

 

 [2003-04-07 23:41 UTC] charlesb at ekit-inc dot com
This is very hard to pin down as (a) there is no error log produced and (b) it does not occur when the server load is small (thus setting up a standalone server with gd doesn't provide anything useful).


In a nutshell, the following code crashes apache when there are a large number of messages in the inbox (1000-3000, depending on the server load).  There is nothing in the error logs to help, the browser just gives an "unable to locate server" error.


       $stream = imap_reopen($imp->stream, '{' . "$imp->server:$imp->port". '}' . $preamble . $mboxes[$i], OP_READONLY);
        $MC=imap_check($imp->stream);
        $MN=$MC->Nmsgs;
        $overview=imap_fetch_overview($imp->stream,"1:$MN",0);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-08 00:26 UTC] kalowsky@php.net
And you're sure this isn't a case of timeouts?  I.E. the webserver or the PHP application timing out?

Does your IMAP server even show that a connection was established?

 [2003-04-08 01:09 UTC] charlesb at ekit-inc dot com
Yeah, fair question :) My instant answer to this was "no, because imap_sort can read the whole mailbox no problems".

But, we briefly redeployed our webmail with this and came up with two things that I hope will be enough:

In the error_log:
~GOut of memory (Needed 8164 bytes)
^GOut of memory (Needed 8164 bytes)
^GOut of memory (Needed 8164 bytes)
^GOut of memory (Needed 8164 bytes)
^GOut of memory (Needed 8164 bytes)
^GOut of memory (Needed 8164 bytes)
^GOut of memory (Needed 8164 bytes)
FATAL:  emalloc():  Unable to allocate 40 bytes

So we upped the ulimit in apache and it fixed the problem...*but* a standalone server can display the mailbox in question with a lower ulimit.  My guess is the imap routine in question is using an unusual memory allocation technique?

Hope you can do something with this.  Thanks.
 [2003-04-08 15:31 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

Also update your c-client first.

 [2003-04-21 09:21 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 Dec 27 03:01:28 2024 UTC