Skip to content
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

tera_templates bug: thread '<unknown>' has overflowed its stack #309

Closed
junhwong opened this issue Jun 5, 2017 · 11 comments
Closed

tera_templates bug: thread '<unknown>' has overflowed its stack #309

junhwong opened this issue Jun 5, 2017 · 11 comments
Labels
upstream An unresolvable issue: an upstream dependency bug

Comments

@junhwong
Copy link

junhwong commented Jun 5, 2017

  1. Rocket version 0.2.8 ,tera version0.7.2(github current version 0.10)

  2. windows 10

  3. Includes Lots of TAGS in template,e.g:

<row r="{{lines_count+18}}" spans="1:11" s="5" customFormat="1" x14ac:dyDescent="0.15">
    <c r="D{{lines_count+18}}" s="6"/>
    <c r="E{{lines_count+18}}" s="6"/>
    <c r="F{{lines_count+18}}" s="6"/>
    <c r="G{{lines_count+18}}" s="6"/>
    <c r="H{{lines_count+18}}" s="6"/>
    <c r="I{{lines_count+18}}" s="6"/>
  </row>
  <row r="{{lines_count+19}}" spans="4:9" s="5" customFormat="1" x14ac:dyDescent="0.15">
    <c r="D{{lines_count+19}}" s="6"/>
    <c r="E{{lines_count+19}}" s="6"/>
    <c r="F{{lines_count+19}}" s="6"/>
    <c r="G{{lines_count+19}}" s="6"/>
    <c r="H{{lines_count+19}}" s="6"/>
    <c r="I{{lines_count+19}}" s="6"/>
  </row>
  <row r="{{lines_count+20}}" spans="4:9" s="5" customFormat="1" x14ac:dyDescent="0.15">
    <c r="D{{lines_count+20}}" s="6"/>
    <c r="E{{lines_count+20}}" s="6"/>
    <c r="F{{lines_count+20}}" s="6"/>
    <c r="G{{lines_count+20}}" s="6"/>
    <c r="H{{lines_count+20}}" s="6"/>
    <c r="I{{lines_count+20}}" s="6"/>
  </row>
  1. cago run, bug: thread '' has overflowed its stack
@SergioBenitez
Copy link
Member

Can you post the full backtrace?

@junhwong
Copy link
Author

junhwong commented Jun 5, 2017

sry, I do not know how to get backtrace.

@cafeclimber
Copy link

RUST_BACKTRACE=1 cargo <build, run, etc>

@junhwong
Copy link
Author

junhwong commented Jun 5, 2017

I set RUST_BACKTRACE=1 but still the same。

set RUST_BACKTRACE=1
cargo run

@cafeclimber
Copy link

I think @SergioBenitez might have meant posting the error in its entirety instead of just the bit saying that the the thread's stack overflowed. Outside of that, I didn't see you were using Win10. If you're in powershell, it looks like you can do

$env:RUST_BACKTRACE = 1

to get the full stack trace.

@junhwong
Copy link
Author

junhwong commented Jun 5, 2017

@SergioBenitez @cafeclimber i tried set RUST_BACKTRACE=1 It is effectived, but Rocket seems to intercept the error or what is hidden。

@SergioBenitez
Copy link
Member

@junhwong Can you copy/paste the full output you're getting in your terminal? Including everything that is logged? You should run the command RUST_BACKTRACE=1 cargo run.

@junhwong
Copy link
Author

junhwong commented Jun 5, 2017

this test case 1:

...>cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target\debug\poms.exe`
thread 'main' panicked at 'This function never returns!', src\main.rs:115
stack backtrace:
   0: std::sys_common::backtrace::_print
             at C:\projects\rust\src\libstd\sys_common\backtrace.rs:71
   1: std::panicking::default_hook::{{closure}}
             at C:\projects\rust\src\libstd\panicking.rs:354
   2: std::panicking::default_hook
             at C:\projects\rust\src\libstd\panicking.rs:371
   3: std::panicking::rust_panic_with_hook
             at C:\projects\rust\src\libstd\panicking.rs:549
   4: std::panicking::begin_panic<&str>
             at C:\projects\rust\src\libstd\panicking.rs:511
   5: poms::main
             at .\src\main.rs:115
   6: panic_unwind::__rust_maybe_catch_panic
             at C:\projects\rust\src\libpanic_unwind\lib.rs:98
   7: std::rt::lang_start
             at C:\projects\rust\src\libstd\rt.rs:52
   8: main
   9: __scrt_common_main_seh
             at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
  10: BaseThreadInitThunk
error: process didn't exit successfully: `target\debug\xxx.exe` (exit code: 101)


this case normal(project):

...>cargo run
   Compiling xxx v0.1.0 (file:///...)

    Finished dev [unoptimized + debuginfo] target(s) in 17.72 secs
     Running `target\debug\xxx.exe`
🔧  Configured for development.
    => address: 0.0.0.0
    => port: 3000
    => log: normal
    => workers: 4
🛰  Mounting '/': ...
🚀  Rocket has launched from http://0.0.0.0:3000...
GET /api/produce:
    => Matched: GET /api/produce

thread '<unknown>' has overflowed its stack
error: process didn't exit successfully: `target\debug\xxx.exe` (exit code: 3221225725)

@freinn
Copy link

freinn commented Jun 6, 2017

The normal situation when you are getting that error is recursion. Check if you are recursing in your code and try to:

  1. get rid of it.
  2. use in a way that works.

@SergioBenitez
Copy link
Member

@junhwong If you make your template shorter (IE, cut in half or so), does the error go away? If so, this would mean that it's purely a Tera issue.

@junhwong
Copy link
Author

junhwong commented Jun 7, 2017

@SergioBenitez Yes. it is a Tera bug and report to Keats/tera#185

@SergioBenitez SergioBenitez added upstream An unresolvable issue: an upstream dependency bug and removed triage A bug report being investigated labels Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An unresolvable issue: an upstream dependency bug
Projects
None yet
Development

No branches or pull requests

4 participants