This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problems with Ruby Plasmoid

Tags: None
(comma "," separated)
jaenz
Registered Member
Posts
2
Karma
0
OS

Problems with Ruby Plasmoid

Mon Nov 16, 2009 8:06 pm
Hey,

trying my luck with writing a Ruby Plasmoid. This is the source so far:
Code: Select all
require 'plasma_applet'
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'

module Movies
  class Main < PlasmaScripting::Applet
    @moviesList = ""
   
    def initialize parent
      super parent
    end
 
    def fetchList
        unless @moviesList
     content = ""
     source = "http://linkto/rss.xml"
     open(source) do |s| content = s.read end
     @moviesList = RSS::Parser.parse(content, false)
     puts "bo" + fetchList.channel.description
     return @moviesList
   else
     return @moviesList
   end
    end
   
    def init
      self.has_configuration_interface = false
      self.aspect_ratio_mode = Plasma::Square
      self.background_hints = Plasma::Applet.DefaultBackground
 
      layout = Qt::GraphicsLinearLayout.new Qt::Horizontal, self
      label = Plasma::Label.new self
      label.text = "heyho"
      layout.add_item label
      self.layout = layout
 
      end
  end
end


This runs smoothly, since I don't call the fetchList method. Once I do that, it quits unexpected and I can't find any useful error messages. I attached the traceroute of the seg-fault.

Is anyone experienced with this?


Application: Plasma Widget Viewer (plasmoidviewer), signal: Segmentation fault
[KCrash Handler]
#5 0x00007f006c77032f in QGraphicsItem::childItems() const () from /usr/lib/libQtGui.so.4
#6 0x00007f0055266ce5 in ?? () from /usr/lib/libqtruby4shared.so.2
#7 0x00007f005528b7ee in smokeruby_mark(void*) () from /usr/lib/libqtruby4shared.so.2
#8 0x00007f005599609f in ?? () from /usr/lib/libruby1.8.so.1.8
#9 0x00007f0055996902 in ?? () from /usr/lib/libruby1.8.so.1.8
#10 0x00007f0055997347 in rb_newobj () from /usr/lib/libruby1.8.so.1.8
#11 0x00007f00559b5d68 in rb_node_newnode () from /usr/lib/libruby1.8.so.1.8
#12 0x00007f00559bcba4 in ruby_yyparse () from /usr/lib/libruby1.8.so.1.8
#13 0x00007f00559c517b in ?? () from /usr/lib/libruby1.8.so.1.8
#14 0x00007f00559db991 in ?? () from /usr/lib/libruby1.8.so.1.8
#15 0x00007f005598f82f in rb_load () from /usr/lib/libruby1.8.so.1.8
#16 0x00007f005598ffd2 in rb_require_safe () from /usr/lib/libruby1.8.so.1.8
#17 0x00007f0055982021 in ?? () from /usr/lib/libruby1.8.so.1.8
#18 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#19 0x00007f005597ed3f in ?? () from /usr/lib/libruby1.8.so.1.8
#20 0x00007f005598f8a3 in rb_load () from /usr/lib/libruby1.8.so.1.8
#21 0x00007f005598ffd2 in rb_require_safe () from /usr/lib/libruby1.8.so.1.8
#22 0x00007f0055982021 in ?? () from /usr/lib/libruby1.8.so.1.8
#23 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#24 0x00007f005597ed3f in ?? () from /usr/lib/libruby1.8.so.1.8
#25 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#26 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#27 0x00007f005597f021 in ?? () from /usr/lib/libruby1.8.so.1.8
#28 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#29 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#30 0x00007f005597f021 in ?? () from /usr/lib/libruby1.8.so.1.8
#31 0x00007f00559802f7 in ?? () from /usr/lib/libruby1.8.so.1.8
#32 0x00007f005598c37b in ?? () from /usr/lib/libruby1.8.so.1.8
#33 0x00007f0055982021 in ?? () from /usr/lib/libruby1.8.so.1.8
#34 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#35 0x00007f005597ed3f in ?? () from /usr/lib/libruby1.8.so.1.8
#36 0x00007f005597f966 in ?? () from /usr/lib/libruby1.8.so.1.8
#37 0x00007f005597cbf6 in ?? () from /usr/lib/libruby1.8.so.1.8
#38 0x00007f005597d646 in ?? () from /usr/lib/libruby1.8.so.1.8
#39 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#40 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#41 0x00007f005597ed3f in ?? () from /usr/lib/libruby1.8.so.1.8
#42 0x00007f005597cbf6 in ?? () from /usr/lib/libruby1.8.so.1.8
#43 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#44 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#45 0x00007f005597f021 in ?? () from /usr/lib/libruby1.8.so.1.8
#46 0x00007f005598ccfc in ?? () from /usr/lib/libruby1.8.so.1.8
#47 0x00007f005597df65 in ?? () from /usr/lib/libruby1.8.so.1.8
#48 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#49 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#50 0x00007f005597f021 in ?? () from /usr/lib/libruby1.8.so.1.8
#51 0x00007f005598ccfc in ?? () from /usr/lib/libruby1.8.so.1.8
#52 0x00007f005597df65 in ?? () from /usr/lib/libruby1.8.so.1.8
#53 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#54 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#55 0x00007f005597ed3f in ?? () from /usr/lib/libruby1.8.so.1.8
#56 0x00007f005597f966 in ?? () from /usr/lib/libruby1.8.so.1.8
#57 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#58 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#59 0x00007f005597c519 in ?? () from /usr/lib/libruby1.8.so.1.8
#60 0x00007f005597c32c in ?? () from /usr/lib/libruby1.8.so.1.8
#61 0x00007f005597c32c in ?? () from /usr/lib/libruby1.8.so.1.8
#62 0x00007f005597d9b2 in ?? () from /usr/lib/libruby1.8.so.1.8
#63 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#64 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#65 0x00007f005597f021 in ?? () from /usr/lib/libruby1.8.so.1.8
#66 0x00007f0055981ec3 in ?? () from /usr/lib/libruby1.8.so.1.8
#67 0x00007f0055982213 in ?? () from /usr/lib/libruby1.8.so.1.8
#68 0x00007f0055982b20 in rb_funcall2 () from /usr/lib/libruby1.8.so.1.8
#69 0x00007f00559782b9 in rb_protect () from /usr/lib/libruby1.8.so.1.8
#70 0x00007f00552947f0 in QtRuby::VirtualMethodCall::callMethod() () from /usr/lib/libqtruby4shared.so.2
#71 0x00007f00552935b7 in QtRuby::MethodCallBase::next() () from /usr/lib/libqtruby4shared.so.2
#72 0x00007f005525d5b1 in QtRuby::Binding::callMethod(short, void*, Smoke::StackItem*, bool) () from /usr/lib/libqtruby4shared.so.2
#73 0x00007f0054fd0a40 in ?? () from /usr/lib/libsmokeplasma.so.2
#74 0x00007f006ccb4b83 in Plasma::Applet::init() () from /usr/lib/libplasma.so.3
#75 0x00007f006ccc9564 in Plasma::Containment::addApplet(Plasma::Applet*, QPointF const&, bool) () from /usr/lib/libplasma.so.3
#76 0x00000000004061f3 in _start ()
User avatar
dpalacio
Registered Member
Posts
240
Karma
2
OS

Re: Problems with Ruby Plasmoid

Mon Nov 16, 2009 11:15 pm
What version of KDE are you using? Can you install Qt's, KDE's and Ruby's debug symbols and report a bug? (or send a mail to kde-bindings)

Possible workarounds:

* Create all child items in member variables. i.e.
@layout = Qt::GraphicsLinearLayout.new Qt::Horizontal, self
@label = Plasma::Label.new self

* If everything else fails, add in the beginning of the file:
GC.disable


connect(post, SIGNAL(readSignature()), qapp, SLOT(quit()));
jaenz
Registered Member
Posts
2
Karma
0
OS

Re: Problems with Ruby Plasmoid

Wed Nov 18, 2009 3:39 pm
Hey,

thanks for the reply! GC.disable solves the probelm.
So it's a bug in garbage collection, so it would be useful if I would be able to install the dbg packages - correct? :D

I'm running Kubuntu 9.10 and don't know, which packages I should install.
User avatar
dpalacio
Registered Member
Posts
240
Karma
2
OS

Re: Problems with Ruby Plasmoid

Wed Nov 18, 2009 6:56 pm
Install kdelibs5-dbg libqt4-dbg libruby1.8-dbg. With GC enabled run the plasmoid. Then mail kde-bindings @ kde.org with the KDE version, source code and backtrace.


connect(post, SIGNAL(readSignature()), qapp, SLOT(quit()));


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]