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
From:
James E Keenan via RT
Date:
August 22, 2018 15:23
Subject:
[perl #133459] Patch for hash-split bug when building perl usingAccflags=-DPERL_PERTURB_KEYS_DISABLED
Message ID:
rt-4.0.24-30575-1534951400-754.133459-15-0@perl.org
On Mon, 20 Aug 2018 23:42:55 GMT, 11000@gmx.de 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:

PERL_HASH_RANDOMIZE_KEYS


-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133459

Thread Previous


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