Giter Club home page Giter Club logo

Comments (3)

pguyot avatar pguyot commented on June 6, 2024 1

I wouldn't personally write it is due to the sdkconfig but rather that a workaround is to edit the sdkconfig.

I believe it is a deeper bug.

from atomvm.

petermm avatar petermm commented on June 6, 2024

I wouldn't personally write it is due to the sdkconfig but rather that a workaround is to edit the sdkconfig.

I believe it is a deeper bug.

agreed, updated issue.

from atomvm.

bettio avatar bettio commented on June 6, 2024

The crash happens inside esp-idf when calling esp_wifi_init(), and it can be reproduced enabling CONFIG_COMPILER_OPTIMIZATION_PERF=y.

It can be fixed setting as default pthread stack size (that is 3072) to the same used for main task, such as CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3584, but even a smaller value works (such as 3200).

I think that esp_wifi_init() in most firmwares around is called from main, so likely it has been tested mostly with 3584 bytes stack.

I have 2 hypothesis about this bug:

  • enabling optimizations slightly increases stack usage (such as gcc using different memory layout for stack frames, etc...)
  • increased execution speed causes a different scheduling order, that makes the network initialization running on the pthread rather than the main task

I suggest changing stack size for any created scheduler thread in order to match the same stack size used to main, so behavior is consistent independently from which scheduler has been used.

Changing sdkconfig works too, but I don't think that increasing the default size for all threads is the right thing to do.

from atomvm.

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.