As reported by Marcin Owsiany in <http://bugs.debian.org/512796>,
invoking setpgrp without any arguments could corrupt the stack.
t/op/reverse.t See if reverse operator works
t/op/runlevel.t See if die() works from perl_call_*()
t/op/rxcode.t See if /(?{ code })/ works
+t/op/setpgrpstack.t See if setpgrp works
t/op/sleep.t See if sleep works
t/op/smartmatch.t See if the ~~ operator works
t/op/sort.t See if sort works
if (MAXARG < 2) {
pgrp = 0;
pid = 0;
+ XPUSHi(-1);
}
else {
pgrp = POPi;
--- /dev/null
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+use Config;
+plan tests => 2;
+
+SKIP: {
+ skip "setpgrp() is not available", 2 unless $Config{d_setpgrp};
+ ok(!eval { package A;sub foo { die("got here") }; package main; A->foo(setpgrp())});
+ ok($@ =~ /got here/, "setpgrp() should extend the stack before modifying it");
+}