nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.67k stars 3.13k forks source link

Double Exception causes device lockup #3401

Closed kit-klein closed 3 years ago

kit-klein commented 3 years ago

Expected behavior

When a panic occurs the device should reset and recover.

Actual behavior

The devices freezes until manually reset with the logs below being the final output.

[ERROR  1613176603.532173,   157980] /lfs/log.lua:92: E (18522) HTTP_CLIENT: Connection failed, sock < 0
[WARN   1613176603.550975,   157716] /lfs/log.lua:92: W (18542) http: esp_http_client_perform returned error 28674
[INFO   1613176604.000939,   156552] /lfs/rest_endpoint.lua:13: HTTP Call: -28674 state 1 zone 1
[INFO   1613176604.231940,   166560] /lfs/rest_endpoint.lua:13: HTTP Call: -0 state 1 retry 1 zone 1
Guru Meditation Error: Core  1 panic'ed (Double exception)
Core 1 register dump:
PC      : 0x400803c0  PS      : 0x00060936  A0      : 0x3f405cec  A1      : 0x3ffd8100  
0x400803c0: _DoubleExceptionVector at /opt/nodemcu-firmware/sdk/esp32-esp-idf/components/freertos/xtensa_vectors.S:543

A2      : 0x3ffd8170  A3      : 0x00000000  A4      : 0x00003db9  A5      : 0x00003ddb  
A6      : 0x00002aaa  A7      : 0x3ffd81a0  A8      : 0x8013aa62  A9      : 0x3ffc2e14  
A10     : 0x3ffc2d9c  A11     : 0x3ffc2e14  A12     : 0x3ffd8190  A13     : 0x3ffc2d9c  
A14     : 0x00000aaa  A15     : 0x3ffd8170  SAR     : 0x00000015  EXCCAUSE: 0x00000002  
EXCVADDR: 0x3ffc2e14  LBEG    : 0x401427a8  LEND    : 0x401427c7  LCOUNT  : 0x00000000  
0x401427a8: lookup_cache at /opt/nodemcu-firmware/components/lua/lrotable.c:58
 (inlined by) luaR_findentry at /opt/nodemcu-firmware/components/lua/lrotable.c:89

0x401427c7: lookup_cache at /opt/nodemcu-firmware/components/lua/lrotable.c:65
 (inlined by) luaR_findentry at /opt/nodemcu-firmware/components/lua/lrotable.c:89

ELF file SHA256:

This exception, and other panics, seem to occur at random when an http attempt fails followed rapidly by another http request to another server.

Test code

This seems to happen randomly.

NodeMCU startup banner

NodeMCU ESP32 - Konnected Pro 0.1.3 build 2021-02-12 19:11 powered by Lua 5.1.4 on ESP-IDF v3.3.2 on SDK IDF

We are using a very lightly modified fork of the nodemcu project - https://github.com/konnected-io/nodemcu-firmware/tree/v0.1.3

Hardware

ESP32 based Konnected Pro

marcelstoer commented 3 years ago

We are using a very lightly modified fork of the nodemcu project

Looking forward to PRs to bring your enhancements upstream 😜