<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>AS: Endless loop with Windows Phone 7.8</title> 
  <pubDate>Fri, 10 Apr 2026 09:20:58 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/12930</link> 
  <atom:link rel="self" type="application/rss+xml" title="AS: Endless loop with Windows Phone 7.8" href="https://bugs.horde.org/ticket/12930/rss" /> 
  <description>AS: Endless loop with Windows Phone 7.8</description> 
 
   
   
  <item> 
   <title>Hi,

I&#039;ve one box that somehow triggers an endless loop vi</title> 
   <description>Hi,

I&#039;ve one box that somehow triggers an endless loop via ActiveSync until the PHP timeout is reached.

The Samsung phone sends a request and the httpd process gets stuck in a loop, eating up 100% CPU time. I&#039;ve tried to attach &quot;strace&quot; to it but it does not communicate anything with the linux kernel, so I guess it&#039;s stuck in a loop.

The last bits I see in the ActiveSync log look like this:

2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I    &lt;Folder&gt;
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I     &lt;SyncKey&gt;
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I       {52cbc9bb-e888-4cd3-92ed-17f95c4fb70f}1
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I     &lt;/SyncKey&gt;
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I     &lt;FolderId&gt;
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I       RI
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I     &lt;/FolderId&gt;
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I     &lt;Options&gt;
2014-01-21T11:59:45+01:00 ef6bd35e390f8ed625df47ceaee3ae1f DEBUG: [18254] I      &lt;MaxItems&gt;

The full sync log of the device is attached to this report. 

Horde_ActiveSync version is 2.8.5. Any known, related issue?

I&#039;m currently thinking about ways to debug this since I don&#039;t have any hint what might be wrong.
My first uneducated guess is that something is wrong in the binary WBXML data and we run into an endless loop while decoding it. Just a *wild* theory though.

Installing xdebug will probably slow down the productive box to a crawl :(

May be &quot;gdb&quot; might do the trick to debug this:
http://derickrethans.nl/what-is-php-doing.html

Cheers,
Thomas
</description> 
   <pubDate>Tue, 21 Jan 2014 14:13:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82088</link> 
  </item> 
   
  <item> 
   <title>You are close. &quot;RI&quot; in the &lt;FolderId&gt; node stands for the Re</title> 
   <description>You are close. &quot;RI&quot; in the &lt;FolderId&gt; node stands for the Recipient Information Cache - it&#039;s something like a &quot;popular recipient&quot; cache to speed lookups. It&#039;s on the TODO to integrate this with IMP&#039;s favorite recipients functionality. The thing is, I&#039;m pretty sure the device is NOT supposed to request this unless the server indicates that it is in use. Sounds like a bug in the client, though I have 2 Samsung test devices that don&#039;t exhibit this behavior.

I should be able to take a look at this tonight, if I don&#039;t get stranded here at work by the pending snow storm :)</description> 
   <pubDate>Tue, 21 Jan 2014 14:23:15 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82089</link> 
  </item> 
   
  <item> 
   <title>&gt; I should be able to take a look at this tonight, if I don&#039;</title> 
   <description>&gt; I should be able to take a look at this tonight, if I don&#039;t get 
&gt; stranded here at work by the pending snow storm :)

I shouldn&#039;t have asked you earlier about the snow storms :o)

I still try to figure out how to trace this with gdb. There was an infinite loop
in the Kolab code once and it would be nice to debug this easily if it should ever pop up again.
</description> 
   <pubDate>Tue, 21 Jan 2014 14:53:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82090</link> 
  </item> 
   
  <item> 
   <title>&gt; Horde_ActiveSync version is 2.8.5. Any known, related issu</title> 
   <description>&gt; Horde_ActiveSync version is 2.8.5. Any known, related issue?

Any particular reason why you&#039;re still running 2.8.5 instead of the latest version? Pear has 2.11.0 available as of now, so I&#039;d try upgrading to the latest version first.</description> 
   <pubDate>Tue, 21 Jan 2014 15:07:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82091</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Horde_ActiveSync version is 2.8.5. Any known, related iss</title> 
   <description>&gt;&gt; Horde_ActiveSync version is 2.8.5. Any known, related issue?
&gt;
&gt; Any particular reason why you&#039;re still running 2.8.5 instead of the 
&gt; latest version? Pear has 2.11.0 available as of now, so I&#039;d try 
&gt; upgrading to the latest version first.

This particular issue is still present in current PEAR. It&#039;s because the client is issuing a SYNC request for a collection that it shouldn&#039;t be.</description> 
   <pubDate>Tue, 21 Jan 2014 15:14:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82092</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; I should be able to take a look at this tonight, if I don</title> 
   <description>&gt;&gt; I should be able to take a look at this tonight, if I don&#039;t get
&gt;&gt; stranded here at work by the pending snow storm :)
&gt;
&gt; I shouldn&#039;t have asked you earlier about the snow storms :o)
&gt;
&gt; I still try to figure out how to trace this with gdb. There was an 
&gt; infinite loop
&gt; in the Kolab code once and it would be nice to debug this easily if 
&gt; it should ever pop up again.

Not sure about the infinite loop, but if helps you, it&#039;s dying because the MAXITEMS node is not expected. You can see this in Horde_ActiveSYnc_Request_Sync::  line 1142 where there is a TODO to remind me to implement it when we implement the RI cache.</description> 
   <pubDate>Tue, 21 Jan 2014 15:16:18 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82093</link> 
  </item> 
   
  <item> 
   <title>&gt; Not sure about the infinite loop, but if helps you, it&#039;s d</title> 
   <description>&gt; Not sure about the infinite loop, but if helps you, it&#039;s dying 
&gt; because the MAXITEMS node is not expected. You can see this in 
&gt; Horde_ActiveSYnc_Request_Sync::  line 1142 where there is a TODO to 
&gt; remind me to implement it when we implement the RI cache.

...and that is EXACTLY why it loops. There is no escape from the while() loop in that case.</description> 
   <pubDate>Tue, 21 Jan 2014 15:18:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82094</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Not sure about the infinite loop, but if helps you, it&#039;s </title> 
   <description>&gt;&gt; Not sure about the infinite loop, but if helps you, it&#039;s dying
&gt;&gt; because the MAXITEMS node is not expected. You can see this in
&gt;&gt; Horde_ActiveSYnc_Request_Sync::  line 1142 where there is a TODO to
&gt;&gt; remind me to implement it when we implement the RI cache.
&gt;
&gt; ...and that is EXACTLY why it loops. There is no escape from the 
&gt; while() loop in that case.

Thanks for the analysis!

May be we should add a sanity limit of 5.000+ &quot;sync options&quot; the next time an AS client sends us an unexpected tag ;) Just log it, bail out of the loop and continue.

The user mentioned something about a recent OTA Android update for her phone. I have to ask for the specific model again. May be that update &quot;enabled&quot; the RI collection.

@Arjen: I still run 2.8.5 because of QA. When I update to a new version, I have to test all the devices I have floating around again. Therefore I prefer to apply known fixes to 2.8.5 and will update every few months or so to the current pear version. I also update the horde apps and framework at the same time ;)
</description> 
   <pubDate>Tue, 21 Jan 2014 15:29:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82095</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt;&gt; Not sure about the infinite loop, but if helps you, it&#039;s</title> 
   <description>&gt;&gt;&gt; Not sure about the infinite loop, but if helps you, it&#039;s dying
&gt;&gt;&gt; because the MAXITEMS node is not expected. You can see this in
&gt;&gt;&gt; Horde_ActiveSYnc_Request_Sync::  line 1142 where there is a TODO to
&gt;&gt;&gt; remind me to implement it when we implement the RI cache.
&gt;&gt;
&gt;&gt; ...and that is EXACTLY why it loops. There is no escape from the
&gt;&gt; while() loop in that case.
&gt;
&gt; Thanks for the analysis!
&gt;
&gt; May be we should add a sanity limit of 5.000+ &quot;sync options&quot; the next 
&gt; time an AS client sends us an unexpected tag ;) Just log it, bail out 
&gt; of the loop and continue.

Either that or bail out if nothing was successfully parsed by the bottom of the loop. Something should be parsed through each iteration.


&gt; The user mentioned something about a recent OTA Android update for 
&gt; her phone. I have to ask for the specific model again. May be that 
&gt; update &quot;enabled&quot; the RI collection.

If that&#039;s the case, I might as well go ahead and implement the RI functionality now since I&#039;ll have to implement at least part of it anyway. If the device is erroneously asking for the RI collection, it is probably also expecting a return value for it as well. Just ignoring the MAXITEMS is likely to cause problems on the client side.</description> 
   <pubDate>Tue, 21 Jan 2014 15:52:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82096</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; May be we should add a sanity limit of 5.000+ &quot;sync optio</title> 
   <description>&gt;&gt; May be we should add a sanity limit of 5.000+ &quot;sync options&quot; the next
&gt;&gt; time an AS client sends us an unexpected tag ;) Just log it, bail out
&gt;&gt; of the loop and continue.
&gt;
&gt; Either that or bail out if nothing was successfully parsed by the 
&gt; bottom of the loop. Something should be parsed through each iteration.

if we choose the latter route, an unknown tag in the middle of the sync option
wbxml stream might kill further option parsing. Though that should never happen ;)

&gt;&gt; The user mentioned something about a recent OTA Android update for
&gt;&gt; her phone. I have to ask for the specific model again. May be that
&gt;&gt; update &quot;enabled&quot; the RI collection.
&gt;
&gt; If that&#039;s the case, I might as well go ahead and implement the RI 
&gt; functionality now since I&#039;ll have to implement at least part of it 
&gt; anyway. If the device is erroneously asking for the RI collection, it 
&gt; is probably also expecting a return value for it as well. Just 
&gt; ignoring the MAXITEMS is likely to cause problems on the client side.

I&#039;ve excluded the specific user from ActiveSync for now.
(the server really struggles when ten or more 100% CPU time tasks are running :o)).
I&#039;ll check tomorrow morning if some other phone causes trouble, too. Hopefully not :)
</description> 
   <pubDate>Tue, 21 Jan 2014 16:06:59 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82097</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (master):

commit ae02bbf02799</title> 
   <description>Changes have been made in Git (master):

commit ae02bbf0279959f2a3d25f7c011e503970fda975
Author: Michael J Rubinsky &lt;mrubinsk@horde.org&gt;
Date:   Wed Jan 22 02:02:52 2014 -0500

    Add support in Horde_ActiveSync for Recipient Cache.
    
    Needs backend support, but this prevents broken clients from
    killing the sync completely (see Bug #12930).

 .../lib/Horde/ActiveSync/Collections.php           |   11 +++++++++++
 .../lib/Horde/ActiveSync/Driver/Base.php           |    4 ++++
 .../lib/Horde/ActiveSync/Request/Sync.php          |    9 ++++++++-
 .../Core/lib/Horde/Core/ActiveSync/Driver.php      |   13 +++++++++++++
 4 files changed, 36 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/ae02bbf0279959f2a3d25f7c011e503970fda975</description> 
   <pubDate>Wed, 22 Jan 2014 07:06:27 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82107</link> 
  </item> 
   
  <item> 
   <title>&gt; Changes have been made in Git (master):
&gt;
&gt; commit ae02b</title> 
   <description>&gt; Changes have been made in Git (master):
&gt;
&gt; commit ae02bbf0279959f2a3d25f7c011e503970fda975
&gt; Author: Michael J Rubinsky &lt;mrubinsk@horde.org&gt;
&gt; Date:   Wed Jan 22 02:02:52 2014 -0500
&gt;
&gt;     Add support in Horde_ActiveSync for Recipient Cache.
&gt;
&gt;     Needs backend support, but this prevents broken clients from
&gt;     killing the sync completely (see Bug #12930).
&gt;
&gt;  .../lib/Horde/ActiveSync/Collections.php           |   11 +++++++++++
&gt;  .../lib/Horde/ActiveSync/Driver/Base.php           |    4 ++++
&gt;  .../lib/Horde/ActiveSync/Request/Sync.php          |    9 ++++++++-
&gt;  .../Core/lib/Horde/Core/ActiveSync/Driver.php      |   13 +++++++++++++
&gt;  4 files changed, 36 insertions(+), 1 deletions(-)
&gt;
&gt; http://git.horde.org/horde-git/-/commit/ae02bbf0279959f2a3d25f7c011e503970fda975

Nice! I&#039;ll test it ASAP.

I think the new code in &quot;public function getFolderUidForBackendId($folderid)&quot;
contains a typo: It accesses &quot;$type&quot; instead of &quot;$id&quot;.
-&gt; Buuuuuuuug

I think it should be:
        // Always use RI for recipient cache.
        if ($folderid == &#039;RI&#039;) {
            return $folderid;
        }
</description> 
   <pubDate>Wed, 22 Jan 2014 10:02:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82109</link> 
  </item> 
   
  <item> 
   <title>&gt; I think the new code in &quot;public function getFolderUidForBa</title> 
   <description>&gt; I think the new code in &quot;public function getFolderUidForBackendId($folderid)&quot;
&gt; contains a typo: It accesses &quot;$type&quot; instead of &quot;$id&quot;.
&gt; -&gt; Buuuuuuuug
&gt;
&gt; I think it should be:
&gt;         // Always use RI for recipient cache.
&gt;         if ($folderid == &#039;RI&#039;) {
&gt;             return $folderid;
&gt;         }
&gt;

Ah, the code in Collections.php was copied from Driver/Base.php:_getFolderUidForBackendId()
which contains a $type parameter.

I&#039;m extending the Driver/Base.php:_getFolderUidForBackendId() function
to check $type for the correct type OR $id for &#039;RI&#039;.
Then we support both &quot;modes&quot; if $type is not given.
</description> 
   <pubDate>Wed, 22 Jan 2014 10:11:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82110</link> 
  </item> 
   
  <item> 
   <title>Some new info:
The phone is a LG E900 with the recent Windo</title> 
   <description>Some new info:
The phone is a LG E900 with the recent Windows Phone 7.8 update.

So it&#039;s a bit ironic that a Windows phone does not conform to the ActiveSync spec ;)

It seems to sync with the latest fixes (backported to FRAMEWORK_5).
I&#039;ll try to gather some logs once it&#039;s done with the initial sync.
</description> 
   <pubDate>Wed, 22 Jan 2014 14:14:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82113</link> 
  </item> 
   
  <item> 
   <title>&gt; Some new info:
&gt; The phone is a LG E900 with the recent W</title> 
   <description>&gt; Some new info:
&gt; The phone is a LG E900 with the recent Windows Phone 7.8 update.
&gt;
&gt; So it&#039;s a bit ironic that a Windows phone does not conform to the 
&gt; ActiveSync spec ;)

Agreed. I have a Lumia 822 running WP8 and an HTC something or other running 6.5 that both work correctly (do not request the RI collection unless it is sent the RI folder in a FOLDERSYNC response).

</description> 
   <pubDate>Wed, 22 Jan 2014 16:38:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12930#t82114</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
