Ruby Bindings Animator problem

0xDeadC0de roguestar191 at comcast.net
Wed Jan 7 11:02:36 CET 2009


hmm

All I know that makes it special is the animator is a singleton class,
the self() function returns the instance and probably allocates a new
one


Lots here, First the results of the test app, then the test app below it

Along with what debugging info I could get ..,, sorry my symbols are
incomplete.

Results:

RubyAppletScript::Applet#init
mainScript: /home/deadc0de/.kde/share/apps/plasma/plasmoids/ruby-welcome/contents/code/main.rb                                     
RubyAppletScript::Applet#init instantiating:
RubyWelcome::Main                                                                                                   
getPointerObject 0x893b5b8 ->
nil                                                                                                                                
allocating Qt::Label 0x893b5b8 ->
0xa8a89b7c                                                                                                                     

getPointerObject 0x8bb21f8 -> 0xa8a9c6dc
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x89c11a0 -> nil       
allocating Plasma::Applet 0x89c11a0 -> 0xa8a877f0

getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8bb21f8 -> 0xa8a9c6dc
getPointerObject 0x8bb21f8 -> 0xa8a9c6dc
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0xbfd8ff24 -> nil      
allocating Qt::Painter 0xbfd8ff24 -> 0xa8a86fbc

getPointerObject 0xbfd8fae4 -> nil
allocating Qt::StyleOptionGraphicsItem 0xbfd8fae4 -> 0xa8a86f94

getPointerObject 0xbfd8f910 -> nil
copying Qt::Rect 0xbfd8f910 to 0x8944c80

allocating Qt::Rect 0x8944c80 -> 0xa8a86f44

getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0xbfd8fff4 -> nil      
allocating Qt::Painter 0xbfd8fff4 -> 0xa8a86eb8

getPointerObject 0xbfd8fbb4 -> nil
allocating Qt::StyleOptionGraphicsItem 0xbfd8fbb4 -> 0xa8a86e90

getPointerObject 0xbfd8f9e0 -> nil
copying Qt::Rect 0xbfd8f9e0 to 0x8b997a0

allocating Qt::Rect 0x8b997a0 -> 0xa8a86e68

getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0xbfd8fff4 -> nil      
allocating Qt::Painter 0xbfd8fff4 -> 0xa8a86e04

getPointerObject 0xbfd8fbb4 -> nil
allocating Qt::StyleOptionGraphicsItem 0xbfd8fbb4 -> 0xa8a86be8

getPointerObject 0xbfd8f9e0 -> nil
copying Qt::Rect 0xbfd8f9e0 to 0x8bbf150

allocating Qt::Rect 0x8bbf150 -> 0xa8a86bc0

getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0xbfd8fff4 -> nil      
allocating Qt::Painter 0xbfd8fff4 -> 0xa8a86b84

getPointerObject 0xbfd8fbb4 -> nil
allocating Qt::StyleOptionGraphicsItem 0xbfd8fbb4 -> 0xa8a86b48

getPointerObject 0xbfd8f9e0 -> nil
copying Qt::Rect 0xbfd8f9e0 to 0x8bbc600

allocating Qt::Rect 0x8bbc600 -> 0xa8a86af8

getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0xbfd8fff4 -> nil      
allocating Qt::Painter 0xbfd8fff4 -> 0xa8a86abc

getPointerObject 0xbfd8fbb4 -> nil
allocating Qt::StyleOptionGraphicsItem 0xbfd8fbb4 -> 0xa8a86a94

getPointerObject 0xbfd8f9e0 -> nil
copying Qt::Rect 0xbfd8f9e0 to 0x8bbe128

allocating Qt::Rect 0x8bbe128 -> 0xa8a86a6c

getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893ad88 -> 0xa8a8a784
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8b91518 -> 0xa8aaa6b0
getPointerObject 0x893b5d8 -> 0xa8a89f8c
getPointerObject 0x8bb21f8 -> 0xa8a9c6dc
getPointerObject 0x8bb21f8 -> 0xa8a9c6dc
getPointerObject 0x891f478 -> nil
allocating Plasma::Animator 0x891f478 -> 0xa8a86350

KCrash: Application 'plasmoidviewer' crashing...
sock_file=/home/deadc0de/.kde/socket-deadc0de-laptop/kdeinit4__0


Test app:

require 'korundum4'
require 'Qt4'
require 'plasma_applet'
module RubyWelcome
   class Main < PlasmaScripting::Applet
        slots 'linkHovered()'
        def initialize(par, opt=nil)
                @top = par
                super(par, opt)
        end
        def init
                @layout = Qt::GraphicsLinearLayout.new(Qt::Vertical,
self)
                @Label = Plasma::Label.new()
                Qt::Internal::setDebug Qt::QtDebugChannel::QTDB_GC
                Qt::Object.connect(@Label.nativeWidget,
SIGNAL('linkHovered(QString)'), self, SLOT('linkHovered()'))
                @Label.text = '<html><body><a
href="www.kde.org">www.kde.org</a></body></html>'
                @layout.addItem(@Label)
        end
        def linkHovered()
                Plasma::Animator.self().animateElement(@Label,
Plasma::Animator::ActivateAnimation) # Note both animateElement and
animateItem behave the same
        end
   end
end








Thread 1 (Thread 0xb45a86e0 (LWP 27500)):

#0 0xb7fda430 in __kernel_vsyscall ()

#1 0xb6a4cdc0 in nanosleep () from /lib/tls/i686/cmov/libc.so.6

#2 0xb6a4cbfe in sleep () from /lib/tls/i686/cmov/libc.so.6

#3 0xb7e536f2 in KCrash::startDrKonqi (argv=0xbf8d5114, argc=17)
at /build/buildd/kde4libs-4.1.85/kdeui/util/kcrash.cpp:412

#4 0xb7e540f4 in KCrash::defaultCrashHandler (sig=11)
at /build/buildd/kde4libs-4.1.85/kdeui/util/kcrash.cpp:337

#5 <signal handler called>

#6 0xb7acfa60 in Plasma::Animator::animateElement ()
from /usr/lib/libplasma.so.3

#7 0xa92fac01 in ?? () from /usr/lib/libsmokeplasma.so.2

#8 0xa93a4ba7 in ?? () from /usr/lib/libqtruby4shared.so.2

#9 0xa93a24f8 in QtRuby::MethodCallBase::next ()
from /usr/lib/libqtruby4shared.so.2

#10 0xa936c484 in method_missing () from /usr/lib/libqtruby4shared.so.2

#11 0xa93d8050 in call_cfunc (func=0xa936c080 <method_missing(int,
unsigned long*, unsigned long)>, recv=2821980260, len=155285984, argc=3,
argv=0x93dd730) at eval.c:5749

#12 0xa93e387e in rb_call0 (klass=3002658280, recv=2821980260, id=4057,
oid=4057, argc=3, argv=0xbf8d5c50, body=0xb2f8ecbc, flags=0) at
eval.c:5904

#13 0xa93e3a1a in rb_call (klass=3002658280, recv=2821980260, mid=4057,
argc=3, argv=0xbf8d5c50, scope=1, self=6) at eval.c:6151

#14 0xa93e4403 in rb_funcall2 (recv=155285984, mid=4057, argc=3,
argv=0xbf8d5c50) at eval.c:6287

#15 0xa93ea3d4 in method_missing (obj=2821980260, id=6103310, argc=2,
argv=0xbf8d5d40, call_status=0) at eval.c:5729

#16 0xa93e3ac6 in rb_call (klass=2829318220, recv=2821980260, mid=23841,
argc=2, argv=0xbf8d5d40, scope=0, self=2829269420) at eval.c:6130

#17 0xa93de021 in rb_eval (self=2829269420, n=<value optimized out>) at
eval.c:3492

#18 0xa93e3781 in rb_call0 (klass=2829756920, recv=2829269420, id=23833,
oid=23833, argc=0, argv=0x9a7f5c8, body=0xa8acc51c, flags=0) at
eval.c:6055

#19 0xa93e3a1a in rb_call (klass=2829756920, recv=2829269420, mid=23833,
argc=0, argv=0x9a7f5c8, scope=1, self=6) at eval.c:6151

#20 0xa93e4403 in rb_funcall2 (recv=155285984, mid=23833, argc=0,
argv=0x9a7f5c8) at eval.c:6287

#21 0xa93a241b in ?? () from /usr/lib/libqtruby4shared.so.2

#22 0xa93d9a61 in rb_protect (proc=0xa93a23e0, data=2829269420,
state=0xbf8d66a0) at eval.c:5526

#23 0xa93a4251 in QtRuby::InvokeSlot::invokeSlot ()
from /usr/lib/libqtruby4shared.so.2

#24 0xa93a435d in QtRuby::InvokeSlot::mainfunction ()
from /usr/lib/libqtruby4shared.so.2

#25 0xa93a24ac in QtRuby::SigSlotBase::next ()
from /usr/lib/libqtruby4shared.so.2

#26 0xb2fed172 in ?? () from /usr/lib/ruby/1.8/i486-linux/qtruby4.so

#27 0xa93d8050 in call_cfunc (func=0xbf8d67a4, recv=162231088,
len=155285984, argc=3, argv=0x93dd730) at eval.c:5749

#28 0xa93e387e in rb_call0 (klass=2829756920, recv=2829269420, id=23265,
oid=23265, argc=3, argv=0xbf8d6dd0, body=0xa8aaa78c, flags=0) at
eval.c:5904

#29 0xa93e3a1a in rb_call (klass=2829756920, recv=2829269420, mid=23265,
argc=3, argv=0xbf8d6dd0, scope=1, self=6) at eval.c:6151

#30 0xa93e4403 in rb_funcall2 (recv=155285984, mid=23265, argc=3,
argv=0xbf8d6dd0) at eval.c:6287

#31 0xa93a241b in ?? () from /usr/lib/libqtruby4shared.so.2

#32 0xa93d9a61 in rb_protect (proc=0xa93a23e0, data=2829269420,
state=0xbf8d6d54) at eval.c:5526

#33 0xa93a313b in QtRuby::VirtualMethodCall::callMethod ()
from /usr/lib/libqtruby4shared.so.2

#34 0xa93a24f8 in QtRuby::MethodCallBase::next ()
from /usr/lib/libqtruby4shared.so.2

#35 0xa936912e in QtRuby::Binding::callMethod ()
from /usr/lib/libqtruby4shared.so.2

#36 0xa931e035 in ?? () from /usr/lib/libsmokeplasma.so.2

#37 0xb6d8ea60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4

#38 0xb6d8f7e2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4

#39 0xb75d2393 in QLabel::linkHovered () from /usr/lib/libQtGui.so.4

#40 0xb75d24b7 in ?? () from /usr/lib/libQtGui.so.4

#41 0xb75d62c5 in QLabel::qt_metacall () from /usr/lib/libQtGui.so.4

#42 0xb6d8ea60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4

#43 0xb6d8f7e2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4

#44 0xb74328b3 in QTextControl::linkHovered ()
from /usr/lib/libQtGui.so.4

#45 0xb74398ec in ?? () from /usr/lib/libQtGui.so.4

#46 0xb743f279 in QTextControl::processEvent ()
from /usr/lib/libQtGui.so.4

#47 0xb7434c4d in QTextControl::processEvent ()
from /usr/lib/libQtGui.so.4

#48 0xb75d2d76 in ?? () from /usr/lib/libQtGui.so.4

#49 0xb72977cb in QWidget::event () from /usr/lib/libQtGui.so.4

#50 0xb75cefd3 in QFrame::event () from /usr/lib/libQtGui.so.4

#51 0xb75d4579 in QLabel::event () from /usr/lib/libQtGui.so.4

#52 0xb723f8ec in QApplicationPrivate::notify_helper ()
from /usr/lib/libQtGui.so.4

#53 0xb72480e1 in QApplication::notify () from /usr/lib/libQtGui.so.4

#54 0xb7dded3d in KApplication::notify (this=0xbf8d91b0,
receiver=0x979a128, event=0x9a80858)
at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307

#55 0xb6d79e61 in QCoreApplication::notifyInternal ()
from /usr/lib/libQtCore.so.4

#56 0xb724736e in QApplicationPrivate::sendMouseEvent ()
from /usr/lib/libQtGui.so.4

#57 0xb780fad7 in ?? () from /usr/lib/libQtGui.so.4

#58 0xb781017f in ?? () from /usr/lib/libQtGui.so.4

#59 0xb7810284 in QGraphicsProxyWidget::hoverMoveEvent ()
from /usr/lib/libQtGui.so.4

#60 0xb77bc04c in QGraphicsItem::sceneEvent ()
from /usr/lib/libQtGui.so.4

#61 0xb77ff7af in QGraphicsWidget::sceneEvent ()
from /usr/lib/libQtGui.so.4

#62 0xb77da54c in ?? () from /usr/lib/libQtGui.so.4

#63 0xb77dba2a in ?? () from /usr/lib/libQtGui.so.4

#64 0xb77e32d1 in ?? () from /usr/lib/libQtGui.so.4

#65 0xb77e35af in QGraphicsScene::mouseMoveEvent ()
from /usr/lib/libQtGui.so.4

#66 0xb77e37c7 in QGraphicsScene::event () from /usr/lib/libQtGui.so.4

#67 0xb723f8ec in QApplicationPrivate::notify_helper ()
from /usr/lib/libQtGui.so.4

#68 0xb724772e in QApplication::notify () from /usr/lib/libQtGui.so.4

#69 0xb7dded3d in KApplication::notify (this=0xbf8d91b0,
receiver=0xbf8d916c, event=0xbf8d8150)
at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307

#70 0xb6d79e61 in QCoreApplication::notifyInternal ()
from /usr/lib/libQtCore.so.4

#71 0xb77f0d88 in ?? () from /usr/lib/libQtGui.so.4

#72 0xb77f9316 in QGraphicsView::mouseMoveEvent ()
from /usr/lib/libQtGui.so.4

#73 0xb72977cb in QWidget::event () from /usr/lib/libQtGui.so.4

#74 0xb75cefd3 in QFrame::event () from /usr/lib/libQtGui.so.4

#75 0xb76657df in QAbstractScrollArea::viewportEvent ()
from /usr/lib/libQtGui.so.4

#76 0xb77f2d0f in QGraphicsView::viewportEvent ()
from /usr/lib/libQtGui.so.4

#77 0xb7667d85 in ?? () from /usr/lib/libQtGui.so.4

#78 0xb6d7904a in QCoreApplicationPrivate::sendThroughObjectEventFilters
() from /usr/lib/libQtCore.so.4

#79 0xb723f8ca in QApplicationPrivate::notify_helper ()
from /usr/lib/libQtGui.so.4

#80 0xb72480e1 in QApplication::notify () from /usr/lib/libQtGui.so.4

#81 0xb7dded3d in KApplication::notify (this=0xbf8d91b0,
receiver=0x93a9090, event=0xbf8d8808)
at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307

#82 0xb6d79e61 in QCoreApplication::notifyInternal ()
from /usr/lib/libQtCore.so.4

#83 0xb724736e in QApplicationPrivate::sendMouseEvent ()
from /usr/lib/libQtGui.so.4

#84 0xb72b1656 in ?? () from /usr/lib/libQtGui.so.4

#85 0xb72b09e5 in QApplication::x11ProcessEvent ()
from /usr/lib/libQtGui.so.4

#86 0xb72da7aa in ?? () from /usr/lib/libQtGui.so.4

#87 0xb58746f8 in g_main_context_dispatch ()
from /usr/lib/libglib-2.0.so.0

#88 0xb5877da3 in ?? () from /usr/lib/libglib-2.0.so.0

#89 0xb5877f61 in g_main_context_iteration ()
from /usr/lib/libglib-2.0.so.0

#90 0xb6da4478 in QEventDispatcherGlib::processEvents ()
from /usr/lib/libQtCore.so.4

#91 0xb72d9ea5 in ?? () from /usr/lib/libQtGui.so.4

#92 0xb6d7852a in QEventLoop::processEvents ()
from /usr/lib/libQtCore.so.4

#93 0xb6d786ea in QEventLoop::exec () from /usr/lib/libQtCore.so.4

#94 0xb6d7ada5 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4

#95 0xb723f767 in QApplication::exec () from /usr/lib/libQtGui.so.4

#96 0x0804ee7b in main (argc=2, argv=0xbf8d9554)
at /build/buildd/kdebase-workspace-4.1.85/plasma/shells/plasmoidviewer/main.cpp:157

#0 0xb7fda430 in __kernel_vsyscall ()






On Tue, 2009-01-06 at 13:23 +0000, Richard Dale wrote:
> 
> 
> On Tue, Jan 6, 2009 at 5:38 AM, 0xDeadC0de <roguestar191 at comcast.net>
> wrote:
>         I was hopeing someone (Rdale maybe? ;) could help me with this
>         one, when I try:
>         
>         class GloweyLabel < Plasma::Label
>                slots   'linkHovered()',
>                def initialize(par=nil)
>                        super nil
>                        Qt::Object.connect(self.nativeWidget,
>         SIGNAL("linkHovered(QString)"), self, SLOT("linkHovered()") )
>                end
>                def linkHovered()
>                        puts 'link hovered'
>                        Plasma::Animator.self.animateElement(self,
>         Plasma::Animator::ActivateAnimation)
>                end
>         end
>         
>         It crashes quickly after a linkHovered event. hmm
>         
>         Trying to get any kind of animation on the label when a link
>         is hovered in it
> This is probably a garbage collection issue. Try adding 'GC.disable'
> to the constructor for the applet and see if that makes a difference.
> When you create a widget, always pass it a parent as the qtruby
> runtime uses trees of QObjects/QWidgets to determine what instances
> can be allowed to be GC'd. If an instance doesn't have a parent it
> will be GC'd if there are no corresponding instances left in the Ruby
> world. You may need to change some variables to be instance variables
> to avoid the instances being GC'd - ie 'foobar' becomes '@foobar' in
> your code.
> 
> If it is GC problem and adding parent widgets doesn't fix it, you can
> turn on GC tracing like this:
> 
> Qt::Internal::setDebug Qt::QtDebugChannel::QTDB_GC
> 
> -- Richard 
> 
> 
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel



More information about the Plasma-devel mailing list