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

Accessing filesystem from threaded webserver crashes the machine #58

Closed
amotl opened this issue Jul 22, 2019 · 5 comments
Closed

Accessing filesystem from threaded webserver crashes the machine #58

amotl opened this issue Jul 22, 2019 · 5 comments

Comments

@amotl
Copy link

amotl commented Jul 22, 2019

Dear Jean-Christophe,

thanks for conceiving and maintaining this fine project.

Similar to #54, we are either getting "maximum recursion depth exceeded" exceptions or blatant "stack overflow" crashes when accessing the filesystem from a route/handler within a threaded webserver. We are using the Pycom FiPy on a recent Pycom firmware version.

Maybe you have any idea about this? Otherwise, let's keep this as a reference for other visitors.

With kind regards,
Andreas.


***ERROR*** A stack overflow in task MPThread has been detected.
abort() was called at PC 0x40099324 on core 1

Backtrace: 0x400991b3:0x3fff0870 0x4009930b:0x3fff0890 0x40099324:0x3fff08b0 0x40095a5d:0x3fff08d0 0x400976a4:0x3fff0900 0x4009765a:0x3ffdd458
[...]

================= CORE DUMP START =================
dE4AABMAAABsAQAA
[...]
================= CORE DUMP END =================
E (6171) esp_core_dump: Skipped 1 tasks with bad TCB!
E (6175) esp_core_dump: Crashed task has been skipped!
@jczic
Copy link
Owner

jczic commented Sep 8, 2019

Hello @amotl and thank you for your message.
Yes, it's a problem that occurs when there are too many functions called in recursion.
In this code, and in particular when using "template" (pyhtml), it can indeed happen :(
This max of recursion can be increased in the Firmware src (C code) but I'm thinking about writing a new micro-web-serveur using my lib : https://github.com/jczic/XAsyncSockets (all from I/O).

@amotl
Copy link
Author

amotl commented Sep 11, 2019

Dear Jean-Christophe,

thanks for taking the time to answer on our observations.

Yes, it's a problem that occurs when there are too many functions called in recursion.

Thanks for acknowledging that in this context. It tremendously helps us to see better through the fog sometimes covering the nitty gritty bottom-/system-half within MicroPython development and also helps us not to chase any ghosts ;].

In this code, and in particular when using "template" (pyhtml), it can indeed happen :(

It looks like the firmware we are currently conceiving at [1] works reasonably without any crashes right now but we would be happy to learn about the compile time constant/variable we would have to amend for MicroPython if we are running into the problem again.

I'm thinking about writing a new micro-web-serveur using my lib: https://github.com/jczic/XAsyncSockets (all from I/O).

We already spotted this guy and look very much forward to it. If time permits, we will be happy to test this library as a replacement for the current MicroWebSrv and wish you good luck for the next development iterations.

With kind regards,
Andreas.

[1] https://github.com/hiveeyes/hiveeyes-micropython-firmware

@jczic
Copy link
Owner

jczic commented Sep 11, 2019 via email

@amotl
Copy link
Author

amotl commented Oct 20, 2019

Dear Jean-Christophe,

we just recognized the release of MicroWebSrv2. We wanted to mention that we just referenced it at [1] and look very much forward getting our hands dirty with it. Until then, we want to salute you for the new release.

From giving the repository and documentation a short visit, this looks like a huge leap forward. Thanks a bunch for your continuous work on this guy!

Cheers,
Andreas.

[1] https://community.hiveeyes.org/t/http-und-webbasierte-konfiguration-des-terkin-datenloggers-zur-implementierung-eines-captive-portal/2270/25

@amotl amotl closed this as completed Oct 20, 2019
@jczic
Copy link
Owner

jczic commented Oct 20, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants