[Kde-bindings] accessing the Qt::Clipboard causes a crash

Stefano Crocco stefano.crocco at alice.it
Sat Aug 16 18:27:44 UTC 2008


Accessing the clipboard using qtruby 4 and the Qt::Clipboard class causes my 
application to crash. Here's some code which causes the crash:

require 'Qt4'

a = Qt::Application.new []
clp = Qt::Application.clipboard
clp.text = "test"

Here's the corresponding backtrace:
#0  0xb78f532f in xcall_QClipboard (xi=19, obj=0x81dc670, args=0x8184198) at 
/home/stefano/temp/kdebindings/build/smoke/qt/x_3.cpp:5135
#1  0xb7ba7d10 in QtRuby::MethodCall::callMethod (this=0xbfed3cf0) at 
/home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.h:148
#2  0xb7ba5668 in QtRuby::MethodCallBase::next (this=0xbfed3cf0) at 
/home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.cpp:459
#3  0xb7b77868 in marshall_QString (m=0xbfed3cf0) at 
/home/stefano/temp/kdebindings/ruby/qtruby/src/handlers.cpp:908
#4  0xb7ba56ae in QtRuby::MethodCallBase::next (this=0xbfed3cf0) at 
/home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.cpp:455
#5  0xb7b707f3 in method_missing (argc=2, argv=0xbfed40f0, self=3082629660) at 
/home/stefano/temp/kdebindings/ruby/qtruby/src/Qt.cpp:890
#6  0xb7f0b2ed in call_cfunc () from /usr/lib/libruby18.so.1.8
#7  0xb7f15de8 in rb_call0 () from /usr/lib/libruby18.so.1.8
#8  0xb7f15f29 in rb_call () from /usr/lib/libruby18.so.1.8
#9  0xb7f16805 in rb_funcall2 () from /usr/lib/libruby18.so.1.8
#10 0xb7f1bf5e in method_missing () from /usr/lib/libruby18.so.1.8
#11 0xb7f1601b in rb_call () from /usr/lib/libruby18.so.1.8
#12 0xb7f111c3 in rb_eval () from /usr/lib/libruby18.so.1.8
#13 0xb7f21523 in ruby_exec_internal () from /usr/lib/libruby18.so.1.8
#14 0xb7f21563 in ruby_exec () from /usr/lib/libruby18.so.1.8
#15 0xb7f21598 in ruby_run () from /usr/lib/libruby18.so.1.8
#16 0x080487a5 in main ()

My system is:
gentoo linux 2.6.25
gcc 4.3.1
qt 4.4.1
ruby 1.8.7 p72
latest svn revision of qtruby4

The same code works perfectly in C++ and it used to work in ruby some time ago 
(with qt 4.4.0 and a previous version of ruby 1.8.7)

Stefano



More information about the Kde-bindings mailing list