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

Java::JavaLang::NullPointerException: org.jruby.RubyString.crypt( #2342

mkristian opened this issue Dec 22, 2014 · 3 comments


Copy link

on current jruby-1_7 branch
$ bin/jruby -Xnative.verbose=true -I"lib" --1.9 -I test/externals/ruby1.9 -I test/externals/ruby1.9/ruby -r ./test/ruby19_env.rb -r minitest/excludes "test/externals/ruby1.9/ruby/test_m17n_comb.rb"
Successfully loaded native POSIX impl.
Run options:

Running tests:


Finished tests in 8.964000s, 5.2432 tests/s, 8112.0036 assertions/s.

  1. Error:
@mkristian mkristian added this to the JRuby 1.7.18 milestone Dec 22, 2014
Copy link
Member Author

I did not investigate (yet) but it is there for some time and older jruby versions (1.7.16, 15 for example) but jruby-1.7.17 shows the same error.

Copy link
Member Author

ah - I forgot to mention that I am running ubuntu 14.10

enebo added a commit that referenced this issue Dec 22, 2014
Copy link

enebo commented Dec 22, 2014

So the solution to this was to have a null return raise whatever errno provides (in the case of these tests EINVAL). This seems like the most logical way to handle errors in crypt to me. MRI if it detects non-ascii salts it uses first two bytes of whatever the salt is and the or's them to make sure they fit into ascii space. Then they use that? I don't understand the reasoning behind this but I highly doubt anyone is depending on this behavior because it only works for crypt with DES which increasingly is not used by anyone. I would also be a little disturbed if I was using DES and provided a salt and then saw that the salt was not preserved in the generated crypt string.

@enebo enebo closed this as completed Dec 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants