[Kde-bindings] Segfault after traceback
Han Holl
han.holl at pobox.com
Sun Oct 10 20:16:31 UTC 2004
On Sunday 10 October 2004 21:48, Richard Dale wrote:
> On Sunday 10 October 2004 19:39, Han Holl wrote:
> > Hi Richard,
> >
> > I've tried to create a simpler example, but it didn't work.
> > Unpack this archive, run gotocelldialog.rb, and click on any field.
> > You get (at least I get):
> > ./palgaedit.rb:43:in `method_missing': undefined method `visible' for
> > #<PalgaEdit:0x431c21d0> (NoMethodError)
> > from ./palgaedit.rb:43:in `focusInEvent'
> > from gotocelldialog.rb:151:in `method_missing'
> > from gotocelldialog.rb:151
> > ./palgaedit.rb:70: [BUG] Segmentation fault
> > ruby 1.8.1 (2004-03-08) [i686-linux-gnu]
> >
> > Aborted
> >
> > I used Qt::Widget#visible instead of isVisible.
> > It might be an idea to translate ruby functions like
> > visible? to isVisible ? Looks more rubyish.
>
> QtRuby already does, but setVisible() is the same as 'visible?', not
> 'visible'. It should be this:
>
> STDERR.puts "focusin #{@rubid} #{self.class} #{self.parent.class}
> V:#{self.visible?}"
>
Ah, I had missed the visible? translation to isVisible, but I knew that
calling visible was an error, and I'm not aware that I'm catching an
exception and carry on anyway. There are only three rescues in my code, and
each and everyone does a raise after giving some extra information:
grep -4 rescue *.rb
gotocelldialog.rb- if lastr > last
gotocelldialog.rb- scr.addMultiCellWidget(edit,
gotocelldialog.rb- *checkcells( row, last, lastr - 1))
gotocelldialog.rb- end
gotocelldialog.rb: rescue
gotocelldialog.rb-
gotocelldialog.rb- puts el
gotocelldialog.rb- raise
gotocelldialog.rb- end
--
palgaedit.rb- begin
palgaedit.rb- @len = attr['leng'].to_i
palgaedit.rb- @len = 4 if @len == 0
palgaedit.rb- @rubid = attr['rnum'] || attr['id']
palgaedit.rb: rescue
palgaedit.rb- attr.each do |n, v|
palgaedit.rb- STDERR.puts "#{n}: #{v}"
palgaedit.rb- end
palgaedit.rb- raise
--
tabel.rb- REXML::XPath.each(container, 'descendant::item') do |item|
tabel.rb- attrs = item.attributes
tabel.rb- begin
tabel.rb- a = @fields[i] = PalgaEdit.new(attrs,self, attrs['title'])
tabel.rb: rescue
tabel.rb- container.attributes.each do |k,v|
tabel.rb- puts "YYY: #{k} #{v}"
tabel.rb- end
tabel.rb- raise
Also the address of the segmentation fault is phony.
Cheers,
Han Holl
More information about the Kde-bindings
mailing list