[Kde-bindings] crash testing a korundum application with rspec and ruby 1.8.7-p160

Stefano Crocco stefano.crocco at alice.it
Fri May 15 16:02:38 UTC 2009


On Sunday 10 May 2009, Stefano Crocco wrote:
> |I'm using rspec to test my korundum4 application (with latest svn revision
> | of both kde and korundum). I have a sets of tests which, until yesterday,
> | worked correctly. Yesterday, I installed ruby 1.8.7-p160 (before I used
> | ruby-1.8.7- p72) and suddnely I got a number of crashes. Looking at the
> | changelog for ruby-1.8.7-p72, I noticed two entries related to the
> | function run_final mentioned in the stack traces I got from the crashes.
> | Those entries are:
> |
> |* gc.c (run_final): frees zombies only
> |* gc.c (run_final): calls free function
...
> |I tried disabling the GC and indeed the tests stopped crashing.
> |
> |I must add that the application these tests refer to still works
> | correctly. The crashes only happen in the tests.

Unfortunately, the last statement turned out to be rather optimistic: it seems 
that random crashes happens also outside tests. This made me think that maybe 
the issue is not with my program but that the way qtruby deals with garbage 
collecting isn't completely compatible with the new ruby version. Do you think 
this is possible?

I tried looking inside at the gc.c source and, according with the stack traces 
I get, it seems that the lines causing the crashes are these (in particular, 
the middle one):

    if (BUILTIN_TYPE(obj) == T_DEFERRED && RDATA(obj)->dfree) {
	(*RDATA(obj)->dfree)(DATA_PTR(obj));
    }

These lines seem to be new in ruby 1.8.7-p160.

The failing line in qtruby is line 373 ruby/qtruby/src/handlers.cpp, which 
contains a simple 

if (qobject->parent() != 0) {

As I said in my previous message, I can't provide an example of code with this 
crash, because I can't begin to understand its reasons. The pieces of code 
which cause this look like a number of other pieces of code which instead work 
flawlessly. If you need me to test something, however, I'm ready to do that.

By the way, since I kept having crashes at the C level even before this issue, 
I'd like to learn about the inner workings of smoke and qtruby, so that I can 
at least try to understand what's wrong in my code. Does anyone know whether 
there's some documentation about this (aside from the smoke example at 
http://techbase.kde.org/Development/Languages/Smoke)?

Thanks in advance

Stefano



More information about the Kde-bindings mailing list