[Tickets #8036] Avoid infinite loop if popen fails

bugs at horde.org bugs at horde.org
Sun Mar 1 15:15:28 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8036
------------------------------------------------------------------------------
  Ticket             | 8036
  Created By         | horde at immerda.ch
  Summary            | Avoid infinite loop if popen fails
  Queue              | Horde Base
  Version            | 3.3.3
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
+New Attachment     | pgp_avoid_infinite_loop.diff
------------------------------------------------------------------------------


horde at immerda.ch (2009-03-01 10:15) wrote:

We had various times the problem that the max. memory for a php  
process exceeded while talking to gpg and hence the popen termintated  
abnormally. This abnormal termination isn't caught by horde and hence  
the following loop will lead to an infinite loop and fill the php logs.

http://ch.php.net/manual/en/function.feof.php warns about the problem  
of an infinite loop and comments propose various ways to avoid that.

The attached patch will introduce one of the discussed ways to deal  
with this problem.

We are operating now with this patch for some time and didn't  
encounter anymore the problem of an infinite loop.

As far as we could see this problem exists in other popen calls as  
well and hence it might be worth to review all the popen calls of  
horde apps, to avoid this problem.






More information about the bugs mailing list