Skip to content

[ripper] NPE during parsing the rspec documentation #7743

@ahorek

Description

@ahorek

Environment Information

jruby 9.4.3.0-SNAPSHOT (3.1.0) 2023-04-04 0b5918c Java HotSpot(TM) 64-Bit Server VM 15.0.2+7-27 on 15.0.2+7-27 +jit [x86_64-linux]
Linux DESKTOP-U60MURJ 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior
the gem should be installed without an error

Actual Behavior

jruby -S gem install rspec
Fetching rspec-mocks-3.12.5.gem
Fetching rspec-expectations-3.12.2.gem
Fetching rspec-support-3.12.0.gem
Fetching rspec-core-3.12.1.gem
Fetching rspec-3.12.0.gem
Fetching diff-lcs-1.5.0.gem
Successfully installed rspec-support-3.12.0
Successfully installed diff-lcs-1.5.0
Successfully installed rspec-mocks-3.12.5
Successfully installed rspec-expectations-3.12.2
Successfully installed rspec-core-3.12.1
Successfully installed rspec-3.12.0
Parsing documentation for rspec-support-3.12.0
Installing ri documentation for rspec-support-3.12.0
Parsing documentation for diff-lcs-1.5.0
Installing ri documentation for diff-lcs-1.5.0
Parsing documentation for rspec-mocks-3.12.5
Installing ri documentation for rspec-mocks-3.12.5
Parsing documentation for rspec-expectations-3.12.2
Installing ri documentation for rspec-expectations-3.12.2
Parsing documentation for rspec-core-3.12.1
Before reporting this, could you check that the file you're documenting
has proper syntax:

  /home/ahorek/testing/jruby/bin/jruby -c lib/rspec/core.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

        (Java::JavaLang::NullPointerException) Cannot invoke "org.jruby.util.ByteList.begin()" because "iso8859" is null
ERROR:  While executing gem ... (Java::JavaLang::NullPointerException)
    Cannot invoke "org.jruby.util.ByteList.begin()" because "iso8859" is null
        org.jruby.dist/org.jruby.RubySymbol.javaStringHashCode(RubySymbol.java:1423)
        org.jruby.dist/org.jruby.RubySymbol$SymbolTable.getSymbol(RubySymbol.java:1058)
        org.jruby.dist/org.jruby.RubySymbol$SymbolTable.getSymbol(RubySymbol.java:1054)
        org.jruby.dist/org.jruby.Ruby.newSymbol(Ruby.java:3527)
        org.jruby.dist/org.jruby.ext.ripper.RipperParserBase.assignable(RipperParserBase.java:357)
        org.jruby.dist/org.jruby.ext.ripper.RipperParser.lambda$static$122(RipperParser.java:2948)
        org.jruby.dist/org.jruby.ext.ripper.RipperParser.yyparse(RipperParser.java:1941)
        org.jruby.dist/org.jruby.ext.ripper.RipperParser.yyparse(RipperParser.java:1810)
        org.jruby.dist/org.jruby.ext.ripper.RipperParserBase.parse(RipperParserBase.java:95)
        org.jruby.dist/org.jruby.ext.ripper.RubyRipper.parse(RubyRipper.java:351)
        org.jruby.dist/org.jruby.ext.ripper.RubyRipper$INVOKER$i$0$0$parse.call(RubyRipper$INVOKER$i$0$0$parse.gen)
        org.jruby.dist/org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:841)
        org.jruby.dist/org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1325)
        home.ahorek.testing.jruby.lib.ruby.stdlib.ripper.lexer.invokeSuper3:parse(/home/ahorek/testing/jruby/lib/ruby/stdlib/ripper/lexer.rb:176)
        home.ahorek.testing.jruby.lib.ruby.stdlib.ripper.lexer.RUBY$method$parse$0(/home/ahorek/testing/jruby/lib/ruby/stdlib/ripper/lexer.rb:176)
        org.jruby.dist/org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139)
        org.jruby.dist/org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:149)
        org.jruby.dist/org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:148)
        org.jruby.dist/org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:212)
        org.jruby.dist/org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193)
        org.jruby.dist/org.jruby.runtime.callsite.CachingCallSite.fcall(CachingCallSite.java:199)
        home.ahorek.testing.jruby.lib.ruby.stdlib.ripper.lexer.invokeOther0:parse(/home/ahorek/testing/jruby/lib/ruby/stdlib/ripper/lexer.rb:154)
        home.ahorek.testing.jruby.lib.ruby.stdlib.ripper.lexer.RUBY$method$lex$0(/home/ahorek/testing/jruby/lib/ruby/stdlib/ripper/lexer.rb:154)
        org.jruby.dist/org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139)
        org.jruby.dist/org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:149)
        org.jruby.dist/org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:148)
        org.jruby.dist/org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:212)
        org.jruby.dist/org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193)
        home.ahorek.testing.jruby.lib.ruby.stdlib.ripper.filter.invokeOther7:lex(/home/ahorek/testing/jruby/lib/ruby/stdlib/ripper/filter.rb:61)
        home.ahorek.testing.jruby.lib.ruby.stdlib.ripper.filter.RUBY$method$parse$0(/home/ahorek/testing/jruby/lib/ruby/stdlib/ripper/filter.rb:61)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions