[Kde-bindings] Segfault (as promised)

Han Holl han.holl at pobox.com
Sun Oct 3 09:29:17 UTC 2004


Hi Richard,

Here's an example of a segfault caused by a _very_ simple programming error:

require 'Qt'

class Segdemo < Qt::Widget
  def initialize(*k)
      super(*k)
# The next line should be:  lay = Qt::HBoxLayout.new(self)
      lay = Qt::HBoxLayout
      ed = Qt::LineEdit.new('blah',self)
      lay.addWidget(ed)
  end
end

if $0 == __FILE__
    a = Qt::Application.new(ARGV)
    w = Segdemo.new
    a.mainWidget = w
    w.show
    a.exec
end

On my system: Linux RH9, ruby-1.8.1, gcc 3.2.2, qtruby-cvs-2004-09-13, 
qt-3.1.1 this produces:

client.rb:9: [BUG] Segmentation fault
ruby 1.8.1 (2004-03-08) [i686-linux-gnu]

Aborted

I would have expected a NoMethodError for Qt::HBoxLayout:Class

If you need anything else please let me know.

Cheers,

Han Holl




More information about the Kde-bindings mailing list