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

thread 'main' has overflowed its stack #2065

Closed
dxps opened this issue Jan 2, 2023 · 11 comments
Closed

thread 'main' has overflowed its stack #2065

dxps opened this issue Jan 2, 2023 · 11 comments
Labels
bug done in pr Already done in a PR

Comments

@dxps
Copy link

dxps commented Jan 2, 2023

Bug Report

Environment

Zola version: 0.16.1
Pop!_OS 22.04 LTS (up to date, with kernel 6.0.12-76060006-generic)

Expected Behavior

zola serve should just continue working, instead of crashing.

Current Behavior

zola serve crashes.

Step to reproduce

Just quickstarting it by following the Overview doc, using the official sam.

  • in config.tml file: declared theme = "sam"
  • using theme's base.html, created templates/base.html file with this content:
{% extends "index.html" %}

{% import "macros.html" as macros %}

{% block htmltitle %}
{% endblock htmltitle %}

{% block body %}
<div class="wrap">
    <div class="section" id="title">
        {% block title %}{% endblock title %}
    </div>
    <div class="section" id="sections">
        {% block sections %}{% endblock sections %}
    </div>
    <div class="section" id="content">
        {% block content %}{% endblock content %}
    </div>
    {{ macros::bottom_menu() }}
    {{ macros::footer() }}
</div>
{% endblock body %}
  • and using theme's index.html, created templates/index.html file with this content:
{% extends "base.html" %}

{% block content %}
<h1 class="title">
    This is my blog made with Zola.
</h1>
{% endblock content %}

It crashes after saving that content into index.html file, and also at start up:

…/test_zola ❯ RUST_BACKTRACE=1 zola serve
Building site...

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)
…/test_zola took 1s❯

Hope it helps the investigation!
I'm very new to Zola, and depending on the outcome I might try to help as well.

Thanks!

@dxps
Copy link
Author

dxps commented Jan 2, 2023

Oh, I believe this is simply because each page extends the other. 🤦

I leave it here as a case for improving the behavior by reporting to the console that such setup is wrong instead of crashing due to stack overflow. If you don't want to consider it as a future enhancement, you may close it.

Last but not least, many thanks to this community for creating Zola. 🙏
Today, I started using it as the SSG for my GitHub Pages. 🥳

@Keats
Copy link
Collaborator

Keats commented Jan 2, 2023

Weird that Tera is not catching that though!

@0xcrypto
Copy link

0xcrypto commented Aug 26, 2023

Facing the same error in Zola v0.17.2 windows build. Same site using Zola v0.17.2 is building fine on Fedora and Ubuntu (Github Actions).

zola serve and zola build both give following error:

PS D:\> zola serve
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 43 pages (0 orphan) and 2 sections

thread 'main' has overflowed its stack

I am not using macros or shortcodes. Only 4 taxonomies and one taxonomy is iterated for pages on home page. zola serve works fine for a new blank site.

@Keats
Copy link
Collaborator

Keats commented Aug 27, 2023

Is it the same case? Do you have templates extending each other?

@0xcrypto
Copy link

0xcrypto commented Aug 28, 2023

Is it the same case? Do you have templates extending each other?

Templates extending each other, no. Just extending base.html in index.html and page.html. Code is available at https://github.com/0xcrypto/0xcrypto.github.io if you wanna take a look. I have now added macros but only after reporting this error.

Unfortunately I wont be able to test again on windows or provide much information as my m.2 SSD having Windows is dead (different issue).

@Keats Keats added the bug label Aug 30, 2023
@Keats
Copy link
Collaborator

Keats commented Aug 30, 2023

I can reproduce it with the next version so it's not OS related.

@0xcrypto
Copy link

I can reproduce it with the next version so it's not OS related.

I used same codebase, same versions (0.17.2) on Linux and Windows though. In linux it works, in windows it does not.

@Keats
Copy link
Collaborator

Keats commented Aug 31, 2023

ah I tested on Mac

@0xcrypto
Copy link

0xcrypto commented Dec 7, 2023

Tried again today, didn't work in Windows but worked fine in WSL (Kali Linux).

Keats added a commit that referenced this issue Dec 7, 2023
@Keats
Copy link
Collaborator

Keats commented Dec 7, 2023

That should be fixed on the next branch

@Keats Keats added the done in pr Already done in a PR label Dec 7, 2023
@0xcrypto
Copy link

0xcrypto commented Dec 8, 2023

Thank you @Keats, next is working!

@Keats Keats closed this as completed in 74b06d7 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

3 participants