Skip Menu |
 

This queue is for tickets about the Crypt-HSXKPasswd CPAN distribution.

Report information
The Basics
Id: 129116
Status: open
Priority: 0/
Queue: Crypt-HSXKPasswd

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: v3.6
Fixed in: (no value)



Subject: t/02-generate-passwords.t randomly fails
Download (untitled) / with headers
text/plain 111b
Download (untitled) / with headers
text/plain 1.8k
Dne St 10.dub.2019 16:51:01, SREZIC napsal(a): Show quoted text
> See subject. A sample fail report: > http://www.cpantesters.org/cpan/report/e707bdee-5a83-11e9-97bf- > aa5646f892f4
hsxkpasswd() fails randomly. Debugging shows: ERROR - Crypt::HSXKPasswd::password(): Failed to generate password with the f ollowing error: ERROR - Crypt::HSXKPasswd::_increment_random_cache(): random function retu rned and invalid value (8.72369855642319e-06) at lib/Crypt/HSXKPasswd/Helper.pm line 368. # Crypt::HSXKPasswd::Helper::__log("ERROR", "random function returned and invalid va lue (8.72369855642319e"..., undef) called at lib/Crypt/HSXKPasswd/Helper.pm line 128 # Crypt::HSXKPasswd::Helper::_error("random function returned and invalid value (8.72369855642319e"...) called at lib/Crypt/HSXKPasswd.pm line 2000 # Crypt::HSXKPasswd::_increment_random_cache(Crypt::HSXKPasswd=HASH(0x5643727bea90)) called at lib/Crypt/HSXKPasswd.pm line 1961 # Crypt::HSXKPasswd::_rand(Crypt::HSXKPasswd=HASH(0x5643727bea90)) called at lib/Crypt/HSXKPasswd.pm line 1907 # Crypt::HSXKPasswd::_random_int(Crypt::HSXKPasswd=HASH(0x5643727bea90), 1194) called at lib/Crypt/HSXKPasswd.pm line 2031 # Crypt::HSXKPasswd::_random_words(Crypt::HSXKPasswd=HASH(0x5643727bea90)) called at lib/Crypt/HSXKPasswd.pm line 1374 # eval {...} called at lib/Crypt/HSXKPasswd.pm line 1429 # Crypt::HSXKPasswd::password(Crypt::HSXKPasswd=HASH(0x5643727bea90)) called at lib/Crypt/HSXKPasswd.pm line 1729 # Crypt::HSXKPasswd::hsxkpasswd("dictionary", Crypt::HSXKPasswd::Dictionary::EN=HASH(0x564372799550)) called at t/test.t line 25 Where t/test.t is a simplified t/02-generate-passwords.t. For some reason $self->{_RNG}->random_numbers($_CLASS->config_random_numbers_required($self->{_CONFIG})) returns a number that does not match m/^1|(0([.]\d+)?)$/sx is thus is rejected as an invalid random value.
Download (untitled) / with headers
text/plain 406b
Dne Út 09.čec.2019 04:28:10, ppisar napsal(a): Show quoted text
> For some reason $self->{_RNG}->random_numbers($_CLASS-
> >config_random_numbers_required($self->{_CONFIG})) returns a number
> that does not match m/^1|(0([.]\d+)?)$/sx is thus is rejected as an > invalid random value.
The out-of-range number comes from Math::Random::Secure::rand() called at Crypt::HSXKPasswd::RNG::Math_Random_Secure::random_numbers().
Download (untitled) / with headers
text/plain 1.2k
Dne Út 09.čec.2019 04:46:06, ppisar napsal(a): Show quoted text
> Dne Út 09.čec.2019 04:28:10, ppisar napsal(a):
> > For some reason $self->{_RNG}->random_numbers($_CLASS-
> > > config_random_numbers_required($self->{_CONFIG})) returns a number
> > that does not match m/^1|(0([.]\d+)?)$/sx is thus is rejected as an > > invalid random value.
> > The out-of-range number comes from Math::Random::Secure::rand() called > at Crypt::HSXKPasswd::RNG::Math_Random_Secure::random_numbers().
A minimal reproducer is: use Test::More tests => 1; use Crypt::HSXKPasswd; ok(eval{hsxkpasswd()}, 'password generation with defaults'); diag($@) if $@; $ while (perl -Ilib t/test.t); do :; done 1..1 ok 1 - password generation with defaults 1..1 [...] not ok 1 - password generation with defaults # Failed test 'password generation with defaults' # at t/test.t line 3. # ERROR - Crypt::HSXKPasswd::password(): Failed to generate password with the following error: ERROR - Crypt::HSXKPasswd::_increment_random_cache(): random function returned and invalid value (7.04464036971331e-05) at t/test.t line 3. # at t/test.t line 3. # Looks like you failed 1 test of 1. I'm unable to reproduce it with: use Test::More tests => 1; require Math::Random::Secure; my $n = Math::Random::Secure::rand(); like($n, qr/^1|(0([.]\d+)?)$/sx, 'In range');


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.