David Peoples
2005-Feb-18 16:35 UTC
[fxruby-users] FXTable segfaults after multiple setTableSize calls
When I empty and refill an FXTable multiple times with a large data set (10,000 rows x 1 column in the example below, around 1000 rows x 6 columns in a more complicated app), the application eventually fails with a segmentation fault. The number of repetitions required to produce the segfault is rather random, ranging from just a couple reps to 15 or 20 in some trials. The program disappears (window goes away) apparently during or just after the table is filled, leaving the following message at the command prompt: C:/Data/Ruby/pos/stockviewertest/mainv5c.rb:21: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] The platform is Windows XP Home with service pack 2. The base Ruby installation is the "One Click Ruby Installer" version 1.8.2-14 final (ruby182-14.exe). I''ve installed FXRuby version 1.2.3 on top of the version included with the one click installer (FXRuby-1.2.3-ruby182.exe). fxversion() reports "1.2.13" from the irb command prompt. The machine has a Pentium 4 and 256mb ram. If someone can run the example code below and it fails like I''m seeing, let me know. If you see an obvious programming error on my part, please tell me -- I''m new to Ruby and that''s a serious possibility. If you can run the code on Windows and it *doesn''t* fail, let me know that -- maybe it is some other problem on this machine I''ll have to track down (display driver?). Thanks for your help. David Peoples ------------------------------------------------------------------------- require "fox12" include Fox class TestWindow < FXMainWindow TABLE_SIZE = 10_000 def initialize(app) super(app, "MyTest", nil, nil, DECOR_ALL, 0, 0, 600, 400, 0, 0) mainFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) @table = FXTable.new(mainFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) goButton = FXButton.new(mainFrame, " Go method 1") goButton.connect(SEL_COMMAND) { fillTable } goButton2 = FXButton.new(mainFrame, " Go method 2") goButton2.connect(SEL_COMMAND) { fillTable2 } end # fails after 2 to 15-20 iterations def fillTable @table.setTableSize(TABLE_SIZE, 1) (0...TABLE_SIZE).each do |r| @table.setItemText(r, 0, "#{r}") end @table.setFocus end # seems to require more iterations, but still fails def fillTable2 @table.setTableSize(0, 1) (0...TABLE_SIZE).each do |r| @table.insertRows(r) @table.setItemText(r, 0, "#{r}") end @table.setFocus end def create super show(PLACEMENT_SCREEN) end end def runme application = FXApp.new("MyTest", "FoxTest") TestWindow.new(application) application.create application.run end runme ------------------------------------------------------------------------- -- David Peoples davidp@touringcyclist.com The Touring Cyclist http://www.touringcyclist.com 11816 St. Charles Rock Road, Bridgeton, MO 63044 tel: 314-739-4648 fax: 314-739-4972
DeZonia, Barry
2005-Feb-18 16:50 UTC
[fxruby-users] FXTable segfaults after multiple setTableSize calls
The app fails for me too selecting either button (after 8-20 times). Windows, Ruby 1.8.2-14 final, fxruby 1.2.2 -----Original Message----- From: fxruby-users-bounces@rubyforge.org [mailto:fxruby-users-bounces@rubyforge.org] On Behalf Of David Peoples Sent: Friday, February 18, 2005 3:39 PM To: fxruby-users Subject: [fxruby-users] FXTable segfaults after multiple setTableSize calls When I empty and refill an FXTable multiple times with a large data set (10,000 rows x 1 column in the example below, around 1000 rows x 6 columns in a more complicated app), the application eventually fails with a segmentation fault. The number of repetitions required to produce the segfault is rather random, ranging from just a couple reps to 15 or 20 in some trials. The program disappears (window goes away) apparently during or just after the table is filled, leaving the following message at the command prompt: C:/Data/Ruby/pos/stockviewertest/mainv5c.rb:21: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] The platform is Windows XP Home with service pack 2. The base Ruby installation is the "One Click Ruby Installer" version 1.8.2-14 final (ruby182-14.exe). I''ve installed FXRuby version 1.2.3 on top of the version included with the one click installer (FXRuby-1.2.3-ruby182.exe). fxversion() reports "1.2.13" from the irb command prompt. The machine has a Pentium 4 and 256mb ram. If someone can run the example code below and it fails like I''m seeing, let me know. If you see an obvious programming error on my part, please tell me -- I''m new to Ruby and that''s a serious possibility. If you can run the code on Windows and it *doesn''t* fail, let me know that -- maybe it is some other problem on this machine I''ll have to track down (display driver?). Thanks for your help. David Peoples ------------------------------------------------------------------------- require "fox12" include Fox class TestWindow < FXMainWindow TABLE_SIZE = 10_000 def initialize(app) super(app, "MyTest", nil, nil, DECOR_ALL, 0, 0, 600, 400, 0, 0) mainFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) @table = FXTable.new(mainFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) goButton = FXButton.new(mainFrame, " Go method 1") goButton.connect(SEL_COMMAND) { fillTable } goButton2 = FXButton.new(mainFrame, " Go method 2") goButton2.connect(SEL_COMMAND) { fillTable2 } end # fails after 2 to 15-20 iterations def fillTable @table.setTableSize(TABLE_SIZE, 1) (0...TABLE_SIZE).each do |r| @table.setItemText(r, 0, "#{r}") end @table.setFocus end # seems to require more iterations, but still fails def fillTable2 @table.setTableSize(0, 1) (0...TABLE_SIZE).each do |r| @table.insertRows(r) @table.setItemText(r, 0, "#{r}") end @table.setFocus end def create super show(PLACEMENT_SCREEN) end end def runme application = FXApp.new("MyTest", "FoxTest") TestWindow.new(application) application.create application.run end runme ------------------------------------------------------------------------- -- David Peoples davidp@touringcyclist.com The Touring Cyclist http://www.touringcyclist.com 11816 St. Charles Rock Road, Bridgeton, MO 63044 tel: 314-739-4648 fax: 314-739-4972 _______________________________________________ fxruby-users mailing list fxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users
lyle@knology.net
2005-Feb-18 17:01 UTC
[fxruby-users] FXTable segfaults after multiple setTableSize calls
On Fri, 18 Feb 2005 15:38:57 -0600, David Peoples <davidp@touringcyclist.com> wrote :> When I empty and refill an FXTable multiple times with a large data set > (10,000 rows x 1 column in the example below, around 1000 rows x 6 > columns in a more complicated app), the application eventually fails > with a segmentation fault.<snip> This sounds like another manifestation of the bug described here: http://rubyforge.org/tracker/index.php?func=detail&aid=1445&group_id=300&atid=1223 I will tack your report on to that one as some supporting evidence, if that''s OK with you. I''ve figured out part of the problem, but it''s difficult to debug. I hope to have a solution soon, though. Will try to devote some more time to it this weekend.
David Peoples
2005-Feb-18 17:06 UTC
[fxruby-users] FXTable segfaults after multiple setTableSize calls
DeZonia, Barry wrote:> The app fails for me too selecting either button (after 8-20 times). > > Windows, Ruby 1.8.2-14 final, fxruby 1.2.2 >Thanks. I guess I''m glad to hear one data point suggesting this isn''t just a display driver problem on my machine. (I just looked, it''s an NVidia Vanta, driver ver. 4.5.2.3 supplied by Microsoft I think. Hope your''s isn''t the same! <g>) David -- David Peoples davidp@touringcyclist.com The Touring Cyclist http://www.touringcyclist.com 11816 St. Charles Rock Road, Bridgeton, MO 63044 tel: 314-739-4648 fax: 314-739-4972
Jeroen van der Zijp
2005-Feb-18 17:11 UTC
[fxruby-users] FXTable segfaults after multiple setTableSize calls
On Friday 18 February 2005 03:54 pm, DeZonia, Barry wrote:> > The app fails for me too selecting either button (after 8-20 times). > > Windows, Ruby 1.8.2-14 final, fxruby 1.2.2 > > -----Original Message----- > From: fxruby-users-bounces@rubyforge.org > [mailto:fxruby-users-bounces@rubyforge.org] On Behalf Of David Peoples > Sent: Friday, February 18, 2005 3:39 PM > To: fxruby-users > Subject: [fxruby-users] FXTable segfaults after multiple setTableSize calls > > When I empty and refill an FXTable multiple times with a large data set > (10,000 rows x 1 column in the example below, around 1000 rows x 6 > columns in a more complicated app), the application eventually fails > with a segmentation fault. The number of repetitions required to produce > the segfault is rather random, ranging from just a couple reps to 15 or > 20 in some trials. The program disappears (window goes away) apparently > during or just after the table is filled, leaving the following message > at the command prompt: > > C:/Data/Ruby/pos/stockviewertest/mainv5c.rb:21: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > The platform is Windows XP Home with service pack 2. The base Ruby > installation is the "One Click Ruby Installer" version 1.8.2-14 final > (ruby182-14.exe). I''ve installed FXRuby version 1.2.3 on top of the > version included with the one click installer > (FXRuby-1.2.3-ruby182.exe). fxversion() reports "1.2.13" from the irb > command prompt. The machine has a Pentium 4 and 256mb ram. > > If someone can run the example code below and it fails like I''m seeing, > let me know. If you see an obvious programming error on my part, please > tell me -- I''m new to Ruby and that''s a serious possibility. If you can > run the code on Windows and it *doesn''t* fail, let me know that -- maybe > it is some other problem on this machine I''ll have to track down > (display driver?). > > Thanks for your help. > > David Peoples > > ------------------------------------------------------------------------- > > require "fox12" > include Fox > > class TestWindow < FXMainWindow > > TABLE_SIZE = 10_000 > > def initialize(app) > super(app, "MyTest", nil, nil, DECOR_ALL, 0, 0, 600, 400, 0, 0) > mainFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) > @table = FXTable.new(mainFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) > goButton = FXButton.new(mainFrame, " Go method 1") > goButton.connect(SEL_COMMAND) { fillTable } > goButton2 = FXButton.new(mainFrame, " Go method 2") > goButton2.connect(SEL_COMMAND) { fillTable2 } > end > > # fails after 2 to 15-20 iterations > def fillTable > @table.setTableSize(TABLE_SIZE, 1) > (0...TABLE_SIZE).each do |r| > @table.setItemText(r, 0, "#{r}") > end > @table.setFocus > end > > # seems to require more iterations, but still fails > def fillTable2 > @table.setTableSize(0, 1) > (0...TABLE_SIZE).each do |r| > @table.insertRows(r) > @table.setItemText(r, 0, "#{r}") > end > @table.setFocus > end > > def create > super > show(PLACEMENT_SCREEN) > end > > end > > def runme > application = FXApp.new("MyTest", "FoxTest") > TestWindow.new(application) > application.create > application.run > end > > runmeI looked through FXTable code and nothing I see looks like an obvious error. It may be specific to the ruby binding. - Jeroen
David Peoples
2005-Feb-18 17:18 UTC
[fxruby-users] FXTable segfaults after multiple setTableSize calls
lyle@knology.net wrote:> On Fri, 18 Feb 2005 15:38:57 -0600, David Peoples > <davidp@touringcyclist.com> wrote : > > >>When I empty and refill an FXTable multiple times with a large data set >>(10,000 rows x 1 column in the example below, around 1000 rows x 6 >>columns in a more complicated app), the application eventually fails >>with a segmentation fault. > > > <snip> > > This sounds like another manifestation of the bug described here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=1445&group_id=300&atid=1223 > > I will tack your report on to that one as some supporting evidence, if > that''s OK with you. I''ve figured out part of the problem, but it''s difficult > to debug. I hope to have a solution soon, though. Will try to devote some > more time to it this weekend.That''s fine. I actually had seen that bug report, but didn''t make the connection to my example somehow. I think I was distracted by some red herrings in the original code where this problem first showed up, and didn''t remember it by the time I distilled the problem down to the FXTable. I''m not equipped or knowledgeable enough to debug this at a lower level myself, so I''m afraid I can''t be any help there. But I''ll be happy to try out potential fixes for you if that does you any good. David -- David Peoples davidp@touringcyclist.com The Touring Cyclist http://www.touringcyclist.com 11816 St. Charles Rock Road, Bridgeton, MO 63044 tel: 314-739-4648 fax: 314-739-4972