Skip to content

Commit 3609439

Browse files
committed
---
yaml --- r: 15419 b: refs/heads/try c: b42c6d0 h: refs/heads/master i: 15417: 1d0cfed 15415: 636e3ec v: v3
1 parent 0354fce commit 3609439

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: a1d59704ed12282e7f00c137e03538bc397fc8e3
5+
refs/heads/try: b42c6d07dc4b1aeb66901bd29b14ab34f9ef1183
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/rust_task.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,17 @@ rust_task::new_stack(size_t requested_sz) {
514514

515515
if (total_stack_sz + rust_stk_sz > kernel->env->max_stack_size) {
516516
LOG_ERR(this, task, "task %" PRIxPTR " ran out of stack", this);
517-
fail();
517+
if (!unwinding) {
518+
fail();
519+
} else {
520+
// FIXME: Because we have landing pads that may need more
521+
// stack than normally allowed we have to go allow the stack
522+
// to grow unbounded during unwinding. Would be nice to
523+
// have a different solution - maybe just double the limit.
524+
LOG_ERR(this, task, "task %" PRIxPTR " has blown its stack "
525+
"budget but we are unwinding so growing the stack "
526+
"anyway");
527+
}
518528
}
519529

520530
size_t sz = rust_stk_sz + RED_ZONE_SIZE;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// error-pattern:ran out of stack
2+
3+
// Don't leak when the landing pads need to request more stack
4+
// than is allowed during normal execution
5+
6+
fn useBlock(f: fn~() -> uint) { useBlock({|| 22u }) }
7+
fn main() {
8+
useBlock({|| 22u });
9+
}

0 commit comments

Comments
 (0)