#33349 [Opn]: imap_fetchstructure hangs on some mails
ID: 33349 User updated by: benjamin dot malynovytch at libertic dot fr Reported By: benjamin dot malynovytch at libertic dot fr Status: Open Bug Type: IMAP related Operating System: * PHP Version: 5CVS-2005-06-20 New Comment: I gave a try on PHP 4.3.11, still not working. Previous Comments: [2005-06-20 16:01:42] root at ka-rel dot cz I'm experiencing the same behaviour with certain messages (mostly spam but not always). A sample message is located at http://ka-rel.cz/imap/bad001.tmp. Whenever imap_fetchstructure function tries to analyze the message, cpu gets to 100% and hangs (on NT 4.0 Server) or displays the crash message (on WinXP), requesting to send it to Microsoft. Till now, I've noticed that the bad messages have improperly set boundary strings - maybe this confuses the function and results to unability to parse individual parts of message. Also, such messages are not decoded correctly if opened in a mail client. PHP 4.3.3 IMAP c-Client Version 2001 WinXP: php_imap.dll, 593920 bytes, 24th August 2003 WinNT: php_imap.dll, 602112 bytes, 6th June 2005 [2005-06-20 15:11:36] benjamin dot malynovytch at libertic dot fr iliaa and sniper, you'll find the asked informations in your mailboxes. Is it possible that php5 doesn't work properly, when php4 does ? It tried the application on an old box, using php4(4.3.4), and it works fine (even on the message-of-death). I haven't tried out on the production box though, cause I can't swap so easily on php4 (other applications will dropp). I also noticed, that a similar bug had been corrected in php 4.0.4 (imap_fetchstructure crashing) (Changelog). Is it possible that php5 has the same bug again ? [2005-06-20 11:54:59] [EMAIL PROTECTED] We're interested in the 'message-of-death' only. Just export that message and put it online or send via email to [EMAIL PROTECTED] and [EMAIL PROTECTED] Your initial example script is a bit odd though, what EXACTLY (for real!) is $mbox_path set to? [2005-06-20 11:32:27] benjamin dot malynovytch at libertic dot fr Illia said: If the problem persists, please provide a URL to the complete text of the message that causes the hang. As I said just before, no output message are created. No error, nothing, except the generated code that had been flushed (cleanly) before the crash. I can't even give you access to the page the generates this error: it's placed on an intranet. [2005-06-20 10:24:02] [EMAIL PROTECTED] Do not add any strace output here if not asked for. Please provide the information Ilia asked before. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33349 -- Edit this bug report at http://bugs.php.net/?id=33349edit=1
#33349 [Fbk-Opn]: imap_fetchstructure hangs on some mails
ID: 33349 User updated by: benjamin dot malynovytch at libertic dot fr Reported By: benjamin dot malynovytch at libertic dot fr -Status: Feedback +Status: Open Bug Type: IMAP related Operating System: Linux (Mandrake 9.2) PHP Version: 5.0.4 New Comment: I tried several versions of imap (UW): imap-2001a, imap-2002a, imap-2004a, imap-2004d, imap-2004e-DEVEL None of them worked. I'm afraid their's no error log: the application hangs without returning anything (would be too easy to debug). The only thing I know, is that the application hangs just after the call to imap_fetchstructure (did some echo ...; flush(); to be sure). Any idea ? Previous Comments: [2005-06-18 00:45:26] [EMAIL PROTECTED] If the problem persists, please provide a URL to the complete text of the message that causes the hang. [2005-06-17 12:23:17] benjamin dot malynovytch at libertic dot fr I had already tried the CVS version before submitting the bug. It hasn't solved the problem. I am going to try a different version of the c-client library, but the University of Washington only gives the latest version on their ftp (last update was made at the end of 2003 - Version 2004d). I hope it will solve the problem, but why does the imap_fetchstructure function doesn't send en error message if something goes wrong (lost connection, invalid format ...) ? Thanks for the support :) [2005-06-15 15:13:58] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip If you can reproduce it with the snapshot, try upgrading the c-client. (it might be a bug in that, not PHP..) [2005-06-15 11:36:30] benjamin dot malynovytch at libertic dot fr Description: Calling imap_fetchstructure() on certain multi-part messages causes an indefinite hang (function never returns). Versions: Tried: PHP-5.0.3, PHP-5.0.4, PHP-5.0.5-dev c-client: imap-2004d Apache: httpd-2.0.53 I gave a look at other related bugs, and checkd that que imap link was still up when the function was called. I also tried to place a timer between two function calls. Nothing worked, the link is still up when que function hangs. Reproduce code: --- ?php $pop_user = someuser; $pop_pass = somepassword; $pop_host = somehost.somewhere.com; $mbox_path = /path/to/failedmsg.1; $pop_conn_string = \{$pop_host:143/imap}$mbox_path; $pop_conn = imap_open($pop_conn_string, $pop_user, $pop_pass); // Assuming message-of-death is first one in the mbox $mimeobj = imap_fetchstructure($pop_conn, 1); // Never gets here... imap_close($pop_conn); ? Expected result: imap_fetchstructure() should quickly return the structure of the message. Actual result: -- The function never returns on most mails, and page loading stops. -- Edit this bug report at http://bugs.php.net/?id=33349edit=1
#33349 [Opn]: imap_fetchstructure hangs on some mails
ID: 33349 User updated by: benjamin dot malynovytch at libertic dot fr Reported By: benjamin dot malynovytch at libertic dot fr Status: Open Bug Type: IMAP related Operating System: Linux (Mandrake 9.2) PHP Version: 5.0.4 New Comment: Here's a part of the strace of the child process that processed the request. It ends on a Seg Fault. ... 31537 time(NULL)= 1119254602 31537 time(NULL)= 1119254602 31537 select(58, NULL, [57], [57], {60, 0}) = 1 (out [57], left {60, 0}) 31537 time(NULL)= 1119254602 31537 write(57, 0009 FETCH 2 (BODYSTRUCTURE ..., 40) = 40 31537 time(NULL)= 1119254602 31537 time(NULL)= 1119254602 31537 select(58, [57], NULL, [57], {60, 0}) = 1 (in [57], left {60, 0}) 31537 time(NULL)= 1119254602 31537 read(57, * 2 FETCH (BODYSTRUCTURE (((\tex..., 8192) = 936 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 alarm(0) = 0 ... 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 time(NULL)= 1119254602 31537 alarm(0) = 0 31537 alarm(0) = 0 31537 --- SIGSEGV (Segmentation fault) @ 0 (0) --- 31537 chdir(/usr/local/httpd/httpd) = 0 31537 rt_sigaction(SIGSEGV, {SIG_DFL}, {SIG_DFL}, 8) = 0 31537 getpid() = 31537 31537 getpid() = 31537 31537 kill(31537, SIGSEGV) = 0 31537 sigreturn() = ? (mask now [RTMIN]) 31537 --- SIGSEGV (Segmentation fault) @ 0 (0) --- 31537 +++ killed by SIGSEGV +++ Previous Comments: [2005-06-20 09:51:13] benjamin dot malynovytch at libertic dot fr I tried several versions of imap (UW): imap-2001a, imap-2002a, imap-2004a, imap-2004d, imap-2004e-DEVEL None of them worked. I'm afraid their's no error log: the application hangs without returning anything (would be too easy to debug). The only thing I know, is that the application hangs just after the call to imap_fetchstructure (did some echo ...; flush(); to be sure). Any idea ? [2005-06-18 00:45:26] [EMAIL PROTECTED] If the problem persists, please provide a URL to the complete text of the message that causes the hang. [2005-06-17 12:23:17] benjamin dot malynovytch at libertic dot fr I had already tried the CVS version before submitting the bug. It hasn't solved the problem. I am going to try a different version of the c-client library, but the University of Washington only gives the latest version on their ftp (last update was made at the end of 2003 - Version 2004d). I hope it will solve the problem, but why does the imap_fetchstructure function doesn't send en error message if something goes wrong (lost connection, invalid format ...) ? Thanks for the support :) [2005-06-15 15:13:58] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip If you can reproduce it with the snapshot, try upgrading the c-client. (it might be a bug in that, not PHP..) [2005-06-15 11:36:30] benjamin dot malynovytch at libertic dot fr Description: Calling imap_fetchstructure() on certain multi-part messages causes an indefinite hang (function never returns). Versions: Tried: PHP-5.0.3, PHP-5.0.4, PHP-5.0.5-dev c-client: imap-2004d Apache: httpd-2.0.53 I gave
#33349 [Fbk-Opn]: imap_fetchstructure hangs on some mails
ID: 33349 User updated by: benjamin dot malynovytch at libertic dot fr Reported By: benjamin dot malynovytch at libertic dot fr -Status: Feedback +Status: Open Bug Type: IMAP related Operating System: * PHP Version: 5CVS-2005-06-20 New Comment: Illia said: If the problem persists, please provide a URL to the complete text of the message that causes the hang. As I said just before, no output message are created. No error, nothing, except the generated code that had been flushed (cleanly) before the crash. I can't even give you access to the page the generates this error: it's placed on an intranet. Previous Comments: [2005-06-20 10:24:02] [EMAIL PROTECTED] Do not add any strace output here if not asked for. Please provide the information Ilia asked before. [2005-06-20 09:51:13] benjamin dot malynovytch at libertic dot fr I tried several versions of imap (UW): imap-2001a, imap-2002a, imap-2004a, imap-2004d, imap-2004e-DEVEL None of them worked. I'm afraid their's no error log: the application hangs without returning anything (would be too easy to debug). The only thing I know, is that the application hangs just after the call to imap_fetchstructure (did some echo ...; flush(); to be sure). Any idea ? [2005-06-18 00:45:26] [EMAIL PROTECTED] If the problem persists, please provide a URL to the complete text of the message that causes the hang. [2005-06-15 11:36:30] benjamin dot malynovytch at libertic dot fr Description: Calling imap_fetchstructure() on certain multi-part messages causes an indefinite hang (function never returns). Versions: Tried: PHP-5.0.3, PHP-5.0.4, PHP-5.0.5-dev c-client: imap-2004d Apache: httpd-2.0.53 I gave a look at other related bugs, and checkd that que imap link was still up when the function was called. I also tried to place a timer between two function calls. Nothing worked, the link is still up when que function hangs. Reproduce code: --- ?php $pop_user = someuser; $pop_pass = somepassword; $pop_host = somehost.somewhere.com; $mbox_path = /path/to/failedmsg.1; $pop_conn_string = \{$pop_host:143/imap}$mbox_path; $pop_conn = imap_open($pop_conn_string, $pop_user, $pop_pass); // Assuming message-of-death is first one in the mbox $mimeobj = imap_fetchstructure($pop_conn, 1); // Never gets here... imap_close($pop_conn); ? Expected result: imap_fetchstructure() should quickly return the structure of the message. Actual result: -- The function never returns on most mails, and page loading stops. -- Edit this bug report at http://bugs.php.net/?id=33349edit=1
#33349 [Fbk-Opn]: imap_fetchstructure hangs on some mails
ID: 33349 User updated by: benjamin dot malynovytch at libertic dot fr Reported By: benjamin dot malynovytch at libertic dot fr -Status: Feedback +Status: Open Bug Type: IMAP related Operating System: * PHP Version: 5CVS-2005-06-20 New Comment: iliaa and sniper, you'll find the asked informations in your mailboxes. Is it possible that php5 doesn't work properly, when php4 does ? It tried the application on an old box, using php4(4.3.4), and it works fine (even on the message-of-death). I haven't tried out on the production box though, cause I can't swap so easily on php4 (other applications will dropp). I also noticed, that a similar bug had been corrected in php 4.0.4 (imap_fetchstructure crashing) (Changelog). Is it possible that php5 has the same bug again ? Previous Comments: [2005-06-20 11:54:59] [EMAIL PROTECTED] We're interested in the 'message-of-death' only. Just export that message and put it online or send via email to [EMAIL PROTECTED] and [EMAIL PROTECTED] Your initial example script is a bit odd though, what EXACTLY (for real!) is $mbox_path set to? [2005-06-20 11:32:27] benjamin dot malynovytch at libertic dot fr Illia said: If the problem persists, please provide a URL to the complete text of the message that causes the hang. As I said just before, no output message are created. No error, nothing, except the generated code that had been flushed (cleanly) before the crash. I can't even give you access to the page the generates this error: it's placed on an intranet. [2005-06-20 10:24:02] [EMAIL PROTECTED] Do not add any strace output here if not asked for. Please provide the information Ilia asked before. [2005-06-20 09:51:13] benjamin dot malynovytch at libertic dot fr I tried several versions of imap (UW): imap-2001a, imap-2002a, imap-2004a, imap-2004d, imap-2004e-DEVEL None of them worked. I'm afraid their's no error log: the application hangs without returning anything (would be too easy to debug). The only thing I know, is that the application hangs just after the call to imap_fetchstructure (did some echo ...; flush(); to be sure). Any idea ? [2005-06-18 00:45:26] [EMAIL PROTECTED] If the problem persists, please provide a URL to the complete text of the message that causes the hang. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33349 -- Edit this bug report at http://bugs.php.net/?id=33349edit=1
#33349 [Fbk-Opn]: imap_fetchstructure hangs on some mails
ID: 33349 User updated by: benjamin dot malynovytch at libertic dot fr Reported By: benjamin dot malynovytch at libertic dot fr -Status: Feedback +Status: Open Bug Type: IMAP related Operating System: Linux (Mandrake 9.2) PHP Version: 5.0.4 New Comment: I had already tried the CVS version before submitting the bug. It hasn't solved the problem. I am going to try a different version of the c-client library, but the University of Washington only gives the latest version on their ftp (last update was made at the end of 2003 - Version 2004d). I hope it will solve the problem, but why does the imap_fetchstructure function doesn't send en error message if something goes wrong (lost connection, invalid format ...) ? Thanks for the support :) Previous Comments: [2005-06-15 15:13:58] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip If you can reproduce it with the snapshot, try upgrading the c-client. (it might be a bug in that, not PHP..) [2005-06-15 11:36:30] benjamin dot malynovytch at libertic dot fr Description: Calling imap_fetchstructure() on certain multi-part messages causes an indefinite hang (function never returns). Versions: Tried: PHP-5.0.3, PHP-5.0.4, PHP-5.0.5-dev c-client: imap-2004d Apache: httpd-2.0.53 I gave a look at other related bugs, and checkd that que imap link was still up when the function was called. I also tried to place a timer between two function calls. Nothing worked, the link is still up when que function hangs. Reproduce code: --- ?php $pop_user = someuser; $pop_pass = somepassword; $pop_host = somehost.somewhere.com; $mbox_path = /path/to/failedmsg.1; $pop_conn_string = \{$pop_host:143/imap}$mbox_path; $pop_conn = imap_open($pop_conn_string, $pop_user, $pop_pass); // Assuming message-of-death is first one in the mbox $mimeobj = imap_fetchstructure($pop_conn, 1); // Never gets here... imap_close($pop_conn); ? Expected result: imap_fetchstructure() should quickly return the structure of the message. Actual result: -- The function never returns on most mails, and page loading stops. -- Edit this bug report at http://bugs.php.net/?id=33349edit=1
#33349 [NEW]: imap_fetchstructure hangs on some mails
From: benjamin dot malynovytch at libertic dot fr Operating system: Linux (Mandrake 9.2) PHP version: 5.0.4 PHP Bug Type: IMAP related Bug description: imap_fetchstructure hangs on some mails Description: Calling imap_fetchstructure() on certain multi-part messages causes an indefinite hang (function never returns). Versions: Tried: PHP-5.0.3, PHP-5.0.4, PHP-5.0.5-dev c-client: imap-2004d Apache: httpd-2.0.53 I gave a look at other related bugs, and checkd that que imap link was still up when the function was called. I also tried to place a timer between two function calls. Nothing worked, the link is still up when que function hangs. Reproduce code: --- ?php $pop_user = someuser; $pop_pass = somepassword; $pop_host = somehost.somewhere.com; $mbox_path = /path/to/failedmsg.1; $pop_conn_string = \{$pop_host:143/imap}$mbox_path; $pop_conn = imap_open($pop_conn_string, $pop_user, $pop_pass); // Assuming message-of-death is first one in the mbox $mimeobj = imap_fetchstructure($pop_conn, 1); // Never gets here... imap_close($pop_conn); ? Expected result: imap_fetchstructure() should quickly return the structure of the message. Actual result: -- The function never returns on most mails, and page loading stops. -- Edit bug report at http://bugs.php.net/?id=33349edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33349r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33349r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33349r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=33349r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=33349r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33349r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33349r=needscript Try newer version: http://bugs.php.net/fix.php?id=33349r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33349r=support Expected behavior: http://bugs.php.net/fix.php?id=33349r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33349r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33349r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=33349r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33349r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=33349r=dst IIS Stability: http://bugs.php.net/fix.php?id=33349r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33349r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33349r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33349r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33349r=mysqlcfg