6.0.0-beta1
10/17/25

[#14813] Horde Text Diff crashes when comparing large strings
Summary Horde Text Diff crashes when comparing large strings
Queue Horde Framework Packages
Type Bug
State No Feedback
Priority 1. Low
Owners
Requester ravijayagopal (at) gmail (dot) com
Created 04/30/2018 (2727 days ago)
Due
Updated 06/13/2018 (2683 days ago)
Assigned
Resolved 06/13/2018 (2683 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/13/2018 11:00:20 AM Jan Schneider State ⇒ No Feedback
 
05/06/2018 06:39:57 PM Michael Rubinsky Comment #2
Priority ⇒ 1. Low
Reply to this comment
Look at the Horde log (bump up logging level if necessary), look at 
web server error log...

Try bumping up php's memory limit. You don't provide any details on 
your configuration so it's hard to give any further assistance.

If you think it's a memory issue, try writing a test case that 
demonstrates this.
04/30/2018 09:40:07 AM ravijayagopal (at) gmail (dot) com Comment #1
Priority ⇒ 3. High
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Horde Text Diff crashes when comparing large strings
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
Hi,

I have a web app live in production, that compares two large strings, 
less than 5 MB in size.

And it's crashing right at the 3rd line below. Doesn't get past line 3 below.

$diff = new Horde_Text_Diff('auto', array( explode("\n", $contentsOld) 
, explode("\n", $contentsNew) ) );
$renderer = new Horde_Text_Diff_Renderer_Inline();
$diff = $renderer->render($diff);

$contentsOld and $contentsNew contain the two large strings - one read 
from a MySQL mediumtext field, and another coming from 
file_get_contents of a URL. Works fine for most use cases, but crashes 
when it gets above a certain size. I'm guessing around the 4-5 MB size.

Is there any way to get it to exit gracefully? It doesn't seem to be 
throwing any exceptions either.

And is there a way to know exactly where it's failing?

Thanks!

- Ravi

Saved Queries