From: Robert Klemme Date: 2013-05-28T00:33:02+09:00 Subject: Re: Wrong child process exit status if core dump / seg fault --20cf3074b02c2c9b1d04ddb4dd93 Content-Type: text/plain; charset=ISO-8859-1 On Mon, May 27, 2013 at 4:58 PM, Alexander Schaal wrote: > I think I almost understand the problem. :-) > > $?.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 -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --20cf3074b02c2c9b1d04ddb4dd93 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Mon, May 27, 2013 at 4:58 PM, Alexander Schaal <lists@ruby-f= orum.com> wrote:
I think I almost understand the problem. :-)=

$?.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

=A0 =A0$?.to_i >> 8

I would= not normally use #to_i here since it's too unspecific. =A0Did you look= at the documentation of Process::Status? =A0Did you use methods #exitstatu= s and #termsig?
=A0
Is this a bug?

Good question. =A0Coul= d well be that it's a bug in the platform build you have. =A0As I said,= with other platforms it works.=A0

Kin= d regards

robert

--
rem= ember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
--20cf3074b02c2c9b1d04ddb4dd93--