Backport #3342

segfault when calling aliased attr_writer's method and multiple arguments

Added by frihd (Lucas DiCioccio) about 10 years ago. Updated about 1 year ago.



I experience a segfault when calling an aliased method (which has been created with attr_accessor or attr_writer) with multiple arguments.
The bug doesn't appear with manually defined methods that accept any number of arguments (i.e., with splat).
I'm using Archlinux's official build.

bug.rb:10: [BUG] Stack consistency error (sp: 7, bp: 6)
ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]

-- control frame ----------
c:0003 p:0108 s:0007 b:0006 l:00036c d:001bec EVAL bug.rb:10
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00036c d:00036c TOP

-- Ruby level backtrace information-----------------------------------------
bug.rb:10:in `'

-- C level backtrace information -------------------------------------------
0xb77f2340 /usr/lib/ [0xb77f2340]
0xb770d401 /usr/lib/ [0xb770d401]
0xb770d49a /usr/lib/ [0xb770d49a]
0xb77e79fc /usr/lib/ [0xb77e79fc]
0xb77e810b /usr/lib/ [0xb77e810b]
0xb77e837b /usr/lib/ [0xb77e837b]
0xb770f7a7 /usr/lib/ [0xb770f7a7]
0xb7710db6 /usr/lib/ [0xb7710db6]
0x80486a8 ruby(main+0x68) [0x80486a8]
0xb757ab96 /lib/ [0xb757ab96]
0x80485a1 ruby() [0x80485a1]


bug.rb (143 Bytes) bug.rb toy exemple to reproduce the bug frihd (Lucas DiCioccio), 05/25/2010 10:41 PM

Updated by shingara (Cyril Mougel) about 10 years ago

I try with the latest Ruby version (ruby 1.9.2dev (2010-05-11 revision 27735) [x86_64-darwin10.3.0]) and there are no segfault.

There are just :

 bug.rb:10:in `<main>': wrong number of arguments (2 for 1) (ArgumentError)

So it's not compatible with Ruby edge.


Updated by jeremyevans0 (Jeremy Evans) about 1 year ago

  • Status changed from Open to Closed
  • Description updated (diff)

Also available in: Atom PDF