Summary: | Kompare 3.3 crashes on a big diff file | ||
---|---|---|---|
Product: | [Applications] kompare | Reporter: | Rafael J. Wysocki <rjwysocki> |
Component: | parser | Assignee: | Kompare developers <kompare-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | 3.3 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Rafael J. Wysocki
2004-09-27 20:53:03 UTC
I can confirm this, everytime a file in the diff is parsed there is 65k allocated for the levenstein table, but i had a hitcount of around 14000 parsed files before i ran out of memory (1 GB in my laptop) I dont think there are 14000 files in that diff but anyway i'll have to release the tables because afterwards i dont use them anyway. But the 14000 allocations indicate a different bug in the parser which needs to be fixed. Cant find this one yet, give me a few more days (missed the 3.3.1 deadline so you'll have to wait until 3.3.2 or use the patch that i'll attach here as soon as i have a fix and then recompile kompare). This is gonna be a little spammy... I'm reassigning everything that's currently assigned to bruggie (who's been the default assignee for bugs since time began) to the new list address. Bruggie: if you're working on one or more of these atm, please snatch 'em back.. Everyone, esp. Joshua and Bruggie: if this genrates 33 mails, my sincere apologies.. SVN commit 444219 by je4d: put the levenstein table on the stack, not the heap, and hence only allocate mem for it when needed, rather than having 65k*(number of files) allocated all the time. BUG: 90345 CCMAIL: bruggie@home.nl M +4 -10 difference.cpp M +1 -1 difference.h --- branches/KDE/3.5/kdesdk/kompare/libdiff2/difference.cpp #444218:444219 @@ -26,14 +26,12 @@ m_type( type ), m_sourceLineNo( sourceLineNo ), m_destinationLineNo( destinationLineNo ), - m_applied( false ), - m_table( new LevenshteinTable() ) + m_applied( false ) { } Difference::~Difference() { - delete m_table; } void Difference::addSourceLine( QString line ) @@ -63,6 +61,7 @@ void Difference::determineInlineDifferences() { + LevenshteinTable table; if ( m_type != Difference::Change ) return; @@ -80,15 +79,10 @@ DifferenceString* dl = destinationLineAt( i ); // FIXME: If the table cant be created dont do the rest - m_table->createTable( sl, dl ); + table.createTable( sl, dl ); - m_table->createListsOfMarkers(); + table.createListsOfMarkers(); } - - // No longer needed, if we ever need to recalculate the inline differences we should - // simply recreate the table - delete m_table; - m_table = 0; } QString Difference::recreateDifference() const --- branches/KDE/3.5/kdesdk/kompare/libdiff2/difference.h #444218:444219 @@ -210,7 +210,7 @@ bool m_applied; bool m_conflicts; - LevenshteinTable* m_table; + LevenshteinTable* m_tableXXX; // now unused }; typedef QValueList<Difference*> DifferenceList; SVN commit 750441 by kkofler: put the levenstein table on the stack, not the heap, and hence only allocate mem for it when needed, rather than having 65k*(number of files) allocated all the time. CCBUG: 90345 (forward-port rev 444219 by je4d from 3.5 branch) M +4 -10 difference.cpp M +0 -2 difference.h WebSVN link: http://websvn.kde.org/?view=rev&revision=750441 |