Bug 410007

Summary: Kdiff3 freezes and takes all RAM when showing line diff for two files
Product: [Applications] kdiff3 Reporter: Slaviro <slavon93>
Component: applicationAssignee: michael <reeves.87>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 1.8.x   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 1.9
Sentry Crash Report:

Description Slaviro 2019-07-19 22:30:22 UTC
SUMMARY
Kdiff3 with latest commit hash a8bcf7a6a45e023844ef057bb568e59b2864431f takes all RAM and SWAP it can find when showing line diff for any two files.

STEPS TO REPRODUCE
1. Compare two directories
2. Find any two different files (both exist). 
3. Double click to show line diff

OBSERVED RESULT
Progress window stops at 75%, Kdiff3 hangs, htop or conky show that free RAM is quickly decreasing until nothing is left. 

EXPECTED RESULT
Line diff is shown

SOFTWARE/OS VERSIONS
Linux: Gentoo Linux
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION
Kdiff3 is built from KDE overlay for Gentoo (kdiff3-9999), it's the only 9999 package in the system, other KDE/Qt related packages are from the main tree, testing branch.
Comment 1 michael 2019-07-22 01:35:25 UTC
This a known issue with master right now. Its undergoing a major rewrite and is not stable at this time.
Comment 2 michael 2019-07-28 19:57:53 UTC
Git commit 473440519f384f98c6b0fad60d08c8a81a4e3588 by Michael Reeves.
Committed on 28/07/2019 at 19:57.
Pushed by mreeves into branch 'master'.

Avoid ranaway allocation

Revert broken check for matching starting characters.
Add emergancy back stop in calcDiff  to main loop. We should never reach
this condition. However we must garentee this code never goes into an
infenite loop regardlless of any pontental bug or unexepected input.
FIXED-IN:1.8.2

M  +10   -2    src/diff.cpp

https://invent.kde.org/kde/kdiff3/commit/473440519f384f98c6b0fad60d08c8a81a4e3588