Bug 75943 - Crash during directory scan (loading project on startup or import existing project)
Summary: Crash during directory scan (loading project on startup or import existing pr...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: scriptproject (show other bugs)
Version: 3.0.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
: 80884 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-23 21:42 UTC by Michael Aichler
Modified: 2004-05-04 11:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Aichler 2004-02-23 21:42:15 UTC
Version:           3.0.1 (using KDE KDE 3.2.0)
Installed from:    SuSE RPMs
Compiler:          gcc-3.3.1 
OS:          Linux

Hi,

Today I tried importing an existing PHP project into KDevelop. The application crashed while it was scanning the project files.
In the project directory there is a tmp directory for cached and compiled files from Smarty and Adodb:

tmp/
tmp/CVS
tmp/adodb
tmp/adodb/CVS
tmp/adodb/cache
tmp/adodb/cache/CVS
tmp/smarty
tmp/smarty/CVS
tmp/smarty/compile
tmp/smarty/compile/CVS
tmp/smarty/compile/%%-13
tmp/smarty/compile/%%-13/%%-133643295
tmp/smarty/compile/%%-95
tmp/smarty/compile/%%-95/%%-954924434
tmp/smarty/compile/%%197
tmp/smarty/compile/%%197/%%1976968838
tmp/smarty/compile/%%318
tmp/smarty/compile/%%318/%%318464488
tmp/smarty/compile/%%642
tmp/smarty/compile/%%642/%%642129647
tmp/smarty/compile/%%759
tmp/smarty/compile/%%759/%%759812923
tmp/smarty/cache
tmp/smarty/cache/CVS

The directories under tmp/smarty/compile/ are created with apaches user and group id and have limited permissions:

drwxr-x--x    3 wwwrun   www            80 2004-02-23 12:51 %%-13
drwxr-x--x    3 wwwrun   www            80 2004-02-23 12:59 %%197
drwxr-x--x    3 wwwrun   www            80 2004-02-23 12:51 %%318
drwxr-x--x    3 wwwrun   www            80 2004-02-23 13:16 %%642
drwxr-x--x    3 wwwrun   www            80 2004-02-23 13:15 %%759
drwxr-x--x    3 wwwrun   www            80 2004-02-23 12:59 %%-95
drwxr-xr-x    2 micha    cvs           128 2004-02-11 21:03 CVS

If I remove these directories then KDevelop is able to import the project and to load it on startup.
All tests gave me the same result: as soon as there is a directory that is not accessible with the rights of the user running KDevelop it will crash.

Here's the backtrace:

[New Thread 16384 (LWP 2775)]
0x418f3a86 in waitpid () from /lib/i686/libpthread.so.0
#0  0x418f3a86 in waitpid () from /lib/i686/libpthread.so.0
#1  0x40e0da7a in KCrash::defaultCrashHandler(int) ()
   from /opt/kde3/lib/libkdecore.so.4
#2  0x418f296c in __pthread_sighandler () from /lib/i686/libpthread.so.0
#3  <signal handler called>
#4  0x415005da in QGListIterator::QGListIterator(QGList const&) ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#5  0x40924a44 in QPtrListIterator<QFileInfo>::QPtrListIterator(QPtrList<QFileInfo> const&) () from /opt/kde3/lib/libkio.so.4
#6  0x42263d5a in ScriptProjectPart::openProject(QString const&, QString const&) () from /opt/kde3/lib/kde3/libkdevscriptproject.so
#7  0x08074323 in ProjectManager::loadProjectPart() ()
#8  0x08072a25 in ProjectManager::loadProject(KURL const&) ()
#9  0x080726ed in ProjectManager::loadDefaultProject() ()
#10 0x08064752 in main ()
Comment 1 Jens Dagerbo 2004-03-22 04:58:47 UTC
CVS commit by dagerbo: 

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

CCMAIL: 75943-done@bugs.kde.org


  M +20 -17    scriptprojectpart.cpp   1.41


--- kdevelop/buildtools/script/scriptprojectpart.cpp  #1.40:1.41
@@ -138,4 +138,6 @@ void ScriptProjectPart::openProject(cons
         kdDebug(9015) << "Examining: " << dir.path() << endl;
         const QFileInfoList *dirEntries = dir.entryInfoList();
+        if ( dirEntries )
+        {
         QPtrListIterator<QFileInfo> it(*dirEntries);
         for (; it.current(); ++it) {
@@ -158,4 +160,5 @@ void ScriptProjectPart::openProject(cons
             }
         }
+        }
     } while (!s.isEmpty());
 


Comment 2 Jens Dagerbo 2004-03-29 20:01:52 UTC
CVS commit by dagerbo: 

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

CCMAIL: 75943@bugs.kde.org


  M +20 -17    scriptprojectpart.cpp   1.39.2.1


--- kdevelop/buildtools/script/scriptprojectpart.cpp  #1.39:1.39.2.1
@@ -138,4 +138,6 @@ void ScriptProjectPart::openProject(cons
         kdDebug(9015) << "Examining: " << dir.path() << endl;
         const QFileInfoList *dirEntries = dir.entryInfoList();
+        if ( dirEntries )
+        {
         QPtrListIterator<QFileInfo> it(*dirEntries);
         for (; it.current(); ++it) {
@@ -158,4 +160,5 @@ void ScriptProjectPart::openProject(cons
             }
         }
+        }
     } while (!s.isEmpty());
 


Comment 3 Amilcar do Carmo Lucas 2004-05-04 11:23:43 UTC
*** Bug 80884 has been marked as a duplicate of this bug. ***