|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-08 00:26 UTC]
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]
Please try using this CVS snapshot:
For Windows:

Also update your c-client first.

 [2003-04-21 09:21 UTC]
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-2021 The PHP Group
All rights reserved.
Last updated: Sun Mar 07 15:01:23 2021 UTC