in reply to Re^7: Can't spawn "cmd.exe":
in thread Can't spawn "cmd.exe":

The OS does not assign negative values "a special meaning"

I never said it did. The code I posted comes from Perl's win32/win32.c, not the OS. Negative values returned from Perl's win32_spawn mean the spawn failed.

Equally, the OS returns 32-bits of information. Perl reduces this to 8-bits.

No. As shown, that never occurs when you get that warning.

Replies are listed 'Best First'.
Re^9: Can't spawn "cmd.exe":
by BrowserUk (Patriarch) on Mar 19, 2009 at 14:02 UTC

    Oh for goodness sake. Both statements I made are correct.

    Negative values returned from Perl's win32_spawn mean the spawn failed.

    And (as I said), that is an error in Perl's handling of Win32 exit values. It assigns meaning to the sign bit of the return value that means it later (in the code you posted) cannot tell the difference between it's own internal "spawn failed" flag value, and legitimate process exit values.

    That is, as I keep having to state, an error in perl's handling of Win32 exit codes.

    As shown, that never occurs when you get that warning.

    I didn't make any statement about when that reduction occured. And quite frankly I don't give a toss about your misinterpretation of what I did say.

    But I will point out that by the time the message is output, a partial truncation, ovewrite or mis-interpretation of the sign bit of the process return value has already occured. Indeed, it is for that very reason the message is displayed when it should not be.

    Ie. Although win32_spawn() knows that the CreateProcess() succeeded, when it passes back the process exit value to it's calling code, if that exit code in negative, then the calling code cannot distinguish that legitimate value from the -1 'flag value' that win32_spawn() returns when the CreateProcess() fails.

    So, both statements I made are correct. And your characterisation of those statements as "quite wrong" is quite wrong.

    Wanna go again?


    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.

      That is, as I keep having to state, an error in perl's handling of Win32 exit codes.

      You really don't and should stop. I heard you the first three times, and I agreed with you every time. I haven't said anything to contradict this. Quite the opposite, I showed how it's true.

      I didn't make any statement about when that reduction occured.

      What did you mean by

      "The problem is with Perl's handling of Windows return codes. Trying to force fit a 32-bit signed int into an unsigned char doesn't go :)"

      if you didn't mean

      "The problem is with Perl forcing the Windows exit code into an unsigned char."

      That doesn't even occur, so it can't be the problem. Whatever you *meant*, what you *said* was wrong.

        What did you mean by ...

        Exactly what I said. Nothing less and nothing more.

        There are two sentences. Both are correct.

        Your continued attempts to find some flaw in them is getting boring.

        Whatever you *meant*, what you *said* was wrong.

        I meant what I said. And nothing I said is wrong.


        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.