[#44036] [ruby-trunk - Feature #6242][Open] Ruby should support lists — "shugo (Shugo Maeda)" <redmine@...>

20 messages 2012/04/01

[#44084] [ruby-trunk - Bug #6246][Open] 1.9.3-p125 intermittent segfault — "jshow (Jodi Showers)" <jodi@...>

22 messages 2012/04/02

[#44156] [ruby-trunk - Feature #6265][Open] Remove 'useless' 'concatenation' syntax — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>

45 messages 2012/04/06

[#44163] [ruby-trunk - Bug #6266][Open] encoding related exception with recent integrated psych — "jonforums (Jon Forums)" <redmine@...>

10 messages 2012/04/06

[#44303] [ruby-trunk - Feature #6284][Open] Add composition for procs — "pabloh (Pablo Herrero)" <pablodherrero@...>

57 messages 2012/04/12

[#44349] [ruby-trunk - Feature #6293][Open] new queue / blocking queues — "tenderlovemaking (Aaron Patterson)" <aaron@...>

10 messages 2012/04/13

[#44402] [ruby-trunk - Feature #6308][Open] Eliminate delegation from WeakRef — "headius (Charles Nutter)" <headius@...>

20 messages 2012/04/17

[#44403] [ruby-trunk - Feature #6309][Open] Add a reference queue for weak references — "headius (Charles Nutter)" <headius@...>

15 messages 2012/04/17

[#44533] [ruby-trunk - Bug #6341][Open] SIGSEGV: Thread.new { fork { GC.start } }.join — "rudolf (r stu3)" <redmine@...>

24 messages 2012/04/22

[#44630] [ruby-trunk - Feature #6361][Open] Bitwise string operations — "MartinBosslet (Martin Bosslet)" <Martin.Bosslet@...>

31 messages 2012/04/26

[#44648] [ruby-trunk - Feature #6367][Open] #same? for Enumerable — "prijutme4ty (Ilya Vorontsov)" <prijutme4ty@...>

16 messages 2012/04/26

[#44704] [ruby-trunk - Feature #6373][Open] public #self — "trans (Thomas Sawyer)" <transfire@...>

61 messages 2012/04/27

[#44748] [ruby-trunk - Feature #6376][Open] Feature lookup and checking if feature is loaded — "trans (Thomas Sawyer)" <transfire@...>

13 messages 2012/04/28

[ruby-core:44521] [ruby-trunk - Bug #5986][Assigned] Segmentation Fault

From: "mame (Yusuke Endoh)" <mame@...>
Date: 2012-04-22 01:40:30 UTC
List: ruby-core #44521
Issue #5986 has been updated by mame (Yusuke Endoh).

Status changed from Feedback to Assigned
Assignee set to nobu (Nobuyoshi Nakada)

Hello,

I cannot reproduce this, but I guess this is a bug of Ruby which is
triggered by a bug of active_admin.


Arbre::HTML::Element (which is defined in active_admin) defines #to_ary
*wrongly*, as the class does not mimic Array class.
https://github.com/gregbell/active_admin/blob/master/lib/active_admin/arbre/html/element.rb#L147

  def to_ary
    Collection.new [self]
  end

(The Collection class inherits Array)

And, an instance of the class is passed to Kernel.puts, which cause a bug.


In short, this is considered like the following small code:

  class Foo
    def to_ary
      Array.new [self]
    end
  end
  puts Foo.new

(This code does not cause SEGV in my 32 bit system, but naruse said
it does in x86_64)

This causes infinite recursion, which leads to stack overflow.
This behavior can be also observed in the following stack trace:

> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_io_puts+0x157) [0x7fb247a35b07]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x88cdd) [0x7fb247a35cdd]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17da08) [0x7fb247b2aa08]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17e7dc) [0x7fb247b2b7dc]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_io_puts+0x157) [0x7fb247a35b07]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x88cdd) [0x7fb247a35cdd]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17da08) [0x7fb247b2aa08]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17e7dc) [0x7fb247b2b7dc]
> /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_io_puts+0x157) [0x7fb247a35b07]


Because rb_io_puts (the implementation of IO#puts) uses rb_exec_recursive,
the infinite recursion should be detected.
So, I guess there is something wrong in rb_exec_recursive.


Nobu, please check it.

-- 
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Bug #5986: Segmentation Fault
https://bugs.ruby-lang.org/issues/5986#change-26073

Author: levmatta (Luis Matta)
Status: Assigned
Priority: Low
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 1.9.3
ruby -v: ruby 1.9.3p68 (2012-02-08 revision 34493) [x86_64-linux]


Simply trying to render the home page of active-admin.

I have tested this on Ubuntu 10.04 LTS 64bits, using rvm ruby 1.9.3-head (with and without "rvm pkg install openssl"), and 1.9.2-head.
The structure: Nginx 1.0.11 (using ppa), RVM, Thin 1.3.1, Rails 3.2.1, ActiveAdmin 0.4, and stuff.
I am using SSL with a custom self-signed Certification Authority.

Thanks
(Since this broke my new production environment I have set it to Urgent - apologies if it is an abuse)


-- 
http://bugs.ruby-lang.org/

In This Thread