develooper Front page | perl.perl5.porters | Postings from August 2018

[perl #133459] Patch for hash-split bug when building perl usingAccflags=-DPERL_PERTURB_KEYS_DISABLED

Thread Previous
James E Keenan via RT
August 22, 2018 15:23
[perl #133459] Patch for hash-split bug when building perl usingAccflags=-DPERL_PERTURB_KEYS_DISABLED
Message ID:
On Mon, 20 Aug 2018 23:42:55 GMT, wrote:
> Hi, I would like to provide a little patch that fixes a bug introduced
> somewhere around 5.26. The bug makes perl stall immediately because
> all hash
> keys will go into the same bucket, because the hash-split is broken.
> Fortunately, this bug is only triggered if you use the compile-time
> switch
> -Accflags=-DPERL_PERTURB_KEYS_DISABLED. I reckon i am the first person
> to ever
> use this switch since around 5.26! :) The patch i provided is very
> simple and
> fixes the bug by moving the in_collision flag assignment out of the
> #ifdef
> PERL_RANDOMIZE_KEYS. I think this assignment must always be included
> in the
> code, no matter if the randomize keys feature is enabled or not. It is
> important that this assignment is computed always, because the new
> hash split
> algorithm introduced somewhere around 5.26 will only split if the hash
> is 1)
> full (up to a certain level) and 2) a collision happens. If however
> the
> in_collision flag is never set, the hash will never split. So we have
> to move
> its assignment out of that #ifdef. Regards,Thomas Schweiger

Shouldn't the 2nd switch you mention be:


James E Keenan (

via perlbug:  queue: perl5 status: new

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About