6.0.0-alpha12
6/12/25

[#8036] Avoid infinite loop if popen fails
Summary Avoid infinite loop if popen fails
Queue Horde Base
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners
Requester horde (at) immerda (dot) ch
Created 03/01/2009 (5947 days ago)
Due
Updated 03/02/2009 (5946 days ago)
Assigned
Resolved 03/02/2009 (5946 days ago)
Milestone
Patch No

History
03/02/2009 09:52:27 PM Michael Slusarz Comment #2
Type ⇒ Enhancement
State ⇒ Resolved
Priority ⇒ 1. Low
Version ⇒ HEAD
Reply to this comment
Added to Horde 4.  Since it involves throwing an error where there was 
no error thrown previously, this won't be backported to Horde 3.
03/01/2009 03:15:28 PM horde (at) immerda (dot) ch Comment #1
Priority ⇒ 1. Low
New Attachment: pgp_avoid_infinite_loop.diff Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Avoid infinite loop if popen fails
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
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.

Saved Queries