Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #36677] Parrot cannot startup if STDERR or STDOUT is closed

1 view
Skip to first unread message

Michael G Schwern

unread,
Jul 28, 2005, 12:28:17 AM7/28/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Michael G Schwern
# Please include the string: [perl #36677]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36677 >


Parrot cannot start up if either STDOUT or STDERR are closed. In both cases
it exits with 65. This problem was noticed because ponie (which uses Parrot)
would not start up if STDERR was closed.

$ perl -wle 'close STDERR; system("parrot --version"); print $? >> 8'
65
$ perl -wle 'close STDOUT; system("parrot --version"); print STDERR $? >> 8'
Parrot IO: Failed init layer(unix).

65
$ perl -wle 'system("parrot --version"); print $? >> 8'
This is parrot version 0.1.2-devel built for ppc-darwin.
Copyright (C) 2001-2005 The Perl Foundation. All Rights Reserved.

Parrot may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Parrot source kit.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
the GNU General Public License or the Artistic License for more details.

PASM/PIR compiler version 0.1.2.

0


--
Michael G Schwern sch...@pobox.com http://www.pobox.com/~schwern
You are wicked and wrong to have broken inside and peeked at the
implementation and then relied upon it.
-- tchrist in <31832.969261130@chthon>

Jerry Gay

unread,
Jul 28, 2005, 3:30:18 PM7/28/05
to perl6-i...@perl.org, parrotbug...@parrotcode.org
i've added a new test t/run/exit.t that checks parrot exit codes under
different scenarios. the 8 subtests all pass on win32.

hopefully this will reproduce the behavior you're seeing.
~jerry

Michael G Schwern

unread,
Jul 29, 2005, 5:39:39 AM7/29/05
to jerry gay via RT
On Thu, Jul 28, 2005 at 12:31:33PM -0700, jerry gay via RT wrote:
> i've added a new test t/run/exit.t that checks parrot exit codes under
> different scenarios. the 8 subtests all pass on win32.

These tests pass, and yet:

$ perl -wle 'close STDOUT; system "parrot --version"; print STDERR $? >> 8'


Parrot IO: Failed init layer(unix).

66

It appears to be your redirect which is doing it.

$ perl -wle 'close STDOUT; system "parrot --version >/dev/null 2>&1 "; print STDERR $? >> 8'
0

It must be reopening STDERR and STDOUT.

Ahh email, my old friend. Do you know that revenge is a dish that is best
served cold? And it is very cold on the Internet!

Leopold Toetsch

unread,
Jul 29, 2005, 9:05:51 AM7/29/05
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Michael G Schwern (via RT) wrote:

> Parrot cannot start up if either STDOUT or STDERR are closed.

Fixed in trunk - r8730

Now a Undef PMC is stored as the PIO STDxx PMC. This will give nice
effects if you print something.

leo

0 new messages