|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26894 Apache2 hangs when working with mail
Submitted: 2004-01-13 09:45 UTC Modified: 2004-02-10 05:19 UTC
From: techtonik at tut dot by Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.3.5RC2 OS: NT 4.0 SP6a
Private report: No CVE-ID: None
 [2004-01-13 09:45 UTC] techtonik at tut dot by
I'm trying to parse a lot of msges in pop3 mailbox using IMAP functions. Unfortunately I can't find debug biuld for PHP 4.3.4 and I can't compile it myself, so I'll try to descript what is wrong in general.

First of all Apache in hung state is endlessly munching file with name like msg77 or msg6 and so on, which it creates in the root! directory on my drive. Figured by Filemon. This file contains full email message, which I'm trying to send via mail() function. Message is random size.
Now munching one with size about 1687 bytes.

Apache works about hour and couldn't output anything even though I have timeout set to 180 seconds. So I can't even figure the line, where it hangs. 

My script reads all msgs from 1st till last by one. When msg fetched, an attach in tar.gz format is taked out of it, decompressed by gzinflate() and parsed by preg_match_all().
After that parsed letters remailed to another email.

It all began with gzinflate() reporting buffer error and then data error after parsing some amount of msgs. These errors in turn appeared after I have added imap_delete() and imap_expunge() to erase successfully parsed messages.
Now it just hangs and that is all.

If I can fugure out which function makes Apache 2.0.48 hang
 I can do a more detailed report.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-13 13:30 UTC]
Please try using this CVS snapshot:
For Windows:

Try the snapshot first.

 [2004-01-16 09:36 UTC] techtonik at tut dot by
I've tried this build. Problem persists - Apache hangs. Virtual memory allocation stops at approximately 6Mb.
 [2004-01-16 10:25 UTC]
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 avoid embedding huge scripts into the report.

 [2004-02-09 13:42 UTC] techtonik at tut dot by
See Bug #23257
There is a sample script, which hangs just fine for me..
File "msg2" created in the root C:\
Additionally I added xdebug trace:

Start of function trace
    1.1202          0     -> imap_open() C:\Lotus\virlist_db\ema.php:9
    6.7052          0     -> imap_num_msg() C:\Lotus\virlist_db\ema.php:11
    6.7719          0     -> imap_fetchstructure() C:\Lotus\virlist_db\ema.php:15
    6.9647          0     -> imap_delete() C:\Lotus\virlist_db\ema.php:17
    6.9737          0     -> imap_expunge() C:\Lotus\virlist_db\ema.php:19
    6.9804          0     -> imap_fetchstructure() C:\Lotus\virlist_db\ema.php:21
 [2004-02-09 21:55 UTC]
It's c-client that hangs, not anything in PHP.
(Instead of using POP3, use IMAP as it works fine..there are some restrictions with deleting/expunging when you use POP3..)

 [2004-02-10 05:19 UTC] techtonik at tut dot by
Can you implement some custom timeout for connection with this c-client (i don't know that it is)?
Is it ok, that this c-client makes temporary files into my root directory?
Do you know any free IMAP servers for windows?
Can you at least document this behavior?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 22:01:32 2024 UTC