-
-
Notifications
You must be signed in to change notification settings - Fork 926
Failure in StringScanner#scan_integer
when running the HexaPDF test suite
#8823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone
Comments
Oy vey... pretty face-palmy bug. diff --git a/ext/jruby/org/jruby/ext/strscan/RubyStringScanner.java b/ext/jruby/org/jruby/ext/strscan/RubyStringScanner.java
index c0b654d..6e6501f 100644
--- a/ext/jruby/org/jruby/ext/strscan/RubyStringScanner.java
+++ b/ext/jruby/org/jruby/ext/strscan/RubyStringScanner.java
@@ -651,7 +651,7 @@ public class RubyStringScanner extends RubyObject {
setMatched();
adjustRegisters();
- return ConvertBytes.byteListToInum(runtime, bytes, ptr, len, base, true);
+ return ConvertBytes.byteListToInum(runtime, bytes, ptr, ptr + len, base, true);
}
private void strscanMustAsciiCompat(Ruby runtime) { The parameter here is supposed to the end index, not the total length. With this the test suite runs and everything seems to pass except the digital signing stuff. I'll get this fix into the next release of strscan. |
Trivial reproduction:
There must not be tests of scanning for numbers at a non-zero offset. |
headius
added a commit
to ruby/strscan
that referenced
this issue
May 3, 2025
headius
added a commit
to ruby/strscan
that referenced
this issue
May 3, 2025
kou
pushed a commit
to ruby/strscan
that referenced
this issue
May 3, 2025
These parse methods take begin and end indices, not begin and length. A test is included. Fixes jruby/jruby#8823
matzbot
pushed a commit
to ruby/ruby
that referenced
this issue
May 8, 2025
(ruby/strscan#150) These parse methods take begin and end indices, not begin and length. A test is included. Fixes jruby/jruby#8823 ruby/strscan@9690e39e73
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I installed JRuby 10 to see if the test suite of HexaPDF runs successfully. Alas it crashes with an error.
Environment Information
jruby 10.0.0.0 (3.4.2) 2025-04-13 6ed59bc847 OpenJDK 64-Bit Server VM 21.0.6+7-Ubuntu-124.10.1 on 21.0.6+7-Ubuntu-124.10.1 +indy +jit [x86_64-linux]
Linux laptop 6.11.0-21-generic #21-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 19 16:50:40 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
To reproduce
git clone git@github.com:gettalong/hexapdf.git
gem install cmdparse geom2d openssl strscan
rake test
Expected Behavior
The test suite should run successfully.
Actual Behavior
The test suite fails with the following stack trace:
The text was updated successfully, but these errors were encountered: