Multiple QRegExp crashes when multithreading in KRunner

Matthias Fuchs mat69 at
Thu Jan 13 21:43:28 GMT 2011


There are some crashes related to QRegExp and multithreading, so they appear 
when using KRunner.

One happens in Nepomuk::Query::QueryParser::parse, a static method that uses 
globally defined QRegExps. [1]

Now I wonder what the best solution is for this specific problem.
Last week I discussed with Aaron and he suggested that maybe QThreadStorage 
could be used or checking if the calling thread is different from the thread 
the object lives in.
I am not sure how ThreadWeaver works, so if using QThreadStorage would 
actually make sense or if threads are quite often disposed and nothing could 
be reused in a multithreading scenario -- though still in a one thread one.

Another bug also related to QRegExp, this time the problem is in KGet [2]. 
Since I am no that experienced in multi-threadded coding it'd be great if you 
could tell me exactly how to fix that problem so that I could do it myself 
from then on without wasting your time. :)
And as far as I can remember there are further KRunner crashes attributed to 
this, so it would make KRunner more stable which would be great.

PS.: Sorry Aaron for not writing earlier, the last days were more stressful 
than anticipated.


[2] kget/plasma/runner/kgetrunner.cpp:119 (the report mentiones 114, though 
that is from an older revision)

More information about the kde-core-devel mailing list