Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Missing or uninitialized constant: Racc::Parser::Racc_Runtime_Core_Id_C (NameError) #1571

Closed
txus opened this Issue · 5 comments

4 participants

@txus
Collaborator

I have a parser written using racc 1.4.7, and when trying to run it, I get this error:

Missing or uninitialized constant: Racc::Parser::Racc_Runtime_Core_Id_C (NameError)

After bisecting, the last working commit is d1ac070 and the first failing commit is be05097 (its next).

I remember there was an issue about this, someone did some refactoring but missed merging a part related to C extensions. I recall @brixen commenting it and some time later it was fixed (but I guess something did not work). I'm sorry but I can't remember which issue it was and I haven't been able to find it through Rubinius issues. Does this ring any bells?

@txus
Collaborator

As an update, apparently it has to do with separating codeloader.rb into codeloader{18,19}.rb (also, it fails using 1.9 mode).

@jfirebaugh
Collaborator

Can you provide a failing code sample?

@LTe

@jfirebaugh

rvm install rbx-head
rvm rbx-head
gem install brakeman
git clone git://github.com/diaspora/diaspora.git
brakeman ./diaspora

And you should get

[Notice] Detected Rails 3 application
Loading scanner...
An exception occurred running /home/lite/.rvm/gems/rbx-head/bin/brakeman
    Missing or uninitialized constant: Racc::Parser::Racc_Runtime_Core_Id_C (NameError)

Backtrace:
                    Module(Class)#const_missing at kernel/common/module.rb:468
           Racc::Parser.__class_init__ (Parser) at /home/lite/.rvm/gems/rbx-head/gems/racc-1.4.8/lib/racc/parser.rb:41
                    Racc.__module_init__ (Racc) at /home/lite/.rvm/gems/rbx-head/gems/racc-1.4.8/lib/racc/parser.rb:31
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/gems/racc-1.4.8/lib/racc/parser.rb:25
                   Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
  Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:631
                         Kernel(Object)#require at /home/lite/.rvm/rubies/rbx-head/lib/rubygems/custom_require.rb:55
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/ruby_parser/ruby_parser_extras.rb:2
                   Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
   Kernel(Class)#gem_original_require (require) at kernel/common/kernel.rb:631
                          Kernel(Class)#require at /home/lite/.rvm/rubies/rbx-head/lib/rubygems/custom_require.rb:55
     Ruby18Parser.__class_init__ (Ruby18Parser) at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/ruby_parser/ruby18_parser.rb:12
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/ruby_parser/ruby18_parser.rb:8
                   Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
  Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:631
                         Kernel(Object)#require at /home/lite/.rvm/rubies/rbx-head/lib/rubygems/custom_require.rb:55
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/ruby_parser/ruby_parser.rb:3
                   Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
  Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:631
                         Kernel(Object)#require at /home/lite/.rvm/rubies/rbx-head/lib/rubygems/custom_require.rb:55
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/brakeman/scanner.rb:5
                   Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
  Kernel(Module)#gem_original_require (require) at kernel/common/kernel.rb:631
                         Kernel(Module)#require at /home/lite/.rvm/rubies/rbx-head/lib/rubygems/custom_require.rb:55
                                  Brakeman.scan at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/brakeman.rb:245
                                   Brakeman.run at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/lib/brakeman.rb:55
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/gems/brakeman-1.6.2/bin/brakeman:60
                            Kernel(Object)#load at kernel/common/kernel.rb:580
                              Object#__script__ at /home/lite/.rvm/gems/rbx-head/bin/brakeman:23
               Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:68
               Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:110
                        Rubinius::Loader#script at kernel/loader.rb:614
                          Rubinius::Loader#main at kernel/loader.rb:817
@LTe LTe referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@LTe LTe referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@LTe LTe referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@LTe LTe referenced this issue from a commit in LTe/rubinius
@LTe LTe Rubinius load file twice when first time developer require with .rb
Before patch when user require file with .rb suffix Rubinius recognize
file as :ruby type and execute method :verify_load_path from
Rubinius::CodeLoader. In this method interpreter interate via $LOAD_PATH
and search for proper file. After that Rubinius add to $LOADED_FEATURES
relative path. But when developer require witout .rb suffix Rubinius
execute another method (because interpreter need guess extension).
Method without .rb suffix add to $LOADED_FEATURES only short file path.

Example

require 'ruby.rb'
$LOADED_FEATURES # => ["./ruby.rb"]

require 'ruby'
$LOAD_FEATURES # => ["ruby.rb"]

In this way, the interpreter can load file twice.

After patch:

require 'ruby.rb'
$LOADED_FEATURES # => ["ruby.rb"]

require 'ruby'
$LOAD_FEATURES # => ["ruby.rb"]

* Fixes #1788
* Fixes #1571
71a2efb
@dbussink dbussink closed this in c520d3b
@txus txus reopened this
@txus
Collaborator

I'm seeing this issue again but only when using the Racc gem (not the stdlib version), here's a gist to reproduce it.

@dbussink
Owner

I'm closing this one since this was caused by both parts missing in the C-API that have been added and the remaining issue that that uncovered is specified in #1881.

@dbussink dbussink closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.