[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 302744] crash on start in KDevelop::TopDUContext::indexForUsedDeclaration
From:       Milian Wolff <mail () milianw ! de>
Date:       2012-08-02 10:31:17
Message-ID: bug-302744-40295-pBbol3Wnqh () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=302744

Milian Wolff <mail@milianw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |http://commits.kde.org/kdev
                   |                            |elop/dd57cbe2fe91ef2bc24c90
                   |                            |3ce552e5623f02ef51

--- Comment #2 from Milian Wolff <mail@milianw.de> ---
Git commit dd57cbe2fe91ef2bc24c903ce552e5623f02ef51 by Milian Wolff.
Committed on 02/08/2012 at 12:00.
Pushed by mwolff into branch '4.4'.

Don't use raw Declaration pointers across unlocked DUChain code paths.

Since the declarations might be randomly deleted by the cleanup thread
or something else, it is potentially dangerous to use raw declaration
pointers after the duchain was unlocked and locked again.

Instead, always use either the DeclarationPointer or an IndexedDeclaration.

Furthermore, it is often not a good idea to search for declarations
holding a read lock, then unlocking it, just to acquire a write lock
and finally do something useful with the found declarations. This
would only be a safe operation if we use e.g. DeclarationPointers.

Finally I severly doubt that the code snippets changed here have
a worse performance now. Granted, now there is no chance that another
thread can operate on the DUChain while we search for the declarations,
yet we also have less context switching and don't need the DeclarationPointer
indirection and thus might be done faster...

M  +10   -20   projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
M  +3    -2    projectmanagers/cmake/parser/cmaketypes.h

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic