Forum: Ruby-Gnome 2 problem with garbaje collection phase

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Antonio Ignacio Cabrera Santana (Guest)
on 2008-10-22 17:13
(Received via mailing list)
Hello,

I'm having problems with the execution of various programs with ruby
ruby 1.8.7 (2008-08-11 patchlevel 72), and ruby-gnome2 0.17.0~rc1-6.
When
I run the programs, always stop and arise and message like:

./unidades.rb:210: [BUG] object allocation during garbage collection
phase
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

Abortado

This programs are very important for me, because I had worked on them
during the past years and I use them for my work. They are very large
programs, and
I can't put here to reproduce this problem.

My question is: Is a ruby problem o a ruby-gnome2 problem? Is there any
fix in progress?. Is there anyone with the same problem?

The only way in that I can work with my programs from now is working
with libruby1.8 (1.8.6.114-2)

Thanks
Antonio Ignacio Cabrera Santana
Guillaume C. (Guest)
on 2008-10-22 17:26
(Received via mailing list)
On Wed, Oct 22, 2008 at 1:13 PM, Antonio Ignacio Cabrera Santana
<removed_email_address@domain.invalid> wrote:
>
> Hello,
>
> I'm having problems with the execution of various programs with ruby ruby
> 1.8.7 (2008-08-11 patchlevel 72), and ruby-gnome2 0.17.0~rc1-6. When
> I run the programs, always stop and arise and message like:
>
> ./unidades.rb:210: [BUG] object allocation during garbage collection phase
> ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

This happens typically when using ruby >= 1.8.7 with ruby-gtk2 <
0.17.0. You have to either downgrade ruby or upgrade ruby-gtk2.

--
Guillaume C. - http://zarb.org/~gc/
Dobai-Pataky Bálint (Guest)
on 2009-01-26 15:24
(Received via mailing list)
hi,

i have this issue now with the followind combination:
dev-lang/ruby-1.8.6_p287-r11
dev-ruby/rcairo-1.8.0
dev-ruby/ruby-atk-0.18.1-r1
dev-ruby/ruby-gdkpixbuf2-0.18.1-r1
dev-ruby/ruby-glib2-0.18.1-r1
dev-ruby/ruby-gtk2-0.18.1-r1
dev-ruby/ruby-gtksourceview-0.18.1
dev-ruby/ruby-pango-0.18.1-r1
dev-ruby/ruby-prof-0.7.2
dev-ruby/rubygems-1.3.1

i thought it was fixed in 0.17.0 (according to
http://www.ruby-forum.com/topic/157194)

any news on that?

thanks in advice
balint
Dobai-Pataky Bálint (Guest)
on 2009-01-26 19:48
(Received via mailing list)
i can get rid of this error only, if i downgrade to ruby-1.8.6_p114.
both on x86 and amd64.
Kouhei S. (Guest)
on 2009-01-27 15:29
(Received via mailing list)
Hi,

In <removed_email_address@domain.invalid>
  "Re: [ruby-gnome2-devel-en] problem with garbaje collection phase" on
Mon, 26 Jan 2009 19:48:25 +0200,
  Dobai-Pataky Bálint <removed_email_address@domain.invalid> wrote:

> i can get rid of this error only, if i downgrade to ruby-1.8.6_p114. both on
> x86 and amd64.

Could you show us your test script? I'll test it on my
environment.

Thanks,
--
kou
Dobai-Pataky Bálint (Guest)
on 2009-01-27 23:25
(Received via mailing list)
hi,

i was attempting to write a small script to catch the bug, but very soon
ended up with the attached one resulting this:

$ ruby gc_bug_attempt.rb
Xlib:  extension "RANDR" missing on display ":0.0".
"1.8.6"
[2, 14, 7]
[0, 18, 1]
Segmentation fault

clicking the button segfaults.
this is not the garbage allocation bug.

can you reproduce this?
Kouhei S. (Guest)
on 2009-01-28 14:34
(Received via mailing list)
Hi,

In <removed_email_address@domain.invalid>
  "Re: [ruby-gnome2-devel-en] problem with garbaje collection phase" on
Tue, 27 Jan 2009 23:25:05 +0200,
  Dobai-Pataky Bálint <removed_email_address@domain.invalid> wrote:

> clicking the button segfaults.
> this is not the garbage allocation bug.
>
> can you reproduce this?

Thanks for show a sample program.
But I can't reproduce it with:

  * ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
  * Ruby-GNOME2 trunk

If you can, could you try Ruby-GNOME2 trunk?

  % cd /tmp
  % svn co
https://ruby-gnome2.svn.sourceforge.net/svnroot/ru...
ruby-gnome2
  % cd ruby-gnome2
  % ruby extconf.rb
  % make > /dev/null
  % ruby `for x in /tmp/ruby-gnome2/*; do echo -n "-I$x/lib -I$x
-I$x/src/lib -I$x/src "; done ` /tmp/gc_bug_attempt.rb


Thanks,
--
kou
Dobai-Pataky Bálint (Guest)
on 2009-01-28 17:43
(Received via mailing list)
Kouhei S. wrote:
>> $ ruby gc_bug_attempt.rb
>>
>   % svn co https://ruby-gnome2.svn.sourceforge.net/svnroot/ru... 
ruby-gnome2
>   % cd ruby-gnome2
>   % ruby extconf.rb
>   % make > /dev/null
>   % ruby `for x in /tmp/ruby-gnome2/*; do echo -n "-I$x/lib -I$x -I$x/src/lib -I$x/src 
"; done ` /tmp/gc_bug_attempt.rb
>
>
> Thanks,
> --
> kou
>
the Segmentation fault generated by the gc_bug_attempt.rb is gone, but
the
[BUG] object allocation during garbage collection phase
ruby 1.8.6 (2008-08-11) [i686-linux]

/usr/lib/ruby/1.8/drb/drb.rb:585: [BUG] Segmentation fault
ruby 1.8.6 (2008-08-11) [i686-linux]

is there in trunk, so i'll try to simulate it in gc_bug_attempt.rb.

thanks Kou
Dobai-Pataky Bálint (Guest)
on 2009-01-29 10:17
(Received via mailing list)
Kou, i found it, narrowed it down to the attached script.

tested it with  rg2 Revision: 3589

affected ruby versions:
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

here are my results:
ruby `for x in /opt/ruby-gnome2/*; do echo -n "-I$x/lib -I$x
-I$x/src/lib -I$x/src "; done ` ruby/gc_bug_attempt.rb
"ruby:1.8.6, gtk:[2, 14, 7],rg2:[0, 19, 0]"
"start 02"
"created: #<Gtk::TreeView:0xb5dc76c4 ptr=0x827f050>"
"start 03"
"destroying: #<Gtk::TreeView:0xb5dc76c4 ptr=0x827f050>"
ruby/gc_bug_attempt.rb:33: [BUG] object allocation during garbage
collection phase
ruby 1.8.6 (2008-08-11) [i686-linux]

ruby/gc_bug_attempt.rb:33: [BUG] Segmentation fault
ruby 1.8.6 (2008-08-11) [i686-linux]


unaffected ruby version: ruby 1.8.6 (2008-03-03 patchlevel 114)
[i686-linux]
ruby `for x in /opt/ruby-gnome2/*; do echo -n "-I$x/lib -I$x
-I$x/src/lib -I$x/src "; done ` ruby/gc_bug_attempt.rb
Xlib:  extension "RANDR" missing on display ":0.0".
"ruby:1.8.6, gtk:[2, 14, 7],rg2:[0, 19, 0]"
"start 02"
"created: #<Gtk::TreeView:0xb5d7f720 ptr=0x845a030>"
"start 03"
"destroying: #<Gtk::TreeView:0xb5d7f720 ptr=0x845a030>"
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
"created: #<Gtk::TreeView:0xb5d7f6f8 ptr=0x845a200>"
"start 04"
"destroying: #<Gtk::TreeView:0xb5d7f6f8 ptr=0x845a200>"
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
ruby/gc_bug_attempt.rb:20: warning: GRClosure invoking callback: already
destroyed
"created: #<Gtk::TreeView:0xb5d7f6bc ptr=0x845a3d0>"
...

if i trigger GC myself, then it needs 2 runs, if not, it needs around 11
runs on my athlon64/x86_32/3G ram, gentoo
just run it and press the button until the bug appears.

another thing, i got a question, at line 42 there is a block, is there
wrong something with that? i'd like to use that, i want to save some
settings done by the user on TreeViewColumn.destroy

hope it helps finding it
thank you
balint
Kouhei S. (Guest)
on 2009-01-31 11:26
(Received via mailing list)
Hi,

In <removed_email_address@domain.invalid>
  "Re: [ruby-gnome2-devel-en] problem with garbaje collection phase" on
Thu, 29 Jan 2009 10:17:07 +0200,
  Dobai-Pataky Bálint <removed_email_address@domain.invalid> wrote:

> Kou, i found it, narrowed it down to the attached script.

Thanks! I can reproduce the problem.

Detail:
  1. GC
  2. Gtk::Object is destroyed
  3. Gtk::Object emits "destroy" signal
  4. You create an object
  5. "[BUG] object allocation during garbage collection"

Workaround:
  before:
    col.signal_connect("destroy"){|me| p "destroy: #{me.inspect}"}
  after:
    # col.signal_connect("destroy"){|me| p "destroy: #{me.inspect}"}


I'll consider other solution but don't expect quick
fixing. I'm very busy now...

Perhaps Ruby 1.8.8 will not occur the problem because Ruby
1.8.8 defers destroying some objects after mark&sweep phase.


Thanks,
--
kou
Dobai-Pataky Bálint (Guest)
on 2009-01-31 15:23
(Received via mailing list)
Kouhei S. wrote:
> Thanks! I can reproduce the problem.
>     col.signal_connect("destroy"){|me| p "destroy: #{me.inspect}"}
>   after:
>     # col.signal_connect("destroy"){|me| p "destroy: #{me.inspect}"}
>
i thought it's triggered at line 16.
>
> I'll consider other solution but don't expect quick
> fixing. I'm very busy now...
>
 no problem, thank you for confirming it.
> Perhaps Ruby 1.8.8 will not occur the problem because Ruby
> 1.8.8 defers destroying some objects after mark&sweep phase.
>
until than i stick at 1.8.6_p114
thanks
balint
Daniel L. (Guest)
on 2009-02-09 18:52
(Received via mailing list)
Thanks for working on this guys. I didn't know it before but I think
I've been caught by this bug.

best,
Dan
___________________________
Daniel L.
http://www.daniellucraft.com/
This topic is locked and can not be replied to.