[Kde-bindings] QtRuby + Ruby 1.9 and the kross/qtruby crash

Sebastian Sauer mail at dipe.org
Mon Feb 25 11:02:51 UTC 2008


Cyrille Berger wrote:

> On Monday 25 February 2008, Sebastian Sauer wrote:
>> > So I decided to try ruby 1.9 (to get it build and running I had to
>> > patch QtRuby source and use the FindRUBY.cmake in attachement ). As far
>> > as I can see with Ruby 1.9 I don't get a crash with QtRuby and Kross on
>> > 32bits system. But unfortunately the connect function is also broken :(
>>
>> The connect() of QtRuby or of Kross?
> QtRuby, for Kross I might have been able to find a fix ;)
> 
>> Also just ~2 days ago I found an issue within our handling of
>> VALUE RubyExtension::toVALUE(RubyExtension* extension)
>> and fixed it. There we always registered a deleter what may result in
>> double free's :-/ So, it could even possible that the problem is/was also
>> related to that issue though it's fixed now :)
> Nah no luck. And anyway double free would be catched by valgrind. (and
> would affect amd64 as well).

okeli, as usual I failed to catch some sleeps since yesterday and used the 
time to debug a bit and seems I run into another crasher with 1.8.6 that may 
related.

The case;
1. RubyExtension::callMetaMethod is called with funcname=callFunction with 2 
arguments. 1st is the functionname, 2th is a QVariantList that has one item, 
the QObject*
2. Within RubyExtension::callMetaMethod we create the RubyCallCache for 
@callcachecallFunction
3. RubyCallCache::execfunction is called. Everything is still fine.
4. Within RubyCallCache::execfunction() we call d->object->qt_metacall()
5. Now the RubyScript::callFunction() got executed. Everything is still fine 
and a correct pointer to a QObject* got returned.
6. Execution continues at RubyCallCache::execfunction() and now we have an 
invalid pointer to the by d->object->qt_metacall() returned QObject* (the 
variantargs[0]->toVoidStar()).

So, questions is, if this is a problem with the combination/implementation of 
our callcache and/or if something wents totaly wrong in ruby (according to 
gdb, between 5. and 6. Ruby does quit a lot of things and as usual it's not 
easy to follow that route).



More information about the Kde-bindings mailing list