[Kde-bindings] qtruby random crashes on multiple cores

Florian Staudacher florian_staudacher at yahoo.de
Tue Jul 3 21:04:53 UTC 2012


Hi!

I am currently working on a small ruby script that uses Qt bindings
for GUI (it contains a QLineEdit, QPushButton and a QWebView, in case
that matters) and I am seeing a very strange behavior:

On my multi-core desktop computer there are random crashes when I
execute the script. Sometimes the GUI doesn't even show, sometimes it
opens the window ok, but then upon interacting at some
non-deterministic point a segfault occurrs (see the backtrace below).

But if I run the same script either with

   $ taskset 1 ruby test.rb   # limits the process to one core

or on my laptop, which has only one core, there are no crashes and
everything runs fine.

Is this a problem in my setup or am I the only person trying to run a
qtruby script on a multi-core system with that problem ... because
google is no great help, either.

Thank you for the help!

- Florian


My Setup:

  ruby 1.9.2 on the desktop (Archlinux),
  ruby 1.9.3 on the laptop (Fedora 17)
  - both compiled with RVM

  smokegen, smokeqt and qtruby compiled from latest (yesterday) git


##################
### BACKTRACE: ###
##################

/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2731:
[BUG] cfp consistency error - call0
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

-- control frame ----------
c:0015 p:---- s:0068 b:0068 l:000067 d:000067 CFUNC  :to_s
c:0014 p:0047 s:0066 b:0062 l:000052 d:000061 BLOCK
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2731
c:0013 p:---- s:0058 b:0058 l:000057 d:000057 FINISH
c:0012 p:---- s:0056 b:0056 l:000055 d:000055 CFUNC  :each
c:0011 p:0555 s:0053 b:0053 l:000052 d:000052 METHOD
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2729
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 FINISH
c:0009 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC  :method_missing
c:0008 p:0043 s:0026 b:0026 l:000025 d:000025 METHOD
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:177
c:0007 p:0011 s:0022 b:0022 l:000021 d:000021 METHOD test.rb:64
c:0006 p:---- s:0017 b:0017 l:000016 d:000016 FINISH
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC  :method_missing
c:0004 p:0013 s:0011 b:0011 l:000010 d:000010 METHOD
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:469
c:0003 p:0320 s:0008 b:0008 l:0011a8 d:002578 EVAL   test.rb:390
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0011a8 d:0011a8 TOP
---------------------------
-- Ruby level backtrace information
----------------------------------------
test.rb:390:in `<main>'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:469:in
`exec'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:469:in
`method_missing'
test.rb:64:in `eventFilter'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:177:in
`=='
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:177:in
`method_missing'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2729:in
`do_method_missing'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2729:in
`each'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2731:in
`block in do_method_missing'
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2731:in
`to_s'

-- C level backtrace information
-------------------------------------------
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_vm_bugreport+0x61)
[0x7f83d8ca1541]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x62014)
[0x7f83d8b8d014]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_bug+0xa5)
[0x7f83d8b8dd75]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d433)
[0x7f83d8c98433]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_funcall+0xb5)
[0x7f83d8c98e95]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_obj_as_string+0x2e)
[0x7f83d8c4898e]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x165605)
[0x7f83d8c90605]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16beed)
[0x7f83d8c96eed]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_yield+0x47)
[0x7f83d8c9c017]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_ary_each+0x46)
[0x7f83d8b5ed26]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16fc0e)
[0x7f83d8c9ac0e]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x166018)
[0x7f83d8c91018]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16beed)
[0x7f83d8c96eed]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d353)
[0x7f83d8c98353]
/usr/local/lib/libqtruby4shared.so.2(_Z20class_method_missingiPmm+0x1c9)
[0x7f83d373e092]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so(+0x1ec90)
[0x7f83d7452c90]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16fc0e)
[0x7f83d8c9ac0e]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x166018)
[0x7f83d8c91018]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16beed)
[0x7f83d8c96eed]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d353)
[0x7f83d8c98353]
/usr/local/lib/libqtruby4shared.so.2(_ZN6QtRuby17VirtualMethodCall10callMethodEv+0x195)
[0x7f83d3785621]
/usr/local/lib/libqtruby4shared.so.2(_ZN6QtRuby14MethodCallBase4nextEv+0xce)
[0x7f83d3785220]
/usr/local/lib/libqtruby4shared.so.2(_ZN6QtRuby7Binding10callMethodEsPvPN5Smoke9StackItemEb+0x411)
[0x7f83d3739ca7]
/usr/local/lib/libsmokeqtgui.so.3(_ZN12__smokeqtgui9x_QWidget11eventFilterEP7QObjectP6QEvent+0x53)
[0x7f83d52ba291]
/usr/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate29sendThroughObjectEventFiltersEP7QObjectP6QEvent+0x86)
[0x7f83d709abc6]
/usr/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x7c)
[0x7f83d644af4c]
/usr/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x13a)
[0x7f83d644f3fa]
/usr/local/lib/libsmokeqtgui.so.3(_ZN12__smokeqtgui14x_QApplication6notifyEP7QObjectP6QEvent+0x74)
[0x7f83d5044e64]
/usr/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x8e)
[0x7f83d709aa5e]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x5b4)
[0x7f83d6496354]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x56f)
[0x7f83d6496e4f]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x3b4)
[0x7f83d6496c94]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x145)
[0x7f83d6495ee5]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x56f)
[0x7f83d6496e4f]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x145)
[0x7f83d6495ee5]
/usr/lib/libQtGui.so.4(+0x3def28) [0x7f83d665ff28]
/usr/lib/libQtGui.so.4(_ZN14QWidgetPrivate16syncBackingStoreEv+0x80)
[0x7f83d648b640]
/usr/lib/libQtGui.so.4(_ZN7QWidget5eventEP6QEvent+0xddc) [0x7f83d649ac8c]
/usr/lib/libQtGui.so.4(_ZN11QMainWindow5eventEP6QEvent+0x6b)
[0x7f83d685e3eb]
/usr/local/lib/libsmokeqtgui.so.3(_ZN12__smokeqtgui13x_QMainWindow5eventEP6QEvent+0x64)
[0x7f83d5162fa0]
/usr/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0xac)
[0x7f83d644af7c]
/usr/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x13a)
[0x7f83d644f3fa]
/usr/local/lib/libsmokeqtgui.so.3(_ZN12__smokeqtgui14x_QApplication6notifyEP7QObjectP6QEvent+0x74)
[0x7f83d5044e64]
/usr/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x8e)
[0x7f83d709aa5e]
/usr/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x421)
[0x7f83d709e3c1]
/usr/lib/libQtCore.so.4(+0x1a4ac3) [0x7f83d70c8ac3]
/usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x135) [0x7f83d2b234a5]
/usr/lib/libglib-2.0.so.0(+0x477d8) [0x7f83d2b237d8]
/usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x34) [0x7f83d2b23894]
/usr/lib/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x66)
[0x7f83d70c8c56]
/usr/lib/libQtGui.so.4(+0x26a2fe) [0x7f83d64eb2fe]
/usr/lib/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x2f)
[0x7f83d70997af]
/usr/lib/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x138)
[0x7f83d7099a38]
/usr/lib/libQtCore.so.4(_ZN16QCoreApplication4execEv+0x88)
[0x7f83d709e6d8]
/usr/local/lib/libsmokeqtgui.so.3(_ZN12__smokeqtgui14x_QApplication4x_88EPN5Smoke9StackItemE+0x11)
[0x7f83d5043f5b]
/usr/local/lib/libsmokeqtgui.so.3(_ZN12__smokeqtgui18xcall_QApplicationEsPvPN5Smoke9StackItemE+0x694)
[0x7f83d503b05e]
/usr/local/lib/libqtruby4shared.so.2(_ZN6QtRuby10MethodCall10callMethodEv+0x21e)
[0x7f83d3786920]
/usr/local/lib/libqtruby4shared.so.2(_ZN6QtRuby14MethodCallBase4nextEv+0xce)
[0x7f83d3785220]
/usr/local/lib/libqtruby4shared.so.2(_Z14method_missingiPmm+0x10fe)
[0x7f83d373dd10]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16fc0e)
[0x7f83d8c9ac0e]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x166018)
[0x7f83d8c91018]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16beed)
[0x7f83d8c96eed]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_iseq_eval_main+0xb1)
[0x7f83d8c9c921]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x68002)
[0x7f83d8b93002]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(ruby_exec_node+0x1d)
[0x7f83d8b93dbd]
/home/florian/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(ruby_run_node+0x1e)
[0x7f83d8b95dee]
ruby(main+0x4b) [0x4008db]
/lib/libc.so.6(__libc_start_main+0xf5) [0x7f83d7c57455]
ruby() [0x400909]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension
libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted


More information about the Kde-bindings mailing list