#35894 [Fbk->Opn]: php-imap doesn't trap USR2 when mailbox is locked
| From: | jik at kamens dot brookline dot ma dot us | Date: | Wed, 04 Jan 2006 20:14:15 +0000 |
| Subject: | #35894 [Fbk->Opn]: php-imap doesn't trap USR2 when mailbox is locked | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91487@lists.php.net to get a copy of this message | ||
ID: 35894
User updated by: jik at kamens dot brookline dot ma dot us
Reported By: jik at kamens dot brookline dot ma dot us
-Status: Feedback
+Status: Open
Bug Type: IMAP related
Operating System: Linux
PHP Version: 5.1.1
New Comment:
There's a patch which makes this problem go away at
http://stuff.mit.edu/~jik/php-5.1.1-imap-usr2.patch.txt.
However,
rather than using the #if statement I used to figure out whether to
enable the relevant code, you may want to insert a check for the
function arm_signal in the c-client library in the configure script,
define a cpp symbol if the function exists, and use my code if that cpp
symbol is defined.
Previous Comments:
------------------------------------------------------------------------
[2006-01-04 19:59:55] tony2001@php.net
>Did you run the script twice at the same time as I said in my report?
Yes. And the mailbox is not empty.
------------------------------------------------------------------------
[2006-01-04 19:53:02] jik at kamens dot brookline dot ma dot us
Also, let me remind you that it won't happen if the mailbox file is
empty; it needs to have messages in it, or c-client won't lock it.
------------------------------------------------------------------------
[2006-01-04 19:52:09] jik at kamens dot brookline dot ma dot us
Did you run the script twice at the same time as I said in my report?
That's the only way you're going to be able to reproduce it, since it
requires contention from two different processes.
------------------------------------------------------------------------
[2006-01-04 19:51:27] jik at kamens dot brookline dot ma dot us
$ ls -l /var/mail/jik; php /tmp/imap_open.php /var/mail/jik & php
/tmp/imap_open.php /var/mail/jik
-rw------- 1 jik mail 871 Jan 4 13:44 /var/mail/jik
[1] 31702
starting to open mailbox
starting to open mailbox
successfully opened mailbox
PHP Notice: Unknown: Trying to get mailbox lock from process 31702
(errflg=1) in Unknown on line 0
[1]+ User defined signal 2 php /tmp/imap_open.php /var/mail/jik
$
New version of the script:
<?php
print "starting to open mailbox\n";
imap_open($argv[1], "", "");
print "successfully opened mailbox\n";
?>
I don't know why you can't reproduce it; it reproduces easily for me,
as shown above. The c-client documentation and source code make it
clear that this is going on, so unless you can confirm that PHP is
installing a USR2 handle when locking mailboxes, I'm pretty sure it's a
problem.
------------------------------------------------------------------------
[2006-01-04 19:33:42] tony2001@php.net
Can't reproduce.
I don't see any error messages and the script works fine.
------------------------------------------------------------------------
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/35894
--
Edit this bug report at http://bugs.php.net/?id=35894&edit=1