Skip to content

Regular crash on async_tcp during updating labels #321

Open
@CrashOverride2

Description

@CrashOverride2

Describe the bug
If I use ESPUI in my project, I get regular crashes on async_tcp. I tried many things, like monitor stack sizes and heap space. Change task priorities and play with ASYNC_TCP settings like queue size, priority and ack time. I even used another async_tcp and AsyncWebserver lib and change ESPUI to work with that. But it is always the same.

I narrowed it down to my Update function which updates labels with values of my variables. I updated my code so it will update only five labels at one time and the uptime will be much longer, about an hour instead of minutes or seconds, but it crashes anyway.

I think it has to do with the websocket connection, if there is a label update during a transmission or something.

How can I proper update a lot of labels without crashing the ESP32 with using ESPUI?

ESPUI specific program part: https://git.bit-cloud.de/Crash_Override/NIU_CAN_BatteryChecker/src/branch/main/src/web_ui.cpp

To Reproduce
Steps to reproduce the behavior:

  1. Clone my project https://git.bit-cloud.de/Crash_Override/NIU_CAN_BatteryChecker
  2. Flash it to an ESP32 board
  3. Go into its Wifi ap and connect it to your wifi
  4. Look at the pages, actual about an hour and it will crash

Expected behavior
Not crashing if ESPUI will be used.

0 days 00:03:59
129236
[239396][I][MycilaTaskMonitor.cpp:50] log(): [MONITOR] loopTask   (p=1) 6016 bytes
[239409][I][MycilaTaskMonitor.cpp:50] log(): [MONITOR] async_tcp  (p=1) 63160 bytes
[239416][I][MycilaTaskMonitor.cpp:50] log(): [MONITOR] CANTask    (p=10) 2132 bytes
[239424][I][MycilaTaskMonitor.cpp:50] log(): [MONITOR] ControlTas (p=10) 2060 bytes
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
Debug exception reason: Stack canary watchpoint triggered (async_tcp) 
Core  1 register dump:
PC      : 0x400e36a5  PS      : 0x00060536  A0      : 0x800e3e12  A1      : 0x3ffe46e0  
A2      : 0x0000ffff  A3      : 0x3fff4390  A4      : 0x00000020  A5      : 0x0000ff00  
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x0000ffff  A9      : 0x3ffe46c0  
A10     : 0x00000000  A11     : 0x0000ffff  A12     : 0x3ffe49ac  A13     : 0x3fff4390  
A14     : 0x3fff4390  A15     : 0x3fff7834  SAR     : 0x00000016  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x4008a0b5  LEND    : 0x4008a0c5  LCOUNT  : 0xfffffffe  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions