Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proc.exitcode is zero for processes killed by signals #5512

Closed
p6rt opened this issue Aug 1, 2016 · 4 comments
Closed

Proc.exitcode is zero for processes killed by signals #5512

p6rt opened this issue Aug 1, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 1, 2016

Migrated from rt.perl.org#128805 (status was 'open')

Searchable as RT128805$

@p6rt
Copy link
Author

p6rt commented Aug 1, 2016

From slaven@rezic.de

If an external command called by run dies with an signal, then there's no exception​:

$ perl6 -e 'run "perl", "-e", q{kill SEGV => $$}; say "should not happen"'
should not happen

I would expect something similar to​:

$ perl6 -e 'run "perl", "-e", q{exit 1}; say "should not happen"'
The spawned process exited unsuccessfully (exit code​: 1)
  in block <unit> at -e line 1

except that the explanation should say something like (signal​: SEGV) or (signal​: segmentation fault), maybe with core dump information appended.

Version info​:
perl6 --version
This is Rakudo version 2016.07.1 built on MoarVM version 2016.07
implementing Perl 6.c.

Operating system​: Debian/jessie

@p6rt
Copy link
Author

p6rt commented Aug 17, 2016

From @zoffixznet

On Mon Aug 01 13​:52​:57 2016, slaven@​rezic.de wrote​:

If an external command called by run dies with an signal, then there's
no exception​:

$ perl6 -e 'run "perl", "-e", q{kill SEGV => $$}; say "should not
happen"'
should not happen

I would expect something similar to​:

$ perl6 -e 'run "perl", "-e", q{exit 1}; say "should not happen"'
The spawned process exited unsuccessfully (exit code​: 1)
in block <unit> at -e line 1

except that the explanation should say something like (signal​: SEGV)
or (signal​: segmentation fault), maybe with core dump information
appended.

Version info​:
perl6 --version
This is Rakudo version 2016.07.1 built on MoarVM version 2016.07
implementing Perl 6.c.

Operating system​: Debian/jessie

To clarify a bit​: `run` doesn't throw exceptions. It returns a Proc object, which throws when it's sunk if the exit code is non-zero. In this case, the issue is the killed processes have 0 as their exit code​:

  $ perl6 -e 'run("perl", "-e", q{kill SEGV => $$}).exitcode.say'
  0

@p6rt
Copy link
Author

p6rt commented Aug 17, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the Bug label Jan 5, 2020
@AlexDaniel
Copy link
Member

This was fixed in (2019-09-05) rakudo/rakudo@225b1c5, a dup ticket is here: rakudo/rakudo#3149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants