[Kde-bindings] comparing a Qt object with nil causes a crash in korundum4

Stefano Crocco stefano.crocco at alice.it
Sun Nov 16 09:26:26 UTC 2008


With a recent version of korundum4, comparing an instance of any Qt class
(Qt::Rect, Qt::Widget, Qt::Point...) with nil causes a crash. Here's a piece
of code causing this behaviour:

require 'Qt4'
pt = Qt::Point.new(2,4)
pt == nil

and here's the corresponding backtrace:

#0  0xb76aa8e4 in xcall_QGlobalSpace (xi=<value optimized out>, obj=0x0, args=0x81919a8) at /usr/include/qt4/QtCore/qpoint.h:149
#1  0xb74df245 in QtRuby::MethodCall::callMethod (this=0xbfae569c) at /home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.h:148
#2  0xb74dcb98 in QtRuby::MethodCallBase::next (this=0xbfae569c) at /home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.cpp:459
#3  0xb74a7376 in class_method_missing (argc=3, argv=0xbfae5a20, klass=3082870120) at /home/stefano/temp/kdebindings/ruby/qtruby/src/Qt.cpp:943
#4  0xb7bbe2cb in module_method_missing (argc=3, argv=0xbfae5a20, klass=3082870120) at /home/stefano/temp/kdebindings/ruby/qtruby/src/qtruby.cpp:1209
#5  0xb7f1e2ed in call_cfunc (func=0xb7bbe2a0 <module_method_missing>, recv=3082870120, len=0, argc=3, argv=0x81d7fb8) at eval.c:5749
#6  0xb7f28de8 in rb_call0 (klass=3082869800, recv=3082870120, id=4057, oid=4057, argc=3, argv=0xbfae5a20, body=0xb7c0dc14, flags=<value optimized out>) at eval.c:5904
#7  0xb7f28f29 in rb_call (klass=3082869800, recv=3082870120, mid=4057, argc=3, argv=0xbfae5a20, scope=0, self=3058936420) at eval.c:6151
#8  0xb7f2387e in rb_eval (self=3058936420, n=<value optimized out>) at eval.c:3492
#9  0xb7f265c0 in rb_eval (self=3058936420, n=<value optimized out>) at eval.c:3308
#10 0xb7f28cc9 in rb_call0 (klass=3082870040, recv=3058936420, id=321, oid=321, argc=1, argv=0xbfae6570, body=0xb7c08fc0, flags=<value optimized out>) at eval.c:6055
#11 0xb7f28f29 in rb_call (klass=3082870040, recv=3058936420, mid=321, argc=1, argv=0xbfae6570, scope=0, self=3083975000) at eval.c:6151
#12 0xb7f2387e in rb_eval (self=3083975000, n=<value optimized out>) at eval.c:3492
#13 0xb7f34523 in ruby_exec_internal () at eval.c:1641
#14 0xb7f34563 in ruby_exec () at eval.c:1661
#15 0xb7f34598 in ruby_run () at eval.c:1671
#16 0x080487a5 in main (argc=2, argv=0x4, envp=0xb7bd83a4) at main.c:48

This happens with:
* Gentoo linux
* gcc version 4.3.2 (Gentoo 4.3.2 p1.0)
* Qt 4.4.2
* ruby 1.8.7 patchlevel 72

Note that this behaviour didn't occur with previous revisions of korundum4 
(I'm almost sure it worked with revision 874468).

Stefano



More information about the Kde-bindings mailing list