Skip to content
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

Array#pack difference between jruby 1.7.10 and ruby 1.9.3 #1478

Closed
dmendel opened this Issue Feb 4, 2014 · 2 comments

Comments

Projects
None yet
4 participants
@dmendel
Copy link

dmendel commented Feb 4, 2014

$ ruby --version
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]

$ ruby -e 'p [0xfffffffffffffffff].pack("C")' 
"\xFF"
$ ruby --version                                   
jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b on OpenJDK 64-Bit Server VM 1.7.0_51-b00 [linux-amd64]

$ ruby -e 'p [0xfffffffffffffffff].pack("C")'
RangeError: bignum too big to convert into `long'
    pack at org/jruby/RubyArray.java:4129
  (root) at -e:1
@sh286

This comment has been minimized.

Copy link
Member

sh286 commented Feb 6, 2014

I'll take a look on it. Thanks @dmendel

sh286 added a commit to sh286/jruby that referenced this issue Feb 7, 2014

sh286 added a commit to sh286/jruby that referenced this issue Feb 7, 2014

sh286 added a commit to sh286/jruby that referenced this issue Feb 7, 2014

@DavidEGrayson

This comment has been minimized.

Copy link
Contributor

DavidEGrayson commented Mar 18, 2014

I encountered this issue today in JRuby 1.7.11.

It is interesting compared to other JRuby bugs because it can be reproduced with so few characters:

[1<<99].pack ?C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.