Ticket #834 (closed bug: fixed)

Opened 13 years ago

Last modified 12 years ago

exit opcode doesn't set process return value

Reported by: pmichaud Owned by: dukeleto
Priority: major Milestone:
Component: core Version: 1.3.0
Severity: high Keywords:
Cc: Language: perl6
Patch status: Platform:

Description

The 'exit' opcode appears to not set the process return value:

$ cat x.pir
.sub main
    exit 1
.end

$ ./parrot x.pir
$ echo $?
0

This is causing problems for many build scripts in Rakudo -- errors encountered during compilation aren't halting the build (and thus the errors are easily overlooked).

Pm

Attachments

testing-of-exit-code.patch Download (1.8 KB) - added by eirik 12 years ago.
test-exit-op.patch Download (1.0 KB) - added by eirik 12 years ago.

Change History

Changed 13 years ago by coke

This is resolved (tested in r40200). If someone can verify that a test exists (or write one), we can close this out.

Changed 12 years ago by eirik

Changed 12 years ago by eirik

Changed 12 years ago by eirik

Attached patches to support testing of the exit code of a pir program when tested with Parrot::Test and test to verify the exit operation in a pir program.

Changed 12 years ago by dukeleto

  • owner set to dukeleto

A modified version of eirik++'s patch was applied in r40658 which can test exit codes of PIR, PASM and PBC.

Changed 12 years ago by dukeleto

  • status changed from new to closed
  • resolution set to fixed

I've noticed that by default, PASM and PBC seem to exit with 1. I will create a new ticket for that.

Note: See TracTickets for help on using tickets.