[Kde-bindings] QtRuby crashes (2)

Sebastian Sauer mail at dipe.org
Wed Nov 21 10:23:29 UTC 2007


Richard Dale wrote:

> On Wednesday 21 November 2007 02:59:47 Sebastian Sauer wrote:
>> This is still related to
>> http://lists.kde.org/?l=kde-bindings&m=119438557809008&w=2
>>
>> I did future investigate the crash and did note, that shortly before the
>> crash the QHash's detach-state changes from detached to not detached.
>> Some more tests did show up, that the QHash (or better parts of it) got
>> destroyed during the cleanup. Now I could provide some more details why
>> it wasn't visible before I jumped into that (K_GLOBAL_STATIC etc.), why
>> it happens with QHash and not QMap (QAtomic*), etc. but let's make it
>> short; attached is another patch that fixes the crash by using
>> Q_GLOBAL_STATIC which does take care of that situation. Ok to commit?
> Yes, please do. Excellent stuff - that for all the investigating. And
> you've even found out why it didn't happen with QMap. I'll have to read up
> on what using Q_GLOBAL_STATIC is all about.

In that case it expands to a class that then makes sure to set the pointer to 
the QHash to NULL if destruction starts rather then leaving it up to the user 
to be sure he does not access the QHash while it's beeing destructed.

> We've had trouble with Qyoto crashing on exit too, and I wonder if it's
> for the same reason.

I also did run in a crash that looks very similar with latest PyQt4. Not sure 
there if it wasn't a side-effect of running QtRuby and PyQt side by side 
within the same process ;)

> I assume we still have the problem of embedded QtRuby 
> code in kross crashing, and the unexplained memory corruption of Ruby
> Plasma applets though.

and I still can't reproduce any of both problems on my system. Both 
works/worked fine here without any problems :-(
But I did note, that QtRuby as well as Korundum are using rb_fatal what is 
really evil since it bypasses any rb_rescue2 as well as any kind of 
exception-handler and just quits the whole application. Probably it should be 
changed to rb_raise to allow to catch that error?



More information about the Kde-bindings mailing list