Multiple QRegExp crashes when multithreading in KRunner
Matthias Fuchs
mat69 at gmx.net
Fri Jan 14 09:53:11 GMT 2011
Am Freitag 14 Januar 2011, 01:16:07 schrieb Thiago Macieira:
> On Thursday, 13 de January de 2011 15:08:06 Aaron J. Seigo wrote:
> > On Thursday, January 13, 2011, Thiago Macieira wrote:
> > > On Thursday, 13 de January de 2011 22:43:28 Matthias Fuchs wrote:
> > > > Hi,
> > > >
> > > > There are some crashes related to QRegExp and multithreading, so
> > > > they
> > > > appear when using KRunner.
> > >
> > > There should be no crashes related to QRegExp and threading since Qt
> > > 4.4.
> > > If you find something, it's usually because you used the same QRegExp
> > > object to conduct searches at the same time.
> >
> > yes, that's exactly what's happening :) Matthias already fixed one
> > krunner plugin that was doing this, but not he's faced with the
> > Nepomuk::Query::QueryParser bits.
> >
> > as it is internal to Nepomuk and it is using static members internal to
> > the library (meaning krunner or any other app can't just use a
> > "different Nepomuk object") QThreadStorage seems the easiest solution
> > here.
>
> Nah.
>
> Just create a copy on the stack:
>
> QRegExp rx = theRx;
> if (rx.indexIn(str) != 0) { ... }
Yet that is what is happening in the KGet runner case [1] -- I simply create
an instance of QRegExp on the stack -- and there it crashes too.
Now I understand that you mentioned to make a test case, though I can't
reproduce this crash myself.
In the report Qt 4.6.3 is mentioned.
[1]
http://websvn.kde.org/tags/KDE/4.4.5/kdenetwork/kget/plasma/runner/kgetrunner.cpp?revision=1142811&view=markup
Crash happens at line 114, also see
https://bugs.kde.org/show_bug.cgi?id=255860
More information about the kde-core-devel
mailing list