Bug 309835 - cmake project visitor crashes when changing ownership of project files
Summary: cmake project visitor crashes when changing ownership of project files
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: 4.4.1
Platform: Compiled Sources Linux
: NOR critical
Target Milestone: 4.3.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-10 01:27 UTC by Sven Brauch
Modified: 2012-11-10 17:30 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 Sven Brauch 2012-11-10 01:27:16 UTC
A user in IRC yesterday pointed out an easy reproducable way to crash the CMake visitor:

1) Open a project which uses the cmake project manager
2) While it's being parsed (or not, didn't test), chown the whole project directory to root or something.

For me, this crashes reproducably every time.

Backtrace:
#0  0x00007ffff3b472ab in QUrl::QUrl(QUrl const&) () from /lib/libQtCore.so.4                                                                                                    
#1  0x00007ffff7a33309 in KUrl::KUrl(KUrl const&) () from /lib/libkdecore.so.5                                                                                                   
#2  0x00007ffff07228ff in KDevelop::ProjectBaseItem::url (this=0x4d7d470) at /home/sven/Projekte/kde/kdevplatform/project/projectmodel.cpp:429                                   
#3  0x00007fffb9fb14c3 in CMakeManager::parse (this=0x491fe70, item=0x4d7d470) at /home/sven/Projekte/kde/kdevelop/projectmanagers/cmake/cmakemanager.cpp:737                    
#4  0x00007ffff072ca85 in KDevelop::ImportProjectJobPrivate::import (this=0x5d08930, folder=0x4d7d470) at /home/sven/Projekte/kde/kdevplatform/project/importprojectjob.cpp:53   
#5  0x00007ffff072d03d in QtConcurrent::VoidStoredMemberFunctionPointerCall1<void, KDevelop::ImportProjectJobPrivate, KDevelop::ProjectFolderItem*, KDevelop::ProjectFolderItem*>::runFunctor (this=0x5f8dc40) at /usr/include/QtCore/qtconcurrentstoredfunctioncall.h:412                                                                                        
#6  0x00007ffff072c808 in QtConcurrent::RunFunctionTask<void>::run (this=0x5f8dc40) at /usr/include/QtCore/qtconcurrentrunbase.h:134                                             
#7  0x00007ffff3a8b2bd in ?? () from /lib/libQtCore.so.4                                                                                                                         
#8  0x00007ffff3a9769b in ?? () from /lib/libQtCore.so.4                                                                                                                         
#9  0x00007ffff3807e0f in start_thread () from /lib/libpthread.so.0                                                                                                              
#10 0x00007ffff1bf104d in clone () from /lib/libc.so.6    

folder->project() is zero, that's why it crashes.
Apparently the item is just being deleted, since asserting folder->project() at the function entry point doesn't trigger.

Marking this as critical since it seems likely to trigger crashes when doing git checkouts too (those often chmod stuff too).

Found on 4.4, but crashes in master too.

Reproducible: Always
Comment 1 Milian Wolff 2012-11-10 17:30:19 UTC
Git commit b867b9b0327a5a4eec625fb94f37140951d1d56f by Milian Wolff.
Committed on 10/11/2012 at 18:27.
Pushed by mwolff into branch 'master'.

Don't trigger reload of project that is being reloaded.

That can lead to crashes and random races due to the messed up
thread handling in the cmake manager code.
Related: bug 296348

M  +1    -1    projectmanagers/cmake/cmakemanager.cpp

http://commits.kde.org/kdevelop/b867b9b0327a5a4eec625fb94f37140951d1d56f