Project

General

Profile

Backport #3342

segfault when calling aliased attr_writer's method and multiple arguments

Added by frihd (Lucas DiCioccio) over 9 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:30419]

Description

=begin
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/libruby.so.1.9(rb_vm_bugreport+0x60) [0xb77f2340]
0xb770d401 /usr/lib/libruby.so.1.9(+0x46401) [0xb770d401]
0xb770d49a /usr/lib/libruby.so.1.9(rb_bug+0x3a) [0xb770d49a]
0xb77e79fc /usr/lib/libruby.so.1.9(+0x1209fc) [0xb77e79fc]
0xb77e810b /usr/lib/libruby.so.1.9(+0x12110b) [0xb77e810b]
0xb77e837b /usr/lib/libruby.so.1.9(rb_iseq_eval_main+0xab) [0xb77e837b]
0xb770f7a7 /usr/lib/libruby.so.1.9(ruby_exec_node+0xb7) [0xb770f7a7]
0xb7710db6 /usr/lib/libruby.so.1.9(ruby_run_node+0x56) [0xb7710db6]
0x80486a8 ruby(main+0x68) [0x80486a8]
0xb757ab96 /lib/libc.so.6(__libc_start_main+0xe6) [0xb757ab96]
0x80485a1 ruby() [0x80485a1]
=end


Files

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

History

#1

Updated by shingara (Cyril Mougel) over 9 years ago

=begin
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.
=end

#2

Updated by jeremyevans0 (Jeremy Evans) 2 months ago

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

Also available in: Atom PDF