Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by ikegami (Patriarch)
on Dec 04, 2012 at 11:53 UTC ( [id://1007073]=note: print w/replies, xml ) Need Help??


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

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.)

Replies are listed 'Best First'.
Re^18: Hash order randomization is coming, are you ready?
by demerphq (Chancellor) on Dec 04, 2012 at 15:16 UTC

    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

Re^18: Hash order randomization is coming, are you ready?
by BrowserUk (Patriarch) on Dec 04, 2012 at 17:38 UTC
    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

      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'
        packages broken by this change are not relying on undocumented behaviour; they're relying on behaviour which is documented as being unreliable.

        Either way; broke is broke. No one is suggesting that the change shouldn't be implemented, but is it unreasonable to want to know what the supposed benefits are intended?


        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

        Your question supposes that this change actually breaks something. It doesn't.

        Oh. So this whole thread is predicated on the fact that this is a benign change that will not break any existing code.

        If you cannot see how ridiculous that statement is coming from the same author as started the thread ... there's no point in continuing.


        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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found