Skip to content

Failure to run tests in JRuby due to number parsing error #365

@headius

Description

@headius

This may be a bug in JRuby's strscan or number parsing, but given the peculiar error and string input, I thought I'd file it here to see if you have any thoughts.

$ rake test
ArgumentError: invalid value for Integer(): "xref\n0 8\n0000000000 65535 f \n0000000015 00000 n \n0000000064 00000 n \n0000000149 00000 n \n0000000229 00000 n \n0000000329 00000 n \n0000000396 00000 n \n0000000476 00000 n \ntrailer << /Root 1 0 R /Info 7 0 R /Size 8 /ID [<6790ffa610024e78369114311fc0df96><6790ffa610024e78369114311fc0df96>] >>\nstartxref\n523\n%%EOF\n"
             scan_base10_integer at org/jruby/ext/strscan/RubyStringScanner.java:602
                    scan_integer at /Users/headius/work/jruby/lib/ruby/gems/shared/gems/strscan-3.1.3-java/lib/strscan/strscan.rb:18
                    parse_number at /Users/headius/work/hexapdf/lib/hexapdf/tokenizer.rb:290
                      next_token at /Users/headius/work/hexapdf/lib/hexapdf/tokenizer.rb:124
  parse_xref_section_and_trailer at /Users/headius/work/hexapdf/lib/hexapdf/parser.rb:287
                   load_revision at /Users/headius/work/hexapdf/lib/hexapdf/parser.rb:243
                         from_io at /Users/headius/work/hexapdf/lib/hexapdf/revisions.rb:81
                      initialize at /Users/headius/work/hexapdf/lib/hexapdf/document.rb:195
                             new at org/jruby/RubyClass.java:1026
                          <main> at /Users/headius/work/hexapdf/test/hexapdf/encryption/test_standard_security_handler.rb:70
                     module_eval at org/jruby/RubyModule.java:4174
                     module_eval at org/jruby/RubyModule.java:4205
                        describe at /Users/headius/work/jruby/lib/ruby/gems/shared/gems/minitest-5.25.5/lib/minitest/spec.rb:95
                          <main> at /Users/headius/work/hexapdf/test/hexapdf/encryption/test_standard_security_handler.rb:65
                         require at org/jruby/RubyKernel.java:1183
                         require at /Users/headius/work/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:136
                          <main> at /Users/headius/work/jruby/lib/ruby/gems/shared/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21
                          select at org/jruby/RubyArray.java:2954
                          <main> at /Users/headius/work/jruby/lib/ruby/gems/shared/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6

I am assuming that this string is not what was intended to be parsed as an integer, but perhaps you can confirm that. Assuming I'm right, it may be a bug somewhere that is supposed to be splitting output, since there's clearly numbers there.

I'll look into this on my end for now, assuming it is a JRuby issue, but if you have any thoughts let me know.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions