[rust-dev] Stack usage of green tasks

Chandru chandru.in at gmail.com
Wed Jul 9 05:13:09 PDT 2014


This piece of code,

extern crate green;

use std::io::timer;
use std::task::TaskBuilder;


fn main() {
for _ in range(0, 10000i) {
TaskBuilder::new().stack_size(20*1024).spawn(proc() {

fails with,

task '<unknown>' has overflowed its stack
Illegal instruction (core dumped)

Changing the stack size to 21K works. Why does such a trivial task overflow
20K of stack?

Chandra Sekar.S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140709/f025d81e/attachment.html>

More information about the Rust-dev mailing list