Bug 410007 - Kdiff3 freezes and takes all RAM when showing line diff for two files
Summary: Kdiff3 freezes and takes all RAM when showing line diff for two files
Status: RESOLVED FIXED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (show other bugs)
Version: 1.8.x
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-19 22:30 UTC by Slaviro
Modified: 2020-03-04 03:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 1.9
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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