From: Joel VanderWerf Date: 2002-10-30T12:02:18+09:00 Subject: bug in Fox or in Ruby? This is a multi-part message in MIME format. --------------020300080208060109000905 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit If I run this and press the "Pow!" button twice, I get a segfault. I've tried whittling the example down, but everything seems to play a role... Turning off GC prevents it, so it may be that something's not getting marked correctly. Versions: FXRuby 1.0.13 Fox 1.0.11 Ruby 1.6.7 Mandrake-Linux 8.1 --------------020300080208060109000905 Content-Type: text/plain; name="bug.rb" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bug.rb" #!/usr/bin/env ruby require "fox" include Fox if false puts "disabling GC" GC.disable ### prevents SEGFAULT end class BugWindow < FXMainWindow include Responder def initialize(app) super(app, "Bug", nil, nil, DECOR_ALL, 0, 0, 0, 0) splitter = FXSplitter.new(self, (LAYOUT_SIDE_TOP|LAYOUT_FILL_X| LAYOUT_FILL_Y| SPLITTER_TRACKING|SPLITTER_VERTICAL|SPLITTER_REVERSED)) contents = FXHorizontalFrame.new(splitter, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) table_frame = FXHorizontalFrame.new(contents, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y) @table = FXTable.new(table_frame, 0, 0, nil, 0, TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 2,2,2,2) @table.disable @table.setFont(FXFont.new(getApp(), "courier", 9, FONTWEIGHT_LIGHT)) FXButton.new(splitter, "&Pow!", nil, self). connect(SEL_COMMAND, method(:onPow)) end def onPow(sender, sel, index) foo ### this seems to be necessary for SEGFAULT @table.setTableSize 0,0 # make some garbage dummy = nil 100000.times do |i| dummy = [i]*10 end @table.setTableSize(1000, 10) @table.enable ### this seems to be necessary for SEGFAULT return 1 end def foo nr = @table.numRows nc = @table.numCols (1..nc-2).each { |c| item = @table.getItem(nr-1, c) ### 'item = ' seems to be necessary } end def create position(200, 200, 600, 400) super show end end application = FXApp.new("TEST", "TEST") application.init(ARGV) window = BugWindow.new(application) application.create application.run --------------020300080208060109000905--