[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



Hi,

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
parameter.

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,

	Cédric

Attachment: signature.asc
Description: Digital signature


Reply to: