rt: Delete the entire stack chain on task destruction
Unwinding through __morestack on 64-bit Linux seems to be no big deal, and all we have to do is free the stacks to make unwinding work with split stacks.
This commit is contained in:
@@ -178,7 +178,10 @@ rust_task::~rust_task()
|
|||||||
I(sched, ref_count == 0); // ||
|
I(sched, ref_count == 0); // ||
|
||||||
// (ref_count == 1 && this == sched->root_task));
|
// (ref_count == 1 && this == sched->root_task));
|
||||||
|
|
||||||
del_stk(this, stk);
|
// Delete all the stacks. There may be more than one if the task failed
|
||||||
|
while (stk != NULL) {
|
||||||
|
del_stk(this, stk);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct spawn_args {
|
struct spawn_args {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// xfail-test
|
// xfail-test
|
||||||
// compile-flags:--stack-growth
|
// compile-flags:--stack-growth
|
||||||
|
// error-pattern:explicit failure
|
||||||
fn getbig(i: int) {
|
fn getbig(i: int) {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
getbig(i - 1);
|
getbig(i - 1);
|
||||||
@@ -9,5 +10,5 @@ fn getbig(i: int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
getbig(10000000);
|
getbig(100000);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user