[Tickets #12265] Re: IMAP package throws errors

noreply at bugs.horde.org noreply at bugs.horde.org
Thu May 23 06:54:27 UTC 2013


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: http://bugs.horde.org/ticket/12265
------------------------------------------------------------------------------
  Ticket           | 12265
  Aktualisiert Von | torben at dannhauer.info
  Zusammenfassung  | IMAP package throws errors
  Warteschlange    | Horde Framework Packages
  Version          | Git master
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 1. Low
  Milestone        |
  Patch            |
  Zuständige       |
------------------------------------------------------------------------------


torben at dannhauer.info (2013-05-23 06:54) hat geschrieben:

>> could it happen that the IMAP server invalidates the handle and thus
>> it is now null?
>
> No.  A PHP resource is a specific data type.  It can never be  
> changed by PHP itself to a different data type.
>
>> The error is located in Imap sockets protected function _readStream()
>> The reason for the flooded error logs is, that the do-while loop is
>> infinite if the stream is NULL, since the "break;" is only called
>> with a vaild stream.
>> So even it seems to be a rare occassion whrer the strem handle is
>> NULL, the code should handle such a sittuation correctly.
>>
>>  have a code proposal ( see attached patch) which handles the NULL
>> handle correctly.
>
> This is not a correct fix.  This simply masks the issue.  It doesn't  
> fix anything.
>
> The correct fix is to figure out WHY _stream is null before entering  
> that method (i.e. the debug backtrace).  You can use Horde::debug()  
> to help you with this, e.g. in _readStream():
>
> if (is_null($this->_stream)) {
>     Horde::debug();
>     exit;
> }

Thanks for the debug lines, this seems to be a more efficient  
debugging than my debug code was.

However, I think we have a problem at two ends.
IMO, yes, we need to figure out the reason. But additionally I'm still  
convinced that a good function should filter out garbage input  to  
prevent crashes or loops as this one.

I'll need some days to dive into it, I'll call back once I know the  
reason forthe null resources.

regards,
Torben





More information about the bugs mailing list