6.0.0-beta1
7/4/25

[#14550] Decoding certain TNEF files results in memory exhaustion
Summary Decoding certain TNEF files results in memory exhaustion
Queue Horde Framework Packages
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester michael.klein (at) hypaerion (dot) net
Created 12/23/2016 (3115 days ago)
Due
Updated 02/21/2017 (3055 days ago)
Assigned 02/20/2017 (3056 days ago)
Resolved 02/21/2017 (3055 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/21/2017 12:19:11 AM Michael Rubinsky Summary ⇒ Decoding certain TNEF files results in memory exhaustion
 
02/21/2017 12:18:32 AM Michael Rubinsky Comment #18
State ⇒ Not A Bug
Priority ⇒ 1. Low
Reply to this comment
Well, I've narrowed it down to some bug in the "built in" 
implementation of some of the algorithms.

Trying to fix this in the PEAR Math_BigInteger library is becoming a 
huge undertaking. For now, try installing either the bcmath or the 
gmp php extension. I've tested both locally and either one will 
prevent this issue.
If I manually update to version 2.x of BigInteger (directly from the 
phpseclib project, and not from PEAR), then the problem is also 
solved. So, going to mark this as not a bug, since this is an issue 
with the implementation in the version of Math_BigInteger currently 
available via PEAR.
02/20/2017 11:37:29 PM Michael Rubinsky Comment #17
State ⇒ Feedback
Reply to this comment
Well, I've narrowed it down to some bug in the "built in" 
implementation of some of the algorithms.

Trying to fix this in the PEAR Math_BigInteger library is becoming a 
huge undertaking. For now, try installing either the bcmath or the gmp 
php extension. I've tested both locally and either one will prevent 
this issue.
02/20/2017 10:21:36 PM michael (dot) klein (at) hypaerion (dot) net Comment #16 Reply to this comment
I have just recieved another mail causing this behaviour:
The file you sent me triggers an out of memory when attempting to
open it even in IMP.
... though oddly, only on one of my machines.
I have the same in IMP aswell as active sync.
02/20/2017 09:45:27 PM Michael Rubinsky Comment #15 Reply to this comment
I have just recieved another mail causing this behaviour:
The file you sent me triggers an out of memory when attempting to 
open it even in IMP.
... though oddly, only on one of my machines.
02/20/2017 09:44:08 PM Michael Rubinsky Comment #14
State ⇒ Assigned
Reply to this comment
I have just recieved another mail causing this behaviour:
The file you sent me triggers an out of memory when attempting to open 
it even in IMP.

02/20/2017 01:10:03 PM michael (dot) klein (at) hypaerion (dot) net Comment #13 Reply to this comment
I have just recieved another mail causing this behaviour:

A fatal error has occurred
Allowed memory size of 268435456 bytes exhausted (tried to allocate 
301989888 bytes)

1. Horde_ErrorHandler::catchFatalError()

Details
The full error message is logged in Horde's log file, and is shown 
below only to administrators. Non-administrative users will not see 
error details.

ErrorException Object
(
     [message:protected] => Allowed memory size of 268435456 bytes 
exhausted (tried to allocate 301989888 bytes)
     [string:Exception:private] =>
     [code:protected] => 0
     [file:protected] => /usr/share/php/Math/BigInteger.php
     [line:protected] => 1090
     [trace:Exception:private] => Array
         (
             [0] => Array
                 (
                     [function] => catchFatalError
                     [class] => Horde_ErrorHandler
                     [type] => ::
                     [args] => Array
                         (
                         )

                 )

         )

     [previous:Exception:private] =>
     [severity:protected] => 1
     [logged] => 1
)

[Show Quoted Text - 40 lines]
01/23/2017 09:23:52 PM Michael Rubinsky Comment #12 Reply to this comment
I think i nailed it down... Looks like a whole bunch of mails which 
ran throu a yahoo group some very long time ago were the rootcause..

i send you one example via mail.
The sample email is sync'd with no issues to all of my test clients - 
including Outlook. No display issues and no out of memory issues. 
Additionaly, the email you sent me did not contain any TNEF or DAT 
attachments, which is the ONLY way the code where the memory 
exhaustion occurred would have been called.

[Show Quoted Text - 28 lines]
01/22/2017 09:24:38 PM michael (dot) klein (at) hypaerion (dot) net Comment #11 Reply to this comment
I think i nailed it down... Looks like a whole bunch of mails which 
ran throu a yahoo group some very long time ago were the rootcause..

i send you one example via mail.

[Show Quoted Text - 27 lines]
01/20/2017 03:59:37 AM Michael Rubinsky Comment #10 Reply to this comment
I have removed the mail from the trash.. Still the error occurres. I 
have pulled a new report under the same address as before. As this 
mail was related to a calendar entry, do you think it might be 
related to the entry in the calendar?
Yes, meeting requests are sometimes sent as TNEF or DAT file 
attachments from Outlook.

[Show Quoted Text - 18 lines]
01/19/2017 09:54:28 PM michael (dot) klein (at) hypaerion (dot) net Comment #9 Reply to this comment
I have removed the mail from the trash.. Still the error occurres. I 
have pulled a new report under the same address as before. As this 
mail was related to a calendar entry, do you think it might be related 
to the entry in the calendar?

[Show Quoted Text - 17 lines]
01/19/2017 01:23:12 PM Michael Rubinsky State ⇒ No Feedback
 
01/08/2017 05:25:08 PM Michael Rubinsky Comment #8 Reply to this comment
I have setup a new sync with a new device. But the only thing i see until the

HORDE[5838]: Allowed memory size of 134217728 bytes exhausted (tried 
to allocate 150994944 bytes) [pid 5838 on line 1090 of 
"/usr/share/php/Math/BigInteger.php"]
You should be looking at the sync log, not the horde log and should 
see a LOT more than this.
Can i send you the log file so you can have a look? I really can not 
find anything :-(
You can send me the sync log, yes but I will also probably need an 
email that triggers this. As I said, it's most likely an email with a 
TNEF or *.DAT file attachment.

01/08/2017 04:38:31 PM michael (dot) klein (at) hypaerion (dot) net Comment #7 Reply to this comment
I have setup a new sync with a new device. But the only thing i see until the

HORDE[5838]: Allowed memory size of 134217728 bytes exhausted (tried 
to allocate 150994944 bytes) [pid 5838 on line 1090 of 
"/usr/share/php/Math/BigInteger.php"]

Can i send you the log file so you can have a look? I really can not 
find anything :-(

[Show Quoted Text - 34 lines]
01/04/2017 01:49:00 PM Michael Rubinsky Comment #6 Reply to this comment

[Show Quoted Text - 19 lines]
Well, when the memory is exhausted, the running process dies and the 
sync must restart.
The only thing i can find is this error message:

Previous request processing for synckey 
{58608cf6-006c-4922-b379-4ed95e72af70}123 failed to be accepted by 
the client, removing previous state and trying again.
Correct. This indicates a previous attempt failed since the client is 
sending an older synckey.
The Client is Outlook 2016
01/04/2017 09:27:23 AM michael (dot) klein (at) hypaerion (dot) net Comment #5 Reply to this comment

[Show Quoted Text - 17 lines]
It looks like it is not dying but still trying to do the sync.
The only thing i can find is this error message:

Previous request processing for synckey 
{58608cf6-006c-4922-b379-4ed95e72af70}123 failed to be accepted by the 
client, removing previous state and trying again.

The Client is Outlook 2016
01/02/2017 08:31:22 PM Michael Rubinsky Comment #4 Reply to this comment
Do you have any hint where i can find the message maybe in the log 
file? Unfortunately i do not now which mail is causing this.
If you know which device it is at least, you can enable a per-device 
activesync debug log. It would be the last message attempted to be sent.

If you don't know the device, you can instead try the consolidated 
debug log and hope we can figure it out from there.

Looking at where the process dies, it is probably an email with some 
type of TNEF attachment.
Please provide a sample email that triggers this error.
01/02/2017 08:26:35 PM michael (dot) klein (at) hypaerion (dot) net Comment #3 Reply to this comment
Do you have any hint where i can find the message maybe in the log 
file? Unfortunately i do not now which mail is causing this.
Please provide a sample email that triggers this error.
01/02/2017 04:36:37 PM Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
Please provide a sample email that triggers this error.
12/23/2016 08:21:51 PM michael (dot) klein (at) hypaerion (dot) net Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Active sync via outlook resulting in memory exhausted
Type ⇒ Bug
Queue ⇒ Horde Framework Packages
Reply to this comment
When connecting via outlook (Active sync ) to Horde. Apache is posting 
a memory exhaust error

HORDE[22137]: Allowed memory size of 1073741824 bytes exhausted (tried 
to allocate 1207959552 bytes) [pid 22137 on line 1090 of 
"/usr/share/php/Math/BigInteger.php"]

Saved Queries