Thread: [Fxruby-users] Core dump when exiting
Status: Inactive
Brought to you by:
lyle
From: chris m. <ze...@gm...> - 2004-01-06 06:49:20
|
Hi! Using ruby 1.8.{0,1}, fox-1.0.{43,48}, FXRuby-1.0.{25,27} on Linux/Intel and Solaris/Intel and WindowsXP: I have a FOX application, everything works fine. But as soon as I call 'exit' from within (or send a FXApp::ID_QUIT to getApp()) I get something like: ------------------------------------------------ ./rootwindow.rb:133: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i686-linux-gnu] Aborted ------------------------------------------------ Since this is not a very expressive error message: Is this behaviour known to anyone? Any hints in which direction I should go finding this error? Thanks, -- chris |
From: Joel V. <vj...@PA...> - 2004-01-06 06:59:57
|
chris mueffling wrote: > Hi! > > Using ruby 1.8.{0,1}, fox-1.0.{43,48}, FXRuby-1.0.{25,27} on > Linux/Intel and Solaris/Intel and WindowsXP: > > I have a FOX application, everything works fine. But as soon as > I call 'exit' from within (or send a FXApp::ID_QUIT to getApp()) > I get something like: > > ------------------------------------------------ > ./rootwindow.rb:133: [BUG] Segmentation fault > ruby 1.8.1 (2003-12-25) [i686-linux-gnu] > > Aborted > ------------------------------------------------ > > Since this is not a very expressive error message: > > Is this behaviour known to anyone? Any hints in which direction > I should go finding this error? What I always try first in these situations is: turn off garbage collection with GC.disable. If that stops the segfault, then it's a good bet there's a bug somewhere in the mark/free funcs within FXRuby. Other than that, I would try paring down the app to the minimal code that will reliably cause the problem, and then post it here. Of course, that can be hard work.... |
From: Chris M. <ze...@gm...> - 2004-01-12 14:14:41
|
Hi! On Mon, Jan 05, 2004 at 10:59:42PM -0800, Joel VanderWerf wrote: > >Using ruby 1.8.{0,1}, fox-1.0.{43,48}, FXRuby-1.0.{25,27} on > >Linux/Intel and Solaris/Intel and WindowsXP: > > > >I have a FOX application, everything works fine. But as soon as > >I call 'exit' from within (or send a FXApp::ID_QUIT to getApp()) > >I get something like: > > > >------------------------------------------------ > >./rootwindow.rb:133: [BUG] Segmentation fault > >ruby 1.8.1 (2003-12-25) [i686-linux-gnu] > > > >Aborted > >------------------------------------------------ > > > >Since this is not a very expressive error message: > > > >Is this behaviour known to anyone? Any hints in which direction > >I should go finding this error? > > What I always try first in these situations is: turn off garbage > collection with GC.disable. If that stops the segfault, then it's a good > bet there's a bug somewhere in the mark/free funcs within FXRuby. Ok, tried that, no change. > Other than that, I would try paring down the app to the minimal code > that will reliably cause the problem, and then post it here. Of course, > that can be hard work.... So far I just can say this: I use the method FXTreeItem *addItemLast(FXTreeItem *p, FXTreeItem *item, ...) to insert an (from FXTableItem derived) item into an FXTreeList. When i use FXTreeItem *addItemLast(FXTreeItem *p, const FXString &text, ...) it works just fine. As soon as I find some spare time I'll try to break this down into a smaller example. Anyway, thanks for your answer! -- chris |
From: Christian v. M. <chr...@pd...> - 2004-01-25 10:31:11
|
Hello! On Mon, Jan 12, 2004 at 03:14:23PM +0100, Chris Mueffling wrote: > As soon as I find some spare time I'll try to break this down into > a smaller example. Ok, did it. The problem seems to be the usage of 'addItemLast' to add an item. If I use 'addItemFirst' instead, no problems. Just execute the enclosed code and close the window => [...]table_test.rb:74: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i686-linux-gnu] ------- snip snip snip --------------------------------------------------------------- #!/usr/bin/env ruby require "fox" include Fox class TestTreeWindow < FXMainWindow class ProjectTreeItem < FXTreeItem def initialize(name, id) super(name) @id = id end attr_reader :id end # class ProjectTreeItem def initialize(app) super(app, "Tree Test", nil, nil, DECOR_ALL, 0, 0, 0, 0) __build end def create super show(PLACEMENT_SCREEN) end # def create private def __build @treelist = FXTreeList.new(self, 0, nil, 0, HSCROLLING_OFF|TREELIST_BROWSESELECT|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES| TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y) populate_tree end ## # Fill tree with project names. # def populate_tree @projects = [ { :name => "Top 1", :id => 1, :children => [], }, { :name => "Top 2", :id => 5, :children => [], } ] @treelist.clearItems @projects.each { |project| populate_tree_rec(nil, project) } end def populate_tree_rec(parent, project) child = @treelist.addItemLast(parent, ProjectTreeItem.new(project[:name], project[:id])) project[:children].each { |subproject| populate_tree_rec(child, subproject) } end end # Start the whole thing if __FILE__ == $0 # Make application application = FXApp.new("TestApp", "FoxTest") # Make window TestTreeWindow.new(application) # Create app application.create # Run application.run end --------- snip snip snip ------------------------------------------------------------- -- chris |
From: Joel V. <vj...@PA...> - 2004-01-25 17:20:19
|
Christian von Mueffling wrote: > Hello! > > On Mon, Jan 12, 2004 at 03:14:23PM +0100, Chris Mueffling wrote: > > >>As soon as I find some spare time I'll try to break this down into >>a smaller example. > > > Ok, did it. The problem seems to be the usage of 'addItemLast' to add an item. > If I use 'addItemFirst' instead, no problems. > > Just execute the enclosed code and close the window => > > [...]table_test.rb:74: [BUG] Segmentation fault > ruby 1.8.1 (2003-12-25) [i686-linux-gnu] Try upgrading to a more recent ruby snapshot: $ ruby-1.9.0 -v tl.rb ruby 1.9.0 (2004-01-08) [i686-linux] $ ruby-1.8.1 -v tl.rb ruby 1.8.1 (2003-12-25) [i686-linux] include/FXRuby.h:286: FXASSERT(!NIL_P(obj)) failed. tl.rb:72: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i686-linux] zsh: abort ruby-1.8.1 -v tl.rb If that doesn't help, which version of FXRuby are you using? |
From: Lyle J. <ly...@kn...> - 2004-01-26 04:13:02
|
On Jan 25, 2004, at 11:20 AM, Joel VanderWerf wrote: > Try upgrading to a more recent ruby snapshot: <snip> If this happens to work properly under Ruby 1.9, I'm afraid it's by coincidence only. I understand the fundamental problem underlying this bug (the "tree list crashes when Ruby shuts down" bug) and just haven't hit on the proper solution yet. In short, the problem is that when the Ruby interpreter shuts down, the remaining objects are garbage-collected in an unpredictable order. That can cause parts of the tree list widget (specifically, some of the tree items) to be destroyed before they would be under normal circumstances, and it's not always obvious how to account for that. I haven't tried out the CVS for Ruby 1.9 yet, and I will of course take your word for it that it doesn't crash there -- but I think that's just good luck that may turn on us again in the future ;) I'm going to focus some more attention on this problem (which is larger than the specific tree list problem alone) and try to come up with a good solution before the next FXRuby release. |