[KDev3.4] BlockingKProcess should be fixed.

dukju ahn dukjuahn at gmail.com
Mon Apr 23 19:51:41 UTC 2007


2007/4/23, Andras Mantia <amantia at kde.org>:
> On Monday 23 April 2007, dukju ahn wrote:
> > Attached file is stacktrace. At stacknumber #33, BKProc::enter_loop()
> > called. In that event loop, SVNFileInfoProvider:;status() is called,
> > which calls NetAccess::syncRun().
> > In short, syncRun()'s enter_loop() is called on the top of the
> > BKProc::enter_loop().
>
> Let's try to solve the problem in another way: change
> parts/fileview/fileviewpart.cpp line 72 from
> QTimer::singleShot( 1000, this, SLOT(init()) );
> to
> QTimer::singleShot( 0, this, SLOT(init()) );
>
> If doesn't help, replace it with a simple
> init();
>
> As I see the problem is that there is a timer running (the one above)
> when the BKProcess code is executed, which is fired during this
> execution of the external application in blocking mode. Unfortunately
> this time executes code which runs KIO::NetAccess and messes up the
> event loops.

Oh.. I see. That's the reason why sometimes I encounter this bug,
and sometimes I didn't met this bug. Actually, when I try 10 times,
one or two times run fine without bug. That depended on the
system speed, memory status and etc.

>  Yes, this is a general problem and can happen anytime you use
> KIO::NetAccess (and is not BKProcess specific). If you have a timer, a
> KIO::NetAccess call, and this call takes some time and the timer is
> fired meantime and the timer's slot executes another KIO::NetAccess
> call, you're at the same situation.
>  Using a 0 ms timer (which is anyway suggested, I have no idea why there
> is a 1second timer there) might reduce the chance of running in this
> bug, altough executing directly should be the safest. Other solution
> might be to suspend existing timers, if this is possible (e.g you know
> the pointers to the timers).

Anyway, we've removed NetAccess::synchronousRun() call by
making filetreeview ASynchronous. So there is no such bug anymore.
But your analysis and comment will be useful for next time.

Thanks.




More information about the KDevelop-devel mailing list