[bt-devel] Crash While Canceling Bookshelf Download

Eeli Kaikkonen eekaikko at mail.student.oulu.fi
Fri Nov 6 00:27:05 MST 2009


On Fri, 6 Nov 2009, Eeli Kaikkonen wrote:

> On Thu, 5 Nov 2009, Gary Holmlund wrote:
> > The wait function will return as soon as the thread does terminate so
> > there is not much cost to greatly increasing the time. I put 25,000 ms
> > on the first wait and 10,000 on the second. I have not seen a crash
> > since then. I did see from 0 to 5 second delay after canceling before
> > the dialog went away. We would have to have a 35 second delay before a
> > crash could still occur.
> >
> > I have checked in this change.
>
> Sorry, but it doesn't work (though I haven't tested it yet). I
> originally tried to do it that way, but QThread::terminate() just isn't
> reliable. In Linux it didn't work at all. If you have tested it Windows,
> it might work.
>
> This is why we need either our own FTP backend or fixed SWORD backend.


I have to take some of this back. I just tested and it worked somehow.
I don't know why it didn't when I first tried this kind of solution.

But, when I try to install many modules and cancel some of them, there
are bugs. The first one which I stopped got stuck to 93%. It seems to be
only the progress bar, not the thread, but still. And the last one,
which I didn't try to stop, got stuck in "Preparing install". The debug
output shows that install has stopped "Error with install:  -1 module:
"HodgeSysTheo"". This is probably a bug in our return value handling.
Finally, after long time I clicked Stop All and the dialog closed
cleanly.

In short, it creates too much new problems. And QThread::terminate() is
bad according to docs. It's not guaranteed to work similarly on all
platforms.

I would appreciate very much if you could test some changes in the SWORD
library in Windows. They are only couple of lines in one file. If we
find them working, they will be taken into the next SWORD release and we
can then change BT accordingly.

The details can be found in thread "curl library and download
termination", 4 posts (unfortunately not all in one thread) in
http://www.crosswire.org/pipermail/sword-devel/2009-October/thread.html
and
http://www.crosswire.org/pipermail/sword-devel/2009-November/thread.html

I can explain further if needed.

  Yours,
	Eeli Kaikkonen (Mr.), Oulu, Finland
	e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)



More information about the bt-devel mailing list