Giter VIP home page Giter VIP logo

Comments (3)

mbuesch avatar mbuesch commented on July 18, 2024

Ok, I think I found the root cause.

Although the error message talks about a stack overflow in the main task, it seems to be a stack overflow in one of the threads.
The stack usage seems to have been borderline full before the update and the update seems to have slightly increased stack usage.

I did now increase the thread stacks with the sdkconfig variable CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT.
(The main task stack is controlled by CONFIG_ESP_MAIN_TASK_STACK_SIZE)

Now it doesn't crash anymore.

The error message talking about the main task made me search in the wrong direction.

from esp-idf-hal.

Vollbrecht avatar Vollbrecht commented on July 18, 2024

since you are using a lot of threads from your description you should think about defining the stack_size when building your threads. You can use https://doc.rust-lang.org/std/thread/struct.Builder.html#method.stack_size to configure your specific thread_size for any given thread you spawn, that is maybe a better approach as to just use a default stack_usage for every thread you are using.

With that said keep #233 in mind while using this

from esp-idf-hal.

mbuesch avatar mbuesch commented on July 18, 2024

Hi @Vollbrecht,

thanks a lot for the suggestion.
Indeed, dynamically setting the thread stack size on spawn time is the better solution most of the time.
I think in my case the global configuration might be fine, because I don't actually spawn any small (sub-)threads. I only use a couple of long running main threads.

However, I will check your solution. It looks cleaner. Thanks for the #233 hint. It would certainly have bitten me.

from esp-idf-hal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.