-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: thread '<unknown>' has overflowed its stack #185
Comments
Can you fork Tera master, add the failing template as a test case and see if it works? 0.7.2 is 3 versions behind so we need to see if it still happens in the current version and whether it's a Tera bug |
@Keats I have tried, can determine the use tera::Tera;
let mut ctx = tera::Context::new();
//panic!("never returns!");
let tera = compile_templates!("templates/test/*");
tera.render("index.html.tera", &ctx); |
What about the templates? Can you push a sample project that fails on github or gitlab? |
this template:
|
I've added a test with a template twice bigger than this one and I don't get the error: #186 Can you checkout this branch and create a failing test case? |
@Keats Use see test projects https://github.com/junhwong/tera_test |
Hmm both |
@junhwong Are you using windows ? I know clippy had troubles with 64 bit windows stack being too short. https://github.com/Manishearth/rust-clippy/issues/1244 might be the same kind of issue here ? |
@Eijebong @Keats try: fn main() {
use std::env;
use std::thread;
use tera::Tera;
let child = thread::Builder::new().stack_size(2 * 1024 * 1024).spawn(move || {
let mut ctx = tera::Context::new();
let tera = compile_templates!("templates/*");
tera.render("index.html", &ctx);
println!("PASSED");
}).unwrap();
println!("min_stack:{:?}", env::var("RUST_MIN_STACK"));
println!("max_cached_stacks:{:?}", env::var("RUST_CACHED_STACKS"));
child.join().unwrap();
} is passed, stack_size 2M is enough,results:
so i still can not sure the root of the problem. |
What's your rust version? Can you post the full stacktrace of the error? |
@Keats rust version is last version and error only |
The backtrace seems to be about your |
|
If really can not find the reason, then i use test repo ways for hack to complete my works! |
Maybe open a thread on https://reddit.com/r/rust or http://users.rust-lang.org/, I have no idea what's going on myself |
Did you manage to figure it out? If not I'd like to post it on http://users.rust-lang.org/ since I'd like to have it fixed for everyone |
That's weird, it seems I can reproduce it now on my machine |
@Keats Yes this is a strange question, i just hack it now and i also look forward to the solution to this problem. |
I believe this is the same issue as https://stackoverflow.com/questions/28660362/thread-main-has-overflowed-its-stack-when-constructing-a-large-tree as I use VecDeque when building the AST. (branch with failing test and some changes like using Vec instead of VecDeque in some places: https://github.com/Keats/tera/tree/overflow, |
This is apparently due to a bug in the parser lib Tera is using. This lib has a 1.0 coming soon that is almost a full rewrite and that should not present this issue. So in theory this should be fixed in the next |
Fixed as of 0.11.0-beta, sorry for the delay :o |
Hi, i use tera with Rocket, run and crash of thread '' has overflowed its stack.
pls see: rwf2/Rocket#309
The text was updated successfully, but these errors were encountered: