Bug 118652 - Quanta crash for each load of existing project
Summary: Quanta crash for each load of existing project
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-19 17:28 UTC by Grégory Ranchy
Modified: 2005-12-21 10:56 UTC (History)
0 users

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 Grégory Ranchy 2005-12-19 17:28:21 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Fedora RPMs
Compiler:          gcc 4.0.2 I 'am not sure the system use gcc
OS:                Linux

Sorry for my bad english.

I can reproduce this bug on my personal (2.6.14.. FC4-64 with local project) and on my professional computer (2.6.14-1.1653_FC4 with sftp projects) on the professional computer of my colleague (same versions).

To reproduce it :
When I have a opened project (project1) , I open an existing project (project2) (with project/recent project).
Quanta close propertly each opened file, open the files of the new project and crash at the last file.

When I restart Quanta, if I ask to not restore the last project crashed,  quanta open the projet2 corectly.

Below one Crash handler.

Good luck ;-)

[KCrash handler]
#4  0x00d2686c in memcpy () from /lib/libc.so.6
#5  0x07c07d69 in QString::setLength () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#6  0x07c07ea8 in QString::grow () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#7  0x07c0f29f in QString::operatorPlusEqHelper ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#8  0x07c0f344 in QString::operator+= ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#9  0x070ad018 in KURL::url () from /usr/lib/libkdecore.so.4
#10 0x081022b3 in Project::staticMetaObject ()
#11 0x0810e948 in Project::staticMetaObject ()
#12 0x078fd5e4 in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x0731a9b4 in KRecentFilesAction::urlSelected ()
   from /usr/lib/libkdeui.so.4
#14 0x0731e1c1 in KRecentFilesAction::itemSelected ()
   from /usr/lib/libkdeui.so.4
#15 0x07328ab7 in KRecentFilesAction::qt_invoke () from /usr/lib/libkdeui.so.4
#16 0x078fd5e4 in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#17 0x078fdfae in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#18 0x07320785 in KSelectAction::activated () from /usr/lib/libkdeui.so.4
#19 0x073209b1 in KRecentFilesAction::slotActivated ()
   from /usr/lib/libkdeui.so.4
#20 0x07328b59 in KRecentFilesAction::qt_invoke () from /usr/lib/libkdeui.so.4
#21 0x078fd5e4 in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#22 0x07c76146 in QSignal::signal () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#23 0x0791adc3 in QSignal::activate () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#24 0x079236a5 in QSingleShotTimer::event ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#25 0x0789881d in QApplication::internalNotify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#26 0x0789919c in QApplication::notify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#27 0x07019c01 in KApplication::notify () from /usr/lib/libkdecore.so.4
#28 0x0788d0b2 in QEventLoop::activateTimers ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#29 0x078410ca in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#30 0x078b0f6b in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#31 0x078b0e76 in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#32 0x078981e9 in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#33 0x080a410c in QStrList::~QStrList$delete ()
#34 0x00ccfd5f in __libc_start_main () from /lib/libc.so.6
#35 0x0808b981 in ?? ()
Comment 1 András Manţia 2005-12-21 10:56:16 UTC
SVN commit 490250 by amantia:

Fix crash in recent files action by not exposing the internal KURL objects to the caller application.

For the reporter: this means that the bug will disappear only if you upgrade kdelibs from the 3.5 branch or wait for KDE 3.5.1.

BUG: 118652

 M  +3 -4      kactionclasses.cpp  


--- branches/KDE/3.5/kdelibs/kdeui/kactionclasses.cpp #490249:490250
@@ -1103,7 +1103,6 @@
 {
     if ( url.isLocalFile() && !KGlobal::dirs()->relativeLocation("tmp", url.path()).startsWith("/"))
        return;
-    const KURL u = url; // make a copy since d->m_urls.erase( title ) could destroy the KURL that "url" references
     const QString file = url.pathOrURL();
     QStringList lst = KSelectAction::items();
 
@@ -1133,7 +1132,7 @@
     // add file to list
     const QString title = name + " [" + file + "]";
     d->m_shortNames.insert( title, name );
-    d->m_urls.insert( title, u );
+    d->m_urls.insert( title, url );
     lst.prepend( title );
     setItems( lst );
 }
@@ -1236,13 +1235,13 @@
 
 void KRecentFilesAction::itemSelected( const QString& text )
 {
-    emit urlSelected( d->m_urls[ text ] );
+    emit urlSelected( KURL(d->m_urls[ text ]) ); //return a copy of the URL since the slot where it is connected might call addURL or removeURL where the d->m_urls.erase( title ) could destroy the d->m_urls[ text ] and the emitted URL will be invalid in the rest of the slot
 }
 
 void KRecentFilesAction::menuItemActivated( int id )
 {
     QString text = d->m_popup->text(id);
-    emit urlSelected( d->m_urls[ text ] );
+    emit urlSelected( KURL(d->m_urls[ text ]) );//return a copy of the URL since the slot where it is connected might call addURL or removeURL where the d->m_urls.erase( title ) could destroy the d->m_urls[ text ] and the emitted URL will be invalid in the rest of the slot
 }
 
 void KRecentFilesAction::menuAboutToShow()