Bug 281238 - Kompare crashes opening files over 500MB
Summary: Kompare crashes opening files over 500MB
Status: RESOLVED NOT A BUG
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: 4.0.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Kompare developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-03 00:12 UTC by jelizondob
Modified: 2011-09-03 18:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jelizondob 2011-09-03 00:12:02 UTC
Application: kompare (4.0.0)
KDE Platform Version: 4.4.5 (KDE 4.4.5)
Qt Version: 4.6.2
Operating System: Linux 2.6.32-33-generic-pae i686
Distribution: Ubuntu 10.04.3 LTS

-- Information about the crash:
It crashed comparing two files, one 500MB and the other 593MB. It also crashed opening a diff file of 593.9MB

The crash can be reproduced every time.

 -- Backtrace:
Application: Kompare (kompare), signal: Aborted
[KCrash Handler]
#6  0xb785a430 in __kernel_vsyscall ()
#7  0xb5d1e651 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#8  0xb5d21a82 in *__GI_abort () at abort.c:92
#9  0xb5f2552f in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6
#10 0xb5f23465 in ?? () from /usr/lib/libstdc++.so.6
#11 0xb5f234a2 in std::terminate() () from /usr/lib/libstdc++.so.6
#12 0xb5f235e1 in __cxa_throw () from /usr/lib/libstdc++.so.6
#13 0xb5fb8b15 in qBadAlloc () at global/qglobal.cpp:2004
#14 0xb600c9f8 in q_check_ptr<void> (this=0x994a43c, alloc=1073741823) at ../../include/QtCore/../../src/corelib/global/qglobal.h:1697
#15 QString::realloc (this=0x994a43c, alloc=1073741823) at tools/qstring.cpp:1242
#16 0xb600cfb7 in QString::append (this=0x994a43c, str=...) at tools/qstring.cpp:1456
#17 0xb6063b29 in QString::operator+= (this=0x994a3d0, maxBytes=-1) at ../../include/QtCore/../../src/corelib/tools/qstring.h:269
#18 QTextStreamPrivate::fillReadBuffer (this=0x994a3d0, maxBytes=-1) at io/qtextstream.cpp:588
#19 0xb6065e2b in QTextStreamPrivate::read (this=0x994a3d0, maxlen=2147483647) at io/qtextstream.cpp:715
#20 0xb606612b in QTextStream::readAll (this=0xbf832624) at io/qtextstream.cpp:1635
#21 0xb27e488b in QTextStream::read (this=0x98e8b28, fileName=...) at /usr/include/qt4/QtCore/qtextstream.h:248
#22 Diff2::KompareModelList::readFile (this=0x98e8b28, fileName=...) at ../../../kompare/libdiff2/komparemodellist.cpp:535
#23 0xb27eb10e in Diff2::KompareModelList::openDiff (this=0x98e8b28, diffFile=...) at ../../../kompare/libdiff2/komparemodellist.cpp:549
#24 0xb2818277 in KomparePart::openDiff (this=0x97e80d8, url=...) at ../../../kompare/komparepart/kompare_part.cpp:224
#25 0x08052c9e in KompareShell::openDiff (this=0x97a2408, url=...) at ../../kompare/kompare_shell.cpp:211
#26 0x0805129d in main (argc=5, argv=0xbf832bf4) at ../../kompare/main.cpp:124

Reported using DrKonqi
Comment 1 Kevin Kofler 2011-09-03 17:36:23 UTC
Your computer ran out of memory. RAM is a finite resource.
Comment 2 Konstantin Tokarev 2011-09-03 17:42:21 UTC
Maybe it's better to catch the exception? (of course it will not work if Qt was built without exceptions, but I don't know if KDE supports this configuration)
Comment 3 Konstantin Tokarev 2011-09-03 17:44:04 UTC
Also, this issue could be moved to feature requests: it should be possible for Kompare to do job without having all diff contents in memory at the same time.
Comment 4 Kevin Kofler 2011-09-03 17:45:08 UTC
And what should I do with the exception, if I cannot allocate anything anymore?
Comment 5 Konstantin Tokarev 2011-09-03 18:04:47 UTC
Show message box and quit gracefully.
Comment 6 Kevin Kofler 2011-09-03 18:06:37 UTC
Showing a message box requires several memory allocations, which are going to fail if the memory is exhausted.
Comment 7 Konstantin Tokarev 2011-09-03 18:08:10 UTC
Or even:
1) Abort diff processing
2) Clean up everything for this diff (should resque from OOM situation)
3) Show message box
4) Go back to empty Kompare with no diff selected