https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-09-01T21:45:09ZRuby Issue Tracking SystemBackport192 - Backport #5253: PTY with wait incorrectly sets exit status for exit commandhttps://bugs.ruby-lang.org/issues/5253?journal_id=205262011-09-01T21:45:09Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby master</i> to <i>Backport192</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>3</i></li><li><strong>Target version</strong> deleted (<del><i>1.9.2</i></del>)</li></ul><p>PTY.spawn should be different from Kernel#system but similar to Kernel#spawn, as its name means.<br>
So the behavior in 1.9.3 is consistent enough, and this issue would be a backport request but I think that it's trivial to change 1.9.2 now.</p> Backport192 - Backport #5253: PTY with wait incorrectly sets exit status for exit commandhttps://bugs.ruby-lang.org/issues/5253?journal_id=208122011-09-14T03:38:53Zthinkerbot (Simon Chiang)simon.a.chiang@gmail.com
<ul></ul><p>Apologies for the delay in reply, for some reason I don't get email updates even though I'm watching this ticket.</p>
<p>That is a reasonable assertion that the behavior should be consistent PTY.spawn to Kernel.spawn. I'm still curious, what is the correct behavior? Specifically, why doesn't/can't spawn return the exit status as specified by 'exit'?</p>
<p>I know in the case of system (ie /bin/sh) a 127 could be returned for a command that is not found... so maybe it's not finding exit because it's a built-in utility... but I'm not clear why returning 1 could be correct for spawn. I am confused and would appreciate clarification if you have time to explain.</p> Backport192 - Backport #5253: PTY with wait incorrectly sets exit status for exit commandhttps://bugs.ruby-lang.org/issues/5253?journal_id=208192011-09-14T09:53:07Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Hi,</p>
<p>At Wed, 14 Sep 2011 03:38:53 +0900,<br>
Simon Chiang wrote in <a href="/issues/5253">[ruby-core:39527]</a>:</p>
<blockquote>
<p>Apologies for the delay in reply, for some reason I don't get<br>
email updates even though I'm watching this ticket.</p>
</blockquote>
<p>No apologies. I've not received the post by myself too.<br>
Something didn't go fine.</p>
<blockquote>
<p>That is a reasonable assertion that the behavior should be<br>
consistent PTY.spawn to Kernel.spawn. I'm still curious, is<br>
the behavior correct? Specifically, why doesn't/can't spawn<br>
return the exit status as specified by 'exit'?</p>
</blockquote>
<p>It's not that spawn doesn't return the exit status, but that<br>
spawn failes to start non-existent programs, i.e., "exit 8" and<br>
"". You don't seem to have "/usr/bin/exit 8" file obviously.<br>
Since it can't start a new process, so it raises an exception.</p>
<blockquote>
<p>I know in the case of system a 127 can be returned for a<br>
command that is not found... so maybe it's not looking up<br>
exit because it's a built-in utility... but I'm not clear why<br>
returning 1 is could be correct for spawn. I am confused and<br>
would appreciate clarification if you have time to explain.</p>
</blockquote>
<p>It's deprecated behavior to return 127 instead of an exception.</p>
<p>--<br>
Nobu Nakada</p> Backport192 - Backport #5253: PTY with wait incorrectly sets exit status for exit commandhttps://bugs.ruby-lang.org/issues/5253?journal_id=211152011-10-04T05:14:10Zthinkerbot (Simon Chiang)simon.a.chiang@gmail.com
<ul></ul><p>Thank you for you explanation!</p> Backport192 - Backport #5253: PTY with wait incorrectly sets exit status for exit commandhttps://bugs.ruby-lang.org/issues/5253?journal_id=589322016-05-30T08:33:55Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul>