no clean exit

View: New views
4 Messages — Rating Filter:   Alert me  

no clean exit

by Björn Bergqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
when I quit the application I'm currently developing there is a lot of
messages popping up (see below). I've not discovered any problems when
running the application, but have I done something wrong? Since ruby
1.9 is much faster I don't think 1.8 is an option for me anymore.

Björn Bergqvist - http://www.discretizer.org


0xb7e91070 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(rb_vm_bugreport+0x60)
[0xb7e91070]
0xb7daea81 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9 [0xb7daea81]
0xb7daeb1a /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(rb_bug+0x3a)
[0xb7daeb1a]
0xb7e390fc /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9 [0xb7e390fc]
0xb7f1240c [0xb7f1240c]
0xb7e3ee72 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(st_lookup+0x22)
[0xb7e3ee72]
0xb7e7d9c6 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9 [0xb7e7d9c6]
0xb7e7da31 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(rb_get_method_body+0x31)
[0xb7e7da31]
0xb7e81f0d /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(rb_funcall+0xcd)
[0xb7e81f0d]
0xb7720102 /opt/discretizer/ruby/1.9.1-p243/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_Z18FXRbCallVoidMethodPN2FX8FXObjectEm+0x70)
[0xb7720102]
0xb762f3eb /opt/discretizer/ruby/1.9.1-p243/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN10FXRbMatrix6recalcEv+0x4d)
[0xb762f3eb]
0xb700fe38 /opt/discretizer/fox/1.6.36/lib/libFOX-1.6.so.0(_ZN2FX8FXWindowD2Ev+0x108)
[0xb700fe38]
0xb6f3b6cc /opt/discretizer/fox/1.6.36/lib/libFOX-1.6.so.0(_ZN2FX7FXLabelD2Ev+0x8c)
[0xb6f3b6cc]
0xb772df1f /opt/discretizer/ruby/1.9.1-p243/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN2FX13FXRadioButtonD2Ev+0x2b)
[0xb772df1f]
0xb772e016 /opt/discretizer/ruby/1.9.1-p243/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN15FXRbRadioButtonD0Ev+0x38)
[0xb772e016]
0xb76eb6fa /opt/discretizer/ruby/1.9.1-p243/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN10FXRbObject8freefuncEPN2FX8FXObjectE+0xe8)
[0xb76eb6fa]
0xb7dbf1aa /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9 [0xb7dbf1aa]
0xb7dbf334 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9 [0xb7dbf334]
0xb7dbf52c /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(rb_gc_call_finalizer_at_exit+0x17c)
[0xb7dbf52c]
0xb7db0d2e /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9 [0xb7db0d2e]
0xb7db2076 /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(ruby_cleanup+0x116)
[0xb7db2076]
0xb7db222e /opt/discretizer/ruby/1.9.1-p243/lib/libruby.so.1.9(ruby_run_node+0x5e)
[0xb7db222e]
0x80487c8 /opt/discretizer/ruby/1.9.1-p243/bin/ruby(main+0x68) [0x80487c8]
0xb7b91a36 /lib/libc.so.6(__libc_start_main+0xe6) [0xb7b91a36]
0x80486c1 /opt/discretizer/ruby/1.9.1-p243/bin/ruby [0x80486c1]
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: no clean exit

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 25, 2009, at 1:00 PM, Björn Bergqvist wrote:

> when I quit the application I'm currently developing there is a lot of
> messages popping up (see below). I've not discovered any problems when
> running the application, but have I done something wrong?

I don't think you're doing anything wrong. It doesn't seem to happen  
on every FXRuby app, but I too have seen it crash on exit (from Ruby  
1.9.1) in several cases, e.g.

        http://rubyforge.org/tracker/index.php?func=detail&aid=24073&group_id=300&atid=1223

It's been awhile since I've had time to look into this (or much else  
FXRuby related), but IIRC the problem boils down to the more or less  
random way that garbage collection occurs during finalization on exit.  
While your program's running, if you (for example) destroy a parent  
object, FOX will subsequently destroy the child object(s), and the  
Ruby objects associated with them get cleaned up in an orderly  
fashion. When the Ruby interpreter is exiting, however, it is possible  
that the child object will be GC'd before the parent, leaving dangling  
pointers lying around. I'm not really sure how to fix it at this point.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: no clean exit

by Melton, Ryan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fox doesn't handle accelerators correctly at shutdown and it causes lots of crashes:

Try calling this function in a SEL_CLOSE handler for your main window:

  def initialize
    ...
    self.connect(SEL_CLOSE, method(:cleanup_menu_panes))
  end

  def cleanup_menu_panes |sender, sel, data|
    ObjectSpace.each_object(FXMenuPane) do |object|
      children = []
      object.each_child do |child|
        children << child
      end
      children.each do |child|
        object.removeChild(child)
      end
    end
    0
  end

-----Original Message-----
From: fxruby-users-bounces@... [mailto:fxruby-users-bounces@...] On Behalf Of James Johnson
Sent: Friday, September 25, 2009 12:52 PM
To: fxruby-users@...
Subject: Re: [fxruby-users] no clean exit


On Sep 25, 2009, at 1:00 PM, Björn Bergqvist wrote:

> when I quit the application I'm currently developing there is a lot of
> messages popping up (see below). I've not discovered any problems when
> running the application, but have I done something wrong?

I don't think you're doing anything wrong. It doesn't seem to happen on every FXRuby app, but I too have seen it crash on exit (from Ruby
1.9.1) in several cases, e.g.

        http://rubyforge.org/tracker/index.php?func=detail&aid=24073&group_id=300&atid=1223

It's been awhile since I've had time to look into this (or much else FXRuby related), but IIRC the problem boils down to the more or less random way that garbage collection occurs during finalization on exit.  
While your program's running, if you (for example) destroy a parent object, FOX will subsequently destroy the child object(s), and the Ruby objects associated with them get cleaned up in an orderly fashion. When the Ruby interpreter is exiting, however, it is possible that the child object will be GC'd before the parent, leaving dangling pointers lying around. I'm not really sure how to fix it at this point.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users



This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: no clean exit

by Björn Bergqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I just thought about it and found a quick way of "solving" the
problem. I just pipe the errors to a file and look at the first rows
of that file:
ruby application.rb 2> err.txt; head -n 10 err.txt
Works for me. Thanks for the help anyway.

Regards
Björn Bergqvist

2009/9/25 Melton, Ryan <rmelton@...>:

> Fox doesn't handle accelerators correctly at shutdown and it causes lots of crashes:
>
> Try calling this function in a SEL_CLOSE handler for your main window:
>
>  def initialize
>    ...
>    self.connect(SEL_CLOSE, method(:cleanup_menu_panes))
>  end
>
>  def cleanup_menu_panes |sender, sel, data|
>    ObjectSpace.each_object(FXMenuPane) do |object|
>      children = []
>      object.each_child do |child|
>        children << child
>      end
>      children.each do |child|
>        object.removeChild(child)
>      end
>    end
>    0
>  end
>
> -----Original Message-----
> From: fxruby-users-bounces@... [mailto:fxruby-users-bounces@...] On Behalf Of James Johnson
> Sent: Friday, September 25, 2009 12:52 PM
> To: fxruby-users@...
> Subject: Re: [fxruby-users] no clean exit
>
>
> On Sep 25, 2009, at 1:00 PM, Björn Bergqvist wrote:
>
>> when I quit the application I'm currently developing there is a lot of
>> messages popping up (see below). I've not discovered any problems when
>> running the application, but have I done something wrong?
>
> I don't think you're doing anything wrong. It doesn't seem to happen on every FXRuby app, but I too have seen it crash on exit (from Ruby
> 1.9.1) in several cases, e.g.
>
>        http://rubyforge.org/tracker/index.php?func=detail&aid=24073&group_id=300&atid=1223
>
> It's been awhile since I've had time to look into this (or much else FXRuby related), but IIRC the problem boils down to the more or less random way that garbage collection occurs during finalization on exit.
> While your program's running, if you (for example) destroy a parent object, FOX will subsequently destroy the child object(s), and the Ruby objects associated with them get cleaned up in an orderly fashion. When the Ruby interpreter is exiting, however, it is possible that the child object will be GC'd before the parent, leaving dangling pointers lying around. I'm not really sure how to fix it at this point.
> _______________________________________________
> fxruby-users mailing list
> fxruby-users@...
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
>
>
> This message and any enclosures are intended only for the addressee.  Please
> notify the sender by email if you are not the intended recipient.  If you are
> not the intended recipient, you may not use, copy, disclose, or distribute this
> message or its contents or enclosures to any other person and any such actions
> may be unlawful.  Ball reserves the right to monitor and review all messages
> and enclosures sent to or from this email address.
> _______________________________________________
> fxruby-users mailing list
> fxruby-users@...
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users