[DRE-maint] Bug#633302: Bug#633302: ruby-bcrypt: FTBFS everywhere: [BUG] Segmentation fault

Cédric Boutillier cedric.boutillier at gmail.com
Thu Jul 14 15:37:06 UTC 2011


I investigated this a little bit. The problem occurs during this call:

  lambda { BCrypt::Password.create(nil) }.should_not raise_error(BCrypt::Errors::InvalidSecret)

in the password_spec.rb test file.

It seems that the value (10) of the BCrypt::Engine::DEFAULT_COST constant
is to high (at least in the case when the RUBY_PLATFORM is not java).
When BCrypt::Password.create is called with one argument, the default
value {:cost =>  BCrypt::Engine::DEFAULT_COST} is used for the second

In irb, BCrypt::Password.create(nil, :cost=> 4) works as expected, but 
BCrypt::Password.create(nil, :cost=> 10) yields a segfault of ruby.
Values less or equal to 8 work ok.

I see there is a test for cost>=GIL_UNLOCK_COST_THRESHOLD (set to 9) for
ruby1.9 in ext/mri/bcrypt_ext.c.
Lowering the value of the BCrypt::Engine::DEFAULT_COST helps passing
some tests, but it fails later (engine_spec.rb, during Engine.calibrate,
because the :cost constantly increases.

Best regards,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20110714/049e0fc2/attachment.pgp>

More information about the Pkg-ruby-extras-maintainers mailing list