Bug 107489 - Kompare hangs when opening patch file
Summary: Kompare hangs when opening patch file
Status: RESOLVED FIXED
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kompare developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-15 19:50 UTC by Tommi Rantala
Modified: 2009-11-22 12:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch file that triggers the hang (26.65 KB, text/x-patch)
2005-06-15 19:51 UTC, Tommi Rantala
Details
much smaller file that also hangs (670 bytes, text/x-diff)
2005-06-18 17:43 UTC, Tommi Rantala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tommi Rantala 2005-06-15 19:50:11 UTC
Version:           trunk rev 425826 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          GCC 3.4.3 
OS:                Linux

For some reason kompare hangs when opening the attached patch file.

$ gdb `which kompare`
GNU gdb 6.3

(gdb) r ~/Bug65019.patch
Starting program: /opt/kde/bin/kompare ~/Bug65019.patch
[Thread debugging using libthread_db enabled]
[New Thread 1097550208 (LWP 26089)]
kompare: Arg Count = 1
kompare: Argument 1: /home/ttrantal/Bug65019.patch
kompare (list view): tabToNumberOfSpaces: 4
kompare (list view): tabToNumberOfSpaces: 4
kompare: resizeEvent
kompare: resizeEvent
kompare: resizeEvent
kompare: resizeEvent
kompare: Single file. so openDiff/openStdin is only possible...
kompare (shell): Url = file:///home/ttrantal/Bug65019.patch
kompare: Encoding: Default
kompare: Encoding : Default
kompare: TextCodec: 0x80dfc98
kompare: TextCodec: 0x80dfc98
kompare (part): Url = file:///home/ttrantal/Bug65019.patch
kompare (part): Download succeeded
kompare (libs): Stupid :) Url = /home/ttrantal/Bug65019.patch
kompare: Codec = 0x80dfc98
kompare (nav view): Models ((nil)) have changed... scanning the models...
kompare (libs): KompareModelList::parseDiffOutput
kompare (libs): Diff is a CVSDiff
kompare (libs): Cleaned up 0 line(s) of crap from the diff...
kompare (libs): It is a CVS generated diff...
kompare (libs): kopete/systemtray.cpp was split into kopete/ and systemtray.cpp
kompare (libs): kopete/systemtray.cpp was split into kopete/ and systemtray.cpp
kompare (libs): kopete/config/behavior/behaviorconfig.cpp was split into kopete/config/behavior/ and behaviorconfig.cpp
kompare (libs): kopete/config/behavior/behaviorconfig.cpp was split into kopete/config/behavior/ and behaviorconfig.cpp
kompare (libs): kopete/config/behavior/behaviorconfig_general.ui was split into kopete/config/behavior/ and behaviorconfig_gen
eral.ui
kompare (libs): kopete/config/behavior/behaviorconfig_general.ui was split into kopete/config/behavior/ and behaviorconfig_gen
eral.ui
kompare (libs): kopete/chatwindow/chatview.cpp was split into kopete/chatwindow/ and chatview.cpp
kompare (libs): kopete/chatwindow/chatview.cpp was split into kopete/chatwindow/ and chatview.cpp
kompare (libs): kopete/chatwindow/kopetechatwindow.cpp was split into kopete/chatwindow/ and kopetechatwindow.cpp
kompare (libs): kopete/chatwindow/kopetechatwindow.cpp was split into kopete/chatwindow/ and kopetechatwindow.cpp
kompare (libs): libkopete/kopetemessageevent.cpp was split into libkopete/ and kopetemessageevent.cpp
kompare (libs): libkopete/kopetemessageevent.cpp was split into libkopete/ and kopetemessageevent.cpp
kompare (libs): libkopete/private/kopeteviewmanager.h was split into libkopete/private/ and kopeteviewmanager.h
kompare (libs): libkopete/private/kopeteviewmanager.h was split into libkopete/private/ and kopeteviewmanager.h
kompare (libs): libkopete/private/kopeteprefs.cpp was split into libkopete/private/ and kopeteprefs.cpp
kompare (libs): libkopete/private/kopeteprefs.cpp was split into libkopete/private/ and kopeteprefs.cpp
kompare (libs): libkopete/private/kopeteprefs.h was split into libkopete/private/ and kopeteprefs.h
kompare (libs): libkopete/private/kopeteprefs.h was split into libkopete/private/ and kopeteprefs.h
kompare (libs): libkopete/private/kopeteviewmanager.cpp was split into libkopete/private/ and kopeteviewmanager.cpp
kompare (libs): libkopete/private/kopeteviewmanager.cpp was split into libkopete/private/ and kopeteviewmanager.cpp
kompare (libs): Modelcount: 10
kompare (libs): Hunkcount:  1
kompare (libs): Diffcount:  1
kompare (libs): Hunkcount:  3
kompare (libs): Diffcount:  6
kompare (libs): Hunkcount:  7
kompare (libs): Diffcount:  9
kompare (libs): Hunkcount:  1
kompare (libs): Diffcount:  1
kompare (libs): Hunkcount:  1
kompare (libs): Diffcount:  1
kompare (libs): Hunkcount:  2
kompare (libs): Diffcount:  2
kompare (libs): Hunkcount:  1
kompare (libs): Diffcount:  1
kompare (libs): Hunkcount:  3
kompare (libs): Diffcount:  6
kompare (libs): Hunkcount:  3
kompare (libs): Diffcount:  6
kompare (libs): Hunkcount:  7
kompare (libs): Diffcount:  9
kompare (libs): KompareModelList::firstModel()
kompare (libs): m_modelIndex = 0
kompare (libs): Ok there are differences...
kompare (libs): DiffModel::firstDifference()
kompare (libs): m_diffIndex = 0
kompare (shell): KompareShell::updateStatusBar()
kompare (libs): KompareModelList::hasPrevModel()
kompare (libs): KompareModelList::hasNextModel()
kompare (libs): KompareModelList::hasPrevModel()
kompare (libs): KompareModelList::hasNextModel()
kompare: KompareModelList::Show Number of models = 10
kompare (nav view): Models (0x8173d68) have changed... scanning the models...
kompare (nav view): BuildTreeInMemory called
kompare (nav view): srcPath  = kopete/
kompare (nav view): destPath = kopete/
kompare (nav view): srcPath  = kopete/config/behavior/
kompare (nav view): destPath = kopete/config/behavior/
kompare (nav view): srcPath  = kopete/config/behavior/
kompare (nav view): destPath = kopete/config/behavior/
kompare (nav view): srcPath  = kopete/chatwindow/
kompare (nav view): destPath = kopete/chatwindow/
kompare (nav view): srcPath  = kopete/chatwindow/
kompare (nav view): destPath = kopete/chatwindow/
kompare (nav view): srcPath  = libkopete/
kompare (nav view): destPath = libkopete/

Program received signal SIGTSTP, Stopped (user).
[Switching to Thread 1097550208 (LWP 26089)]
0x40dd3cb9 in QListViewItem::listView () from /opt/qt/lib/libqt-mt.so.3

Backtrace snippets:

(gdb) bt
#0  0x40dd3cb9 in QListViewItem::listView () from /opt/qt/lib/libqt-mt.so.3
#1  0x405cc324 in KListViewItem::insertItem () from /opt/kde/lib/libkdeui.so.4
#2  0x40dd2fcf in QListViewItem::QListViewItem () from /opt/qt/lib/libqt-mt.so.3
#3  0x405cc229 in KListViewItem::KListViewItem () from /opt/kde/lib/libkdeui.so.4
#4  0x41a5de16 in KDirLVI (this=0x83decb8, parent=0x83debe8, dir=@0xbff45740) at komparenavtreepart.cpp:537
#5  0x41a5e0d8 in KDirLVI::addModel (this=0x83debe8, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:574
#6  0x41a5e0fb in KDirLVI::addModel (this=0x83deb18, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7  0x41a5e0fb in KDirLVI::addModel (this=0x83dea48, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#8  0x41a5e0fb in KDirLVI::addModel (this=0x83de978, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#9  0x41a5e0fb in KDirLVI::addModel (this=0x83de8a8, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577

(gdb) bt -20
#7911 0x41a5e0fb in KDirLVI::addModel (this=0x81f10a8, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7912 0x41a5e0fb in KDirLVI::addModel (this=0x81eed88, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7913 0x41a5e0fb in KDirLVI::addModel (this=0x81eecf8, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7914 0x41a5e0fb in KDirLVI::addModel (this=0x81eec68, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7915 0x41a5e0fb in KDirLVI::addModel (this=0x81ee868, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7916 0x41a5e0fb in KDirLVI::addModel (this=0x81ee750, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7917 0x41a5e0fb in KDirLVI::addModel (this=0x8218328, path=@0xbfffeef0, model=0x824c3f8, modelToDirItemDict=0x81ec044)
    at komparenavtreepart.cpp:577
#7918 0x41a5bbf3 in KompareNavTreePart::buildTreeInMemory (this=0x81ebf90) at komparenavtreepart.cpp:195
#7919 0x41a5b571 in KompareNavTreePart::slotModelsChanged (this=0x81ebf90, modelList=0x8173d68) at komparenavtreepart.cpp:115
#7920 0x41a5edd2 in KompareNavTreePart::qt_invoke (this=0x81ebf90, _id=7, _o=0xbffff030) at komparenavtreepart.moc:184
#7921 0x40cf0514 in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#7922 0x41a03b5f in KomparePart::modelsChanged (this=0x81935d8, t0=0x8173d68) at kompare_part.moc:196
#7923 0x41a04677 in KomparePart::qt_emit (this=0x81935d8, _id=9, _o=0xbffff130) at kompare_part.moc:356
#7924 0x40cf058c in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#7925 0x41a2ac9c in Diff2::KompareModelList::modelsChanged (this=0x816b3f8, t0=0x8173d68) at komparemodellist.moc:248
#7926 0x41a29b11 in Diff2::KompareModelList::show (this=0x816b3f8) at komparemodellist.cpp:1171
#7927 0x41a272d1 in Diff2::KompareModelList::openDiff (this=0x816b3f8, diffFile=@0x81936d8) at komparemodellist.cpp:544
#7928 0x41a00eaa in KomparePart::openDiff (this=0x81935d8, url=@0xbffff310) at kompare_part.cpp:208
#7929 0x0805637d in KompareShell::openDiff (this=0x8144078, url=@0xbffff310) at kompare_shell.cpp:196
#7930 0x08053ffd in main (argc=2, argv=0xbffff554) at main.cpp:158
Comment 1 Tommi Rantala 2005-06-15 19:51:44 UTC
Created attachment 11467 [details]
patch file that triggers the hang
Comment 2 Tommi Rantala 2005-06-18 17:43:20 UTC
Created attachment 11501 [details]
much smaller file that also hangs

Here's a much smaller edited version of the original patch that still triggers
the hang.
Comment 3 esigra 2009-01-23 18:53:55 UTC
This is a confirmation that the bug still exists in Kompare 3.4 (KDE 3.5.10).
Comment 4 Otto Bruggeman 2009-02-14 22:28:03 UTC
SVN commit 926225 by bruggie:

BUG: 107489 Fix infinite recursion when not having a common root folder in a multi-file diff which happens frequently.

 M  +11 -0     komparenavtreepart.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=926225
Comment 5 Kevin Kofler 2009-02-19 01:17:46 UTC
SVN commit 928150 by kkofler:

Mass backport of Kompare bugfixes for KDE 4.2.1 (should not touch any translatable strings): backport revisions 913308, 913309, 922431 (Kompare only), 924527, 924539, 924540, 924880, 924959, 924960, 925266, 926028, 926131, 926143, 926225, 928082 (minus i18n string changes), 928141, 928146 from trunk.
CCBUG: 176804
CCBUG: 169692
CCBUG: 182792
CCBUG: 176797
CCBUG: 175251
CCBUG: 75794
CCBUG: 89781
CCBUG: 145956
CCBUG: 107489
CCBUG: 165421
CCBUG: 174924
CCBUG: 103651
CCBUG: 102800
CCMAIL: bruggie@gmail.com

Bump Kompare version from 3.5.2 to 3.5.3 (trunk is 4.0.0).

Tested on Fedora 9 i386, KDE 4.2.0.

Note: skipped revision 926198 because it introduces a string and #124121 is more a user error than a bug anyway.

 M  +34 -30    kompare_shell.cpp  
 M  +18 -3     komparenavtreepart/komparenavtreepart.cpp  
 M  +15 -12    komparepart/kompare_part.cpp  
 M  +2 -2      komparepart/kompare_part.h  
 M  +9 -6      komparepart/kompareconnectwidget.cpp  
 M  +80 -31    komparepart/komparelistview.cpp  
 M  +26 -5     komparepart/komparelistview.h  
 M  +2 -2      komparepart/kompareprefdlg.cpp  
 M  +4 -1      komparepart/kompareprefdlg.h  
 M  +1 -1      komparepart/komparesplitter.cpp  
 M  +2 -1      libdialogpages/diffpage.cpp  
 M  +4 -3      libdialogpages/diffpage.h  
 M  +14 -4     libdialogpages/filespage.cpp  
 M  +4 -4      libdialogpages/filespage.h  
 M  +10 -8     libdiff2/difference.cpp  
 M  +5 -2      libdiff2/difference.h  
 M  +2 -1      libdiff2/diffhunk.cpp  
 M  +2 -2      libdiff2/diffhunk.h  
 M  +5 -30     libdiff2/diffmodel.cpp  
 M  +3 -6      libdiff2/diffmodel.h  
 M  +1 -1      libdiff2/diffmodellist.cpp  
 M  +4 -2      libdiff2/diffmodellist.h  
 M  +34 -31    libdiff2/komparemodellist.cpp  
 M  +3 -1      libdiff2/komparemodellist.h  
 M  +2 -1      libdiff2/kompareprocess.cpp  
 M  +53 -17    libdiff2/levenshteintable.cpp  
 M  +5 -1      libdiff2/parserbase.cpp  
 M  +21 -26    main.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=928150
Comment 6 esigra 2009-11-22 12:10:41 UTC
The 2 attached files no longer hang Kompare 4.0.0 (KDE 4.3.3). Thanks for fixing!