develooper Front page | perl.perl5.porters | Postings from July 2020

Re: PERL_PERTURB_KEYS=2

Thread Previous | Thread Next
From:
hv
Date:
July 29, 2020 16:14
Subject:
Re: PERL_PERTURB_KEYS=2
Message ID:
202007291531.06TFVsP25765@crypt.org
demerphq <demerphq@gmail.com> wrote:
:On Wed, 29 Jul 2020 at 12:30, <hv@crypt.org> wrote:
:>
:> demerphq <demerphq@gmail.com> wrote:
:> :On Wed, 29 Jul 2020 at 00:00, <hv@crypt.org> wrote:
:> :>
:> :> demerphq <demerphq@gmail.com> wrote:
:> :> :Can you tell me what PERL_HASH_SEED_DEBUG=1 reports for you?
:> :> :
:> :> :I have a feeling your perl is built with hadh seed randomization disabled.
:> :>
:> :> % PERL_HASH_SEED_DEBUG=1 /opt/v5.32.0-d/bin/perl -e 1
:> :> HASH_FUNCTION = SBOX32_WITH_STADTX HASH_SEED = 0x986401ef56ab149158c74ee4062846bd8b8504d92918d2beaf137d90 PERTURB_KEYS = 1 (RANDOM)
:> :
:> :Ok,  I get it now. Your perl is /opt/v5.32.0-d/bin/perl. But your
:> :script references the system perl in your $PATH.
:>
:> Ah no, the script I used referenced the same perl explicitly; I reduced
:> that to 'perl' to share it in the email.
:>
:> Just to confirm I ran it using $^X instead, and again got 30 copies of
:> 'fmpdvjxiezlghkrotnyasuqwbc'. I get the same result (30 copies of some
:> string, not necessarily the same one) with several other locally installed
:> perls:
[...]
:The SBOX is being initialized from a seed with barely any bits set,
:and whose bits are very similar. This produces an SBOX whose first row
:is relatively similar to each other, and as the keys are only one byte
:their hash values are constructed from only one row of the SBOX table.
:Additionally the hash table only uses 5 bits of the hash, which
:magnifies the chance that there will be a similar order between the
:different seeds.
:
:You can add keys(%hash)=10000 and you will see the full hash for each
:value is different for each seed. It is only the low bits that are
:similar for these similar seeds.

Ok.

:> This all feels like a distraction though: it all focuses on some
:> unexpectedly deterministic results, when the bit I was asking about
:> related to the unexpectedly _non-deterministic_ results.
:
:Did you post the code that was unexpectedly non-deterministic? Maybe i
:got confused.

Not yet, I've been working on cutting down the testcase to the point I
can do so. If you want to see it anyway, the branch is at:
  https://github.com/hvds/axiom/tree/perl-perturb
Last commit (e8d8363) gets it down to 763 lines of code, with the test case
in the commit message; the preceding commit 93c48cd shows (a revert of the
fix for) the bug that led me down this path in the first place.

Hugo

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About