crash in QMutex::lock / IndexedString constructor

Andreas Pakulat apaku at gmx.de
Mon Jun 1 22:13:45 UTC 2009


On 01.06.09 22:06:32, Stephan Diederich wrote:
> Hi,
> 
> I played a bit with (building) KDevelop4 beta3 on OSX today. Both
> kdevplatform and kdevelop are from the beta3 tarballs.
> Unfortunately KDevelop crashes right on startup. CrashReporter log is attached.
> As one can see in the bt, the crash happens in static initialization.
> IndexedString uses the following global in it's QString constructor:
> RepositoryManager< IndexedStringRepository >
> globalIndexedStringRepository("String Index");
> which may, or may not be initialized at that time.
> 
> moving that global into an accessor like this:
> namespace {
>   RepositoryManager< IndexedStringRepository >&
> getGlobalIndexedStringRepository(){
>     static RepositoryManager< IndexedStringRepository >
> globalIndexedStringRepository("String Index");
>     return globalIndexedStringRepository;
>   }
> }
> fixed it.

We already moved other global statics into such accessors due to problems
with other compilers than gcc 4.3 on linux (msvc for example) or even with
gcc on linux. The problem is simply that there's no guarantee on the order
of creation of global statics.

However as I don't know the code very well I suggest to wait for a few days
for an answer from David Nolden, before comitting this (you had commit
access right?).

Andreas
 
-- 
You will hear good news from one you thought unfriendly to you.




More information about the KDevelop-devel mailing list