Project

General

Profile

Actions

Bug #345

closed

1.9 racc appears to seg fault

Added by rogerdpack (Roger Pack) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
Backport:
[ruby-core:17922]

Description

=begin
ruby_parser, which uses racc, generates a seg fault in 1.9
require 'ruby_parser'

irb(main):003:0> RubyParser.new.parse "1+1"

/Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:2617: [BUG] Bus Error
ruby 1.9.0 (2008-07-23 revision 17865) [i686-darwin9.3.0]

-- control frame ----------
c:0029 p:---- s:0098 b:0098 l:000097 d:000097 CFUNC :method_missing
c:0028 p:---- s:0096 b:0096 l:000095 d:000095 CFUNC :old_initialize
c:0027 p:0029 s:0092 b:0092 l:000091 d:000091 METHOD /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:2617
c:0026 p:---- s:0088 b:0088 l:000087 d:000087 FINISH :(null)

Also as a note, with the latest 1.9 SVN HEAD, it doesn't compile:

gcc -I. -I../../.ext/include/i686-darwin9.3.0 -I../.././include -I../.././ext/openssl -DRUBY_EXTCONF_H="extconf.h" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -o ossl_pkcs7.o -c ossl_pkcs7.c
ossl_pkcs7.c: In function ‘ossl_pkcs7si_new’:
ossl_pkcs7.c:89: error: ‘d2i_of_void’ undeclared (first use in this function)

though that's not the real issue here.
-R
=end

Actions #1

Updated by ko1 (Koichi Sasada) over 15 years ago

  • Assignee set to ko1 (Koichi Sasada)

=begin

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r18357.
=end

Actions #3

Updated by rogerdpack (Roger Pack) over 15 years ago

=begin
It now no longer segfaults.
irb(main):002:0> RubyParser.new.parse "1+1"
NoMethodError: undefined method old_initialize' for #<StringIO:0x618cd0> from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:2617:in old_initialize'
from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:2617:in initialize' from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:48:in new'
from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:48:in parse' from (irb):2 from /Users/rogerpack/dev/ruby_19_installed/bin/irb19:12:in '

But may have revealed another bug. Should I file another bug report?
Thanks!
-R
=end

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

=begin
Hi,

At Fri, 8 Aug 2008 02:01:42 +0900,
Roger Pack wrote in [ruby-core:18171]:

It now no longer segfaults.
irb(main):002:0> RubyParser.new.parse "1+1"
NoMethodError: undefined method old_initialize' for #<StringIO:0x618cd0> from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:2617:in old_initialize'
from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:2617:in initialize' from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:48:in new'
from /Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/ruby_parser-1.0.0/lib/ruby_lexer.rb:48:in parse' from (irb):2 from /Users/rogerpack/dev/ruby_19_installed/bin/irb19:12:in '

But may have revealed another bug. Should I file another bug report?

It's different story.
`super' calls ancestor's method of the called name, whereas the
defined name is used in 1.8

--
Nobu Nakada

=end

Actions #5

Updated by rogerdpack (Roger Pack) over 15 years ago

=begin
Perhaps you can help me understand this -- so with StringIO you can't call an aliased constructor

require 'stringio'
class C < StringIO
alias :old_init :initialize
def initialize
old_init
end
end
C.new # fails

whereas with normal Ruby classes you can?

class A
def initialize
print 'A init'
end
end
class B < A
alias :old_init :initialize
def initialize
old_init
end
end
B.new # succeeds

Thanks!
-=R
=end

Actions #6

Updated by zenspider (Ryan Davis) over 15 years ago

=begin

On Oct 7, 2008, at 22:31 , Roger Pack wrote:

Perhaps you can help me understand this -- so with StringIO you
can't call an aliased constructor

require 'stringio'
class C < StringIO
alias :old_init :initialize
def initialize
old_init
end
end
C.new # fails

please change the title of the bug. this doesn't have to do with racc,
but with StringIO. You should also point out that this code works fine
in 1.8.

=end

Actions #7

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

=begin
Hi,

At Wed, 8 Oct 2008 14:31:00 +0900,
Roger Pack wrote in [ruby-core:19192]:

Perhaps you can help me understand this -- so with StringIO
you can't call an aliased constructor

OK, let's start a new ticket.

require 'stringio'
class C < StringIO
alias :old_init :initialize
def initialize
old_init
end
end
C.new # fails

whereas with normal Ruby classes you can?

class A
def initialize
print 'A init'
end
end
class B < A
alias :old_init :initialize
def initialize
old_init
end
end
B.new # succeeds

I don't think it desirable.

--
Nobu Nakada

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0