$?.to_i shows me the raw 16 bit status. In theory. In my case the status
has 24 bit!
To be more precise, in my case the value is 0x860000.
--> The low byte are states like "signaled", "exited", etc... which are
all 0.
--> The high byte is the exit code. I think ruby reads ONLY the second
byte, which is 0. But my exit code is 0x8600 (core dump).
yes, I have tried all the methods. They return false or 0.
I assume that ($?.to_i >> 8) must be equal to ($?.exitstatus), but it
doesn't.
As I can see in your tests, your exit codes are <= 255. In Windows exit
codes are 32 bit, not only 8 bit (I am not sure about other platforms).
I think this is the problem. In most cases the exit codes are < 255, so
it fails only in rare cases...
$?.to_i shows me the raw 16 bit status. In theory. In my case the status
has 24 bit!
To be more precise, in my case the value is 0x860000.
--> The low byte are states like "signaled", "exited", etc... which are
all 0.
--> The high byte is the exit code. I think ruby reads ONLY the second
byte, which is 0. But my exit code is 0x8600 (core dump).
Yeah, to get the real exit code, I can use
$?.to_i >> 8
I would not normally use #to_i here since it's too unspecific. Did you
look at the documentation of Process::Status? Did you use methods #exitstatus and #termsig?
Is this a bug?
Good question. Could well be that it's a bug in the platform build you
have. As I said, with other platforms it works.
Kind regards
robert
···
On Mon, May 27, 2013 at 4:58 PM, Alexander Schaal <lists@ruby-forum.com>wrote: