Bug 78776 - crash in CustomProjectPart::populateProject populating new project
Summary: crash in CustomProjectPart::populateProject populating new project
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.2
Platform: FreeBSD Ports FreeBSD
: NOR crash
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-31 03:30 UTC by Marc Unangst
Modified: 2004-03-31 18:14 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 Marc Unangst 2004-03-31 03:30:40 UTC
Version:           3.0.2 (using KDE KDE 3.2.1)
Installed from:    FreeBSD Ports
Compiler:          gcc/g++ 2.95.4 
OS:          FreeBSD

I'm attempting to import a large source tree (~700MB, 39000 files) as a new project.  I select Project->Import Existing Project, import it as a "Generic C Application (Custom Makefiles)", and point it to the root directory of the project.  It asks if I want to add the existing C/C++ files to the project, and I click [Yes].  Shortly thereafter KDevelop crashes with a segfault here:

(gdb) bt
#0  0x292f81d8 in QGListIterator::QGListIterator ()
   from /usr/X11R6/lib/libqt-mt.so.3
#1  0x2a02ee36 in CustomProjectPart::populateProject (this=0x8932d48)
    at /usr/X11R6/include/qptrlist.h:157
#2  0x2a02eabf in CustomProjectPart::openProject (this=0x8932d48,
    dirName=@0xbfbfdfc0, projectName=@0xbfbfdfc8) at customprojectpart.cpp:245
#3  0x0807c120 in ProjectManager::loadProjectPart (this=0x81bf188)
    at projectmanager.cpp:516
#4  0x0807aa90 in ProjectManager::loadProject (this=0x81bf188, url=@0xbfbfe098)
    at projectmanager.cpp:294
#5  0x080710b4 in Core::openProject (this=0x81c59a8,
    projectFileName=@0xbfbfe1ec) at core.cpp:89
#6  0x29c24adb in ImportDialog::accept (this=0xbfbfeae4) at importdlg.cpp:134
#7  0x29397a54 in QDialog::qt_invoke () from /usr/X11R6/lib/libqt-mt.so.3
#8  0x29c2b4ea in ImportDialogBase::qt_invoke (this=0xbfbfeae4, _id=47,
    _o=0xbfbfe38c) at importdlgbase.moc:90
#9  0x29c26a7e in ImportDialog::qt_invoke (this=0xbfbfeae4, _id=47,
    _o=0xbfbfe38c) at importdlg.moc:96
#10 0x29094b82 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#11 0x29094a71 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#12 0x29375da3 in QButton::clicked () from /usr/X11R6/lib/libqt-mt.so.3
#13 0x2910f83d in QButton::mouseReleaseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#14 0x290c2ce1 in QWidget::event () from /usr/X11R6/lib/libqt-mt.so.3
#15 0x2904476b in QApplication::internalNotify ()
   from /usr/X11R6/lib/libqt-mt.so.3
#16 0x29043d0c in QApplication::notify () from /usr/X11R6/lib/libqt-mt.so.3
#17 0x28cac24f in KApplication::notify () from /usr/local/lib/libkdecore.so.6
#18 0x28fe87f5 in QETWidget::translateMouseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#19 0x28fe6974 in QApplication::x11ProcessEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#20 0x28ffa71b in QEventLoop::processEvents ()
   from /usr/X11R6/lib/libqt-mt.so.3
#21 0x29053ae6 in QEventLoop::enterLoop () from /usr/X11R6/lib/libqt-mt.so.3
#22 0x29044985 in QApplication::enter_loop () from /usr/X11R6/lib/libqt-mt.so.3
#23 0x291e6a60 in QDialog::exec () from /usr/X11R6/lib/libqt-mt.so.3
#24 0x29c1cab8 in AppWizardPart::slotImportProject (this=0x82a0930)
    at appwizardpart.cpp:84
#25 0x29c1ce61 in AppWizardPart::qt_invoke (this=0x82a0930, _id=3,
    _o=0xbfbfec5c) at appwizardpart.moc:90
#26 0x29094b82 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#27 0x29094a71 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#28 0x28aac594 in KAction::activated () from /usr/local/lib/libkdeui.so.6
#29 0x28aac006 in KAction::slotActivated () from /usr/local/lib/libkdeui.so.6
#30 0x28aac820 in KAction::qt_invoke () from /usr/local/lib/libkdeui.so.6
#31 0x29094b82 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#32 0x2936e2a8 in QSignal::signal () from /usr/X11R6/lib/libqt-mt.so.3
#33 0x290ab8b7 in QSignal::activate () from /usr/X11R6/lib/libqt-mt.so.3
#34 0x2917722c in QPopupMenu::mouseReleaseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#35 0x290c2ce1 in QWidget::event () from /usr/X11R6/lib/libqt-mt.so.3
#36 0x2904476b in QApplication::internalNotify ()
   from /usr/X11R6/lib/libqt-mt.so.3
#37 0x29043d0c in QApplication::notify () from /usr/X11R6/lib/libqt-mt.so.3
#38 0x28cac24f in KApplication::notify () from /usr/local/lib/libkdecore.so.6
#39 0x28fe84d1 in QETWidget::translateMouseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#40 0x28fe6974 in QApplication::x11ProcessEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#41 0x28ffa71b in QEventLoop::processEvents ()
   from /usr/X11R6/lib/libqt-mt.so.3
#42 0x29053ae6 in QEventLoop::enterLoop () from /usr/X11R6/lib/libqt-mt.so.3
#43 0x29053a32 in QEventLoop::exec () from /usr/X11R6/lib/libqt-mt.so.3
#44 0x29044905 in QApplication::exec () from /usr/X11R6/lib/libqt-mt.so.3
#45 0x080695d6 in main (argc=1, argv=0xbfbff6dc) at main.cpp:128
#46 0x08068c56 in _start ()
(gdb)
(gdb) p *dirEntries
$30 = {<QGList> = {<QPtrCollection> = {del_item = false, _vptr$ = 0x0},
    firstNode = 0x871c6d8, lastNode = 0xbfbfdf74, curNode = 0x2a02eabf,
    curIndex = 143863112, numNodes = 2,
    iterators = 0x29654f50}, <No data fields>}
(gdb) p it
$31 = {<QGListIterator> = {list = 0x0, curNode = 0x0}, <No data fields>}
(gdb)
Comment 1 Jens Dagerbo 2004-03-31 10:26:52 UTC
This looks exactly like bug #75943. I'm guessing there is a directory in there you are not allowed to enter too?
Comment 2 Jens Dagerbo 2004-03-31 10:27:27 UTC
CVS commit by dagerbo: 

Don't crash when we don't have permission to read a directory.

CCMAIL: 78776-done@bugs.kde.org


  M +16 -13    customprojectpart.cpp   1.73


--- kdevelop/buildtools/custommakefiles/customprojectpart.cpp  #1.72:1.73
@@ -273,4 +273,6 @@ void CustomProjectPart::populateProject(
         kdDebug(9025) << "Examining: " << dir.path() << endl;
         const QFileInfoList *dirEntries = dir.entryInfoList();
+        if ( dirEntries )
+        {
         QPtrListIterator<QFileInfo> it(*dirEntries);
         for (; it.current(); ++it) {
@@ -288,4 +290,5 @@ void CustomProjectPart::populateProject(
             }
         }
+        }
     } while (!s.isEmpty());
 


Comment 3 Jens Dagerbo 2004-03-31 10:31:00 UTC
CVS commit by dagerbo: 

BACKPORT
Don't crash when we don't have permission to read a directory.

CCMAIL: 78776@bugs.kde.org


  M +16 -13    customprojectpart.cpp   1.68.2.3


--- kdevelop/buildtools/custommakefiles/customprojectpart.cpp  #1.68.2.2:1.68.2.3
@@ -273,4 +273,6 @@ void CustomProjectPart::populateProject(
         kdDebug(9025) << "Examining: " << dir.path() << endl;
         const QFileInfoList *dirEntries = dir.entryInfoList();
+        if ( dirEntries )
+        {
         QPtrListIterator<QFileInfo> it(*dirEntries);
         for (; it.current(); ++it) {
@@ -288,4 +290,5 @@ void CustomProjectPart::populateProject(
             }
         }
+        }
     } while (!s.isEmpty());
 


Comment 4 Marc Unangst 2004-03-31 18:14:39 UTC
That did indeed solve the crash; thanks for the quick reply!