#49445 [Opn->Fbk]: Segfault on connection close

From: Date: Wed, 02 Sep 2009 22:47:00 +0000
Subject: #49445 [Opn->Fbk]: Segfault on connection close
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-141880@lists.php.net to get a copy of this message
 ID:               49445
 Updated by:       scottmac@php.net
 Reported By:      jake dot levitt at mailtrust dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         IMAP related
 Operating System: CentOS 5
 PHP Version:      5.3.0
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Also what version of c-client are you using?


Previous Comments:
------------------------------------------------------------------------

[2009-09-02 22:16:09] jake dot levitt at mailtrust dot com

Description:
------------
If an IMAP server closes a connection without sending a BYE command,
PHP segfaults on the next IMAP command run on the mailbox resource.  I
noticed this while testing against an exchange server, where I was
selecting a folder that doesn't exist.  After 10 times it disconnected
me without sending a BYE command.  When this happens PHP segfaulted,
which doesn't allow for the script to do any error handling.

Reproduce code:
---------------
<?php
//Try testing against an exchange server that disconnects after a
//certain number of "bad" commands
$flags = '/novalidate-cert';
$host = 'secure.emailsrvr.com:143';
$username = 'noteworthy2@sts.com';
$password = 'webmail';
$base_imap_string = '{' . $host . $flags . '}';
$connect_string = $base_imap_string . 'INBOX';
$mailbox = imap_open($connect_string, $username, $password, 0, 3);
$connect_string = $base_imap_string . 'Does not exist';
for ($i = 0; $i < 10; $i++) {
    $reopen_success = imap_reopen($mailbox, $connect_string, 0, 3);
}

Expected result:
----------------
imap_reopen either returns false or throws a PHP error.

Actual result:
--------------
The script segfaults.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49445&edit=1



Thread (2 messages)

« previous php.bugs (#141880) next »