Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^16: Hash order randomization is coming, are you ready?

by Anonymous Monk
on Dec 04, 2012 at 11:33 UTC ( #1007071=note: print w/ replies, xml ) Need Help??


in reply to Re^15: Hash order randomization is coming, are you ready?
in thread Hash order randomization is coming, are you ready?

I have much respect for you and p5p, I mean no disrespect with my comments, I'm grateful for perl, but please listen to the stinkers now while its early :) sometimes they have points, even if they don't understand the topic thoroughly

:) I came up with those links (after I noticed my earlier "What?" got --), and its lacking a lot of details -- I guess I just don't get it. I'm not quite ready to call it garbage like BrowserUk , but I'm certainly thinking about it :) new smells aren't pleasant

I'm thinking this change is one of those things I think should be delayed for at least another 5 years until warnings can warn you about it, and the docs contain something more demonstrative , and aren't set to permanent limbo mode (forgive my lack of precision in my wording)

"Don't depend on this" is beginning to chafe, grate even :) why not a hash pragma so it DWIMs (whatever that would be)?

Also, when claims are made about performance in the docs, link to it, for example Switch perl's hash function to MurmurHash-32 (v3) and hash randomization by default. perl5-porters ActiveState List Archives

I thought we had "per process hash randomization" from 5.8.1, and nothing I linked earlier describes something new/different -- this thread makes it sound its more random than that -- yup, I don't get it, docs aren't clear

Reading that PERL_HASH_SEED now takes a hex value instead? Code parsing this output, should it exist, must change to accomodate the new format. ? Change for the sake of change?

Yup, I hate that variable now :) ${magic variables}-- I think I'm onto something with the hash pragma idea and delaying introduction -- improve the docs/interface while its new and you know what its all about

I have much respect for you and p5p, I mean no disrespect with my comments, I'm grateful for perl, but please listen to the stinkers now while its early :) sometimes they have points, even if they don't understand the topic thoroughly


Comment on Re^16: Hash order randomization is coming, are you ready?
Re^17: Hash order randomization is coming, are you ready?
by ikegami (Pope) on Dec 04, 2012 at 11:53 UTC

    I thought we had "per process hash randomization" from 5.8.1, and nothing I linked earlier describes something new/different

    Until 5.18, only some hashes are randomized (with a per-process seed). Starting with 5.18, all hashes will be randomized (with a per-process seed).

    From a programmer's perspective, nothing has changed. It means you can't rely on the order in which the keys of a hash a returned by keys (except the documented exception). This is nothing new, yet dmq's change caused many distributions on CPAN to start failing. (The problems tended to be with the tests themselves, not the modules being tested.)

      Actually so far its about 1/4 real bugs, 3/4 test bugs.

      The real bugs have tended to be deep ones that would be really hard to debug without hash randomization but are pretty obvious with it.

      ---
      $world=~s/war/peace/g

      From a programmer's perspective, nothing has changed. It means you can't rely on the order in which the keys of a hash a returned by keys (except the documented exception).

      If the few of p5p are to make changes that can break the code of the many perl users, even if those breakages come as a result of dependence -- accidental or otherwise -- upon long-term actual -- if undocumented -- behaviour, is it unreasonable to ask that the reasoning behind the change that causes that breakage be publicly known?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

        Your question supposes that this change actually breaks something. It doesn't. Any code that was correct in the first place, which makes no assumptions about the order of keys returned from a hash will continue to work just as well as it did before. Code that already was broken, albeit perhaps subtly, will now regularly fail.

        While I am aware this will cause some temporary turbulence our community and the software we run will be the better for it.

        ---
        $world=~s/war/peace/g

        As I understand it, any packages broken by this change are not relying on undocumented behaviour; they're relying on behaviour which is documented as being unreliable.

        perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007071]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-12-26 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls