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

stack overflow serving small pyhtml page #79

Open
nicciniamh opened this issue Apr 12, 2023 · 1 comment
Open

stack overflow serving small pyhtml page #79

nicciniamh opened this issue Apr 12, 2023 · 1 comment

Comments

@nicciniamh
Copy link

This is on esp32 v2 wroom devit, micropython version 1.19.1

---- crash report ---

from microWebSrv import MicroWebSrv
import microWebTemplate

mws = None
mws = MicroWebSrv(
... [],
... 80,
... '0.0.0.0',
... '/www')
mws.Start(threaded=True)

ERROR A stack overflow in task mp_thread has been detected.

Backtrace:0x40093b5e:0x3ffd8ba0 0x400942d5:0x3ffd8bc0 0x400944a6:0x3ffd8be0 0x400952f8:0x3ffd8c50 0x
4009459c:0x3ffd8c80 0x40094552:0x3f41b184 |<-CORRUPTED

ELF file SHA256: 00495403985fb7e0

--- pyhtml file ---

e32::temperature
{{ py }} import temptask {{ end }} Temperature is {{ '{.2f}.format(temptask.temp) }}° Humidity is {{ '{:.2f}'.format(temptask.hum) }}% ---- end
@jczic
Copy link
Owner

jczic commented Apr 12, 2023

Hello @nicciniamh and thank you for your feedback.
It seems to me that this type of error when using pyhtml occurs frequently if there are too many recursive calls (functions in depth).
It is perhaps not the problem that you meet but there are great chances that the stack is exceeded in number of calls.
I think I remember, there is a variable indicating the size of the default stack depth in MicroPython that can be modified for the compilation of the firmware.
(pyhtml is greedy in stack usage).

Have you tried to use MicroWebSrv2 ?

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