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

Try to avoid generating a core dump in segfault Proc test #791

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions S29-os/system.t
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ subtest 'Proc.pid is set correctly' => {

# https://github.com/rakudo/rakudo/issues/3149
{
my $proc = run $*EXECUTABLE, ‘-e’,
‘use NativeCall; sub strdup(int64) is native(Str) {*}; strdup(0)’;
my $proc = run $*EXECUTABLE, ‘-e’, q:to/CODE/;
use NativeCall;

# try to avoid generating a core dump:
sub setrlimit(int32 $resource, blob8 $rlp) is native(Str) { * }
try setrlimit(4, blob8.allocate(4096, 0));

# trigger an intentional segfault:
sub strdup(int64) is native(Str) {*};
strdup(0)
CODE
throws-like { sink $proc },
X::Proc::Unsuccessful,
'Exit with a segfault makes the Proc throw in sink context';
Expand Down