esp-iot-bridge icon indicating copy to clipboard operation
esp-iot-bridge copied to clipboard

Crash wen SPIRAM is on (AEGHB-334)

Open franz-ms-muc opened this issue 2 years ago • 8 comments

Crash wen SPIRAM is on

See Log:

https://gist.github.com/franz-ms-muc/8686894498e76fa004879489331b5a3b

running:

https://github.com/franz-ms-muc/esp-iot-bridge/tree/running!

crashing:

https://github.com/franz-ms-muc/esp-iot-bridge/tree/crashing!

franz-ms-muc avatar Aug 07 '23 17:08 franz-ms-muc

Hello, may I ask which version of the idf you are using? I recommend trying with idf version 5.0.

tswen avatar Aug 08 '23 04:08 tswen

me still on 4 didnt notice no problems. only that it leak of memory when x users are connected.. :)

m5it avatar Aug 08 '23 12:08 m5it

In general, whenever a child node connects to the hotspot of a parent node, the parent node will consume nearly 2k of memory. This is a necessary consumption on the Wi-Fi side, and I'm not sure if the memory leak you mentioned refers to this memory consumption.

tswen avatar Aug 09 '23 03:08 tswen

Hello, may I ask which version of the idf you are using? I recommend trying with idf version 5.0.

ESP-IDF Release v5.1

let me go for a test with

ESP-IDF Release v5.0.3

so, result is that it is same. still crash when spiram on.

franz-ms-muc avatar Aug 09 '23 06:08 franz-ms-muc

i will test with 4.4.5 as well. ..

not crash even with SPIRAM on. https://github.com/franz-ms-muc/esp-iot-bridge/tree/feature/wifi_router2

https://gist.github.com/franz-ms-muc/d26679ce9be867906195575d6d4526bc

franz-ms-muc avatar Aug 09 '23 07:08 franz-ms-muc

there is still a Bug inside when using 4.4.5

see: https://github.com/franz-ms-muc/esp-iot-bridge/blob/ce247a249bc450469f42eb60fbd34b2d399e3800/main/app_main.c#L142 https://gist.github.com/franz-ms-muc/d999eb38eda77a0ab76bb2ca3220c935

after running the Sample all SPIRAM is gone, even if we have a lot before:

before: MALLOC_CAP_: 8bit 4454202, 32bit 4488546, SPIRAM 4192135 after: MALLOC_CAP_: 8bit 99880, 32bit 134224, SPIRAM -247

so something consumes away the SPIRAM. so i guess Problem always same, just the crash not happening in 4.4.5, because little bit under the Limit.

franz-ms-muc avatar Aug 09 '23 07:08 franz-ms-muc

In general, whenever a child node connects to the hotspot of a parent node, the parent node will consume nearly 2k of memory. This is a necessary consumption on the Wi-Fi side, and I'm not sure if the memory leak you mentioned refers to this memory consumption.

no. it is crashing without anybody has connected, directly at boot up.

franz-ms-muc avatar Aug 09 '23 07:08 franz-ms-muc

there is still a Bug inside when using 4.4.5

see: https://github.com/franz-ms-muc/esp-iot-bridge/blob/ce247a249bc450469f42eb60fbd34b2d399e3800/main/app_main.c#L142 https://gist.github.com/franz-ms-muc/d999eb38eda77a0ab76bb2ca3220c935

after running the Sample all SPIRAM is gone, even if we have a lot before:

before: MALLOC_CAP_: 8bit 4454202, 32bit 4488546, SPIRAM 4192135 after: MALLOC_CAP_: 8bit 99880, 32bit 134224, SPIRAM -247

so something consumes away the SPIRAM. so i guess Problem always same, just the crash not happening in 4.4.5, because little bit under the Limit.

I conducted testing using the branch you provided and found that it seems to be the esp_bridge_create_button API that is causing SPIRAM to become negative. Could you try disabling esp_bridge_create_button on your end?

tswen avatar Aug 14 '23 09:08 tswen