Bug 1175257 - kdiff3 is unusable (frozen almost all the time, processor up to 100%)
Summary: kdiff3 is unusable (frozen almost all the time, processor up to 100%)
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kdiff3
Version: 21
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Neal Becker
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-17 11:25 UTC by GV
Modified: 2015-12-02 16:46 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-02 06:08:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
kdiff3.tar.bz2 (637.30 KB, application/x-bzip)
2015-01-10 10:22 UTC, GV
no flags Details
kdiff3_strace_valgrind.tar.bz2 (2.92 MB, application/x-bzip)
2015-01-10 16:12 UTC, GV
no flags Details

Description GV 2014-12-17 11:25:33 UTC
Description of problem:
kdiff3/kdiff3-qt is unusable. Processor is up to 100% used and it is take minutes to have a usable gui. When gui is finally usable and I attempt to merge some changes the gui interface become again unresponsive and processor is up to 100% again.

With strace I see some kind of loop:
....
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\24\7\0\22\0\0\3\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\212\0244\0"..., 16328}, {"\2\0\0\0\271y5yU\305\305\305T\305\307\305\260x7x\226\256\274\256*x\250x|^=^"..., 25
2}, {"", 0}], 3) = 16580
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\0241\0\22\0\0\3\1\0\0\0V\0\0\0\7\0\6\0\0\0\6\0\10\0\0\0+y\251y"..., 16344}, {"\\'\16'\232\316~\316@\267\320\267K\303\306\303\270\242J\242vsbs\224\225\233\225\1\1\7\1"
..., 144}, {"", 0}], 3) = 16488
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\24\23\0\22\0\0\3\1\0\0\0\33\0\0\0\2\0\6\0\375\377\6\0\10\0\0\0\347\317\245\317"..., 16264}, {"\0\0\0\0#d\207d<\252\337\252\232\264\300\264\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0"..., 252}, {"", 0}], 3) = 16516
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\24+\0\22\0\0\3\1\0\0\0T\0\0\0\6\0\6\0\377\377\6\0\10\0\0\0\\'\16'"..., 16292}, {"\2\0\0\0\271y5yU\305\305\305T\305\307\305\260x7x\226\256\274\256*x\250x|^=^"..., 252}
, {"", 0}], 3) = 16544
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\0241\0\22\0\0\3\1\0\0\0V\0\0\0\7\0\6\0\0\0\6\0\10\0\0\0+y\251y"..., 16260}, {"\24\4\1\4\260\217C\217H\304\310\304G\303\312\303\272\256R\256'\t\3\t\0\0\0\0}zgz"..., 16
8}, {"", 0}], 3) = 16428
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\0247\0\22\0\0\3\1\0\0\0W\0\0\0\10\0\6\0\0\0\6\0\10\0\0\0\34PqP"..., 16384}, {NULL, 0}, {"", 0}], 3) = 16384
recvmsg(6, 0x7fff6c05fb70, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"T\0\0\0\6\0\6\0\377\377\6\0\10\0\0\0\\'\16'\232\316~\316@\267\320\267K\303\306\303"..., 16316}, {"\2\0\0\0\271y5yU\305\305\305T\305\307\305\260x7x\226\256\274\256*x\250x|^
=^"..., 252}, {"", 0}], 3) = 16568
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\0241\0\22\0\0\3\1\0\0\0V\0\0\0\7\0\6\0\0\0\6\0\10\0\0\0+y\251y"..., 16172}, {"-\177\252\177\232\264\300\264\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 252},
 {"", 0}], 3) = 16424
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\24=\0\22\0\0\3\1\0\0\0N\0\0\0\t\0\6\0\0\0\6\0\10\0\0\0\33MnM"..., 16380}, {NULL, 0}, {"", 0}], 3) = 16380
recvmsg(6, 0x7fff6c05fb70, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"\212\0241\0\22\0\0\3\1\0\0\0O\0\0\0\7\0\6\0\0\0\6\0\10\0\0\0\33MnM"..., 16296}, {"\0\0\0\0\211i=i\33.+.\r\2\1\2\251\261\260\261\0\0\0\0ybIbG\\s\\"..., 132}, {"", 0}], 3) =
 16428
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
....

I get the same behaviour with kdiff3-qt package. So it's not a KDE problem.

The last usable version for me was kdiff3-0.9.97-6.fc19. I downloaded https://kojipkgs.fedoraproject.org//packages/kdiff3/0.9.97/6.fc19/x86_64/kdiff3-0.9.97-6.fc19.x86_64.rpm, extract kdiff3 executable and this one run just fine.

Version-Release number of selected component (if applicable):
All kdiff3 versions from F21 (right now kdiff3-0.9.98-4.fc21.x86_64)

How reproducible:
rm -rf .kde (I use windowmaker)
kdiff3 file.old file.new

Comment 1 GV 2014-12-17 13:39:31 UTC
The files I try to merge are 2 kernel.spec files (RHEL7), 2.8Mb each. With small files kdiff3-0.9.98-4.fc21.x86_64 works OK. But not with large ones. And  kdiff3-0.9.97-6.fc19 work just fine.

Comment 2 Maurice van der Pot 2015-01-03 13:12:48 UTC
I suspect it is the combination of kdiff3 built with a specific version of Qt, because kdiff3-0.9.97 built from source on my current system also exhibits the problem.

Neal, can you easily build a 0.9.97-6.fc19 version of kdiff3-qt? Then I could profile it on my KDE-less system and use the profile as a reference.

Comment 3 Neal Becker 2015-01-04 19:34:00 UTC
It should be easy to build any version you like from source, using the build system for Fedora is never easier IMO.

Have you tried 0.9.98?

I have sent a message to the kdiff3 mail list about this BR, maybe someone has some ideas.

Comment 4 Maurice van der Pot 2015-01-09 22:20:58 UTC
I'm trying to look into this and I now have both a virtual machine with Fedora 19 as well as one with Fedora 21. I have not yet switched to WindowMaker, but so far I can see no difference in kdiff3 performance between the two.

Gabriel, can you tell me how to switch the window manager to WindowMaker so I can try and reproduce the problem?
I would also like to have (a link to) two example files that trigger the problem.

Comment 5 GV 2015-01-10 10:21:19 UTC
# yum install WindowMaker
logout and login again. Make sure you choose WindowMaker in gdm/kdm as your window manager before you login.

But I get almost similar behaviour when I login with kde as window manager.
See attached kdiff3.tar.bz2.

cd kdiff3
cd 21
kdiff3 kernel.new.spec kernel.old.spec
cd ../rh7
kdiff3 kernel.new.spec kernel.old.spec
kdiff3 kernel.new.spec ../rh6/kernel.spec

Some timings for last command. Using kde or windowmaker, from the moment I hit enter up to the moment the window was usable (I can push merge button) it took 62.4 second. With kdiff3 from F19 it took 4.2 seconds. And try to merge some changes at the end of files.

Comment 6 GV 2015-01-10 10:22:08 UTC
Created attachment 978499 [details]
kdiff3.tar.bz2

Comment 7 Maurice van der Pot 2015-01-10 13:53:21 UTC
What I originally said was incorrect. I cannot reproduce this problem.
Here are the timings I get for those three commands.

F19 WindowMaker kdiff3-0.9.97-6.fc19 in virtualbox (32-bit):
0.410s
0.427s
1.928s

F21 WindowMaker kdiff3-0.9.98-2.fc21 in virtualbox (64-bit):
0.456s
1.202s
2.368s

Gentoo fluxbox kdiff3-0.9.98 (64-bit):
0.260s
0.400s
1.064s

Is the difference in duration also present with the first two sets of files or only with the last one?

If you're up for it maybe you can generate a profile using valgrind:
1. install debug info for kdiff3
2. valgrind --tool=callgrind ./kdiff3 file1 file2
3. close kdiff3 as soon as the GUI has been drawn/is usable. (ctrl-q)
Be aware that running it in valgrind slows things down by a factor 10 or more, so if you can reproduce the problem with something that takes a few seconds then do that.
After doing this a callgrind.* file will be present containing the profile. I'll open that in kcachegrind and hopefully see where the time is going.

Also you can generate strace output with timestamps (strace -tt). Maybe something unusual stands out.

Comment 8 GV 2015-01-10 16:10:51 UTC
$ time kdiff3 kernel.new.spec ../rh6/kernel.spec

real    1m3.191s
user    1m0.973s
sys     0m0.561s

$ strace -f -ff -tt -o kdiff3.log kdiff3 kernel.new.spec ../rh6/kernel.spec
$ valgrind --tool=callgrind /usr/bin/kdiff3 kernel.new.spec ../rh6/kernel.spec
$ time kdiff3-qt kernel.new.spec ../rh6/kernel.spec

real    1m18.776s
user    1m17.240s
sys     0m0.488s

$ strace -f -ff -tt -o kdiff3-qt.log kdiff3-qt kernel.new.spec ../rh6/kernel.spec
$ valgrind --tool=callgrind /usr/bin/kdiff3-qt kernel.new.spec ../rh6/kernel.spec

All files are in kdiff3_strace_valgrind.tar.bz2.

Comment 9 GV 2015-01-10 16:12:08 UTC
Created attachment 978538 [details]
kdiff3_strace_valgrind.tar.bz2

Comment 10 Fedora End Of Life 2015-11-04 14:15:41 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2015-12-02 06:08:32 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.