diff --git a/qa/kern/broken.c b/qa/kern/broken.c new file mode 100644 index 0000000..5098929 --- /dev/null +++ b/qa/kern/broken.c @@ -0,0 +1,25 @@ +/* + * This file is part of Jehanne. + * + * Copyright (C) 2017 Giacomo Tesio + * + * Jehanne is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2 of the License. + * + * Jehanne 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 the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jehanne. If not, see . + */ +#include +#include + +void +main(void) +{ + abort(); +} diff --git a/qa/kern/broken.runner b/qa/kern/broken.runner new file mode 100755 index 0000000..2031d8e --- /dev/null +++ b/qa/kern/broken.runner @@ -0,0 +1,24 @@ +#!/cmd/rc + +runner=$0 +test = `{echo $runner|sed 's/.runner//'} +test_output = /tmp/output-`{basename $test} + +if ( test -e $test_output) rm $test_output + +$test > $test_output >[2=1] & +testpid=$apid + +sleep 3 + +wait $testpid + +if ( cat $test_output | grep suicide > /dev/null ) { + rm $test_output + echo PASS + exit PASS +} +cat $test_output +echo FAIL +exit FAIL + diff --git a/qa/kern/build.json b/qa/kern/build.json index 3bc6203..c9cb96c 100644 --- a/qa/kern/build.json +++ b/qa/kern/build.json @@ -15,6 +15,7 @@ "awake_note0.c", "awake_note1.c", "brk.c", + "broken.c", "execl.c", "float.c", "fork.c", diff --git a/sys/src/kern/port/proc.c b/sys/src/kern/port/proc.c index 05b5826..74afb10 100644 --- a/sys/src/kern/port/proc.c +++ b/sys/src/kern/port/proc.c @@ -1057,6 +1057,9 @@ addbroken(Proc *p) broken.p[broken.n++] = p; qunlock(&broken); + dumpaproc(p); + dumpregs(p->dbgreg); + p->state = Broken; p->psstate = 0; sched();