async-esp-fs-webserver icon indicating copy to clipboard operation
async-esp-fs-webserver copied to clipboard

Exception 29 when reoading the web page

Open petricf opened this issue 6 months ago • 3 comments

If i reload (reload button of the web browser) it prints on the serial console an exception:

Exception` (29):
epc1=0x4000df64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: sys
sp: 3ffffcb0 end: 3fffffb0 offset: 0150
3ffffe00:  40259d53 3fff3670 00000002 40259ce8  
3ffffe10:  00000002 40259c8f 00000002 40258de4  
3ffffe20:  40258e0d 3ffffed0 3fff3670 00000016  
3ffffe30:  40256870 3ffffed0 3fff3518 3fff2f34  
3ffffe40:  3ffefaa0 3ffffed0 3ffffed0 3fff75c4  
3ffffe50:  61726c41 00656e75 00000000 4024dac8  
3ffffe60:  3fff59e0 00000000 00000000 40246289  
3ffffe70:  40252bcd 40243d80 3fff75f4 4024daee  
3ffffe80:  ffffffbf 3fff302c 3ffefab0 3fff3670  
3ffffe90:  3fff2598 0000001f 00000000 4025756b  
3ffffea0:  00000000 3fff5fcc ffffffbf 00000000  
3ffffeb0:  00000000 3fff3670 00000000 0000000f  
3ffffec0:  3fff5c54 3fff59e0 055028c1 402458de  
3ffffed0:  00000000 10310d0d 00640100 00000046  
3ffffee0:  3ffefac4 0000016d 3ffefada 3ffefab8  
3ffffef0:  3ffefae0 3ffefac4 3ffefacd 3ffefaeb  
3fffff00:  00000000 00000000 3ffefbfa 3ffefb86  
3fffff10:  3ffefaff 3ffefb1b 00000000 3ffefbdb  
3fffff20:  00000000 00000000 0000001f 00000000  
3fffff30:  3fff6394 40256fda 3fff2598 3fff5fcc  
3fffff40:  00000000 3fff3670 3fff2598 3ffefaa0  
3fffff50:  3ffefaa0 00000195 00000000 0000001f  
3fffff60:  00000000 3ffefaaa 4026a6c3 3fff2598  
3fffff70:  3ffefa94 3fffdcc0 3ffeec18 3ffeec18  
3fffff80:  00000080 3fff2598 3fffdab0 00000000  
3fffff90:  40269f87 3fffdab0 00000000 00000001  
3fffffa0:  3ffeec18 40000f49 ffffff01 40000f49  
<<<stack<<<

The exception decoder tells:

Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores
PC: 0x4000df64
EXCVADDR: 0x00000000

Decoding stack results
0x4024dac8: ip4_output_if_opt at core/ipv4/ip4.c:1572
0x40246289: tcp_seg_free at core/tcp.c:1638
0x40243d80: std::bad_alloc::~bad_alloc() at /workdir/repo/gcc-gnu/libstdc++-v3/libsupc++/bad_alloc.cc:30
0x4024daee: ip4_output_if at core/ipv4/ip4.c:1549
0x402458de: pbuf_free_LWIP2 at core/pbuf.c:786

After that the ESP8266 restarts and continues operation.

Hardware is a ESP-01 connected to an AP. Arduino IDE 2.3.6 Board: 8266 version 3.1.2 Module: Generic ESP8266

Any idea what went wrong ?

petricf avatar Jun 30 '25 16:06 petricf

Compiled for a Adafruit (WeMos) D1 mini and flashed to a D1 mini.

A reload of /edit does not throw an exception !

With a (firefox) reload of /setup an other exception is thrown:

Exception (9):
epc1=0x4021d28c epc2=0x00000000 epc3=0x00000000 excvaddr=0x000004aa depc=0x00000000

>>>stack>>>

ctx: sys
sp: 3ffffd20 end: 3fffffb0 offset: 0150
3ffffe70:  00000022 3fffa8ea 3fffa984 3fffafcc  
3ffffe80:  000004aa 00000080 3ffee984 4023dd6d  
3ffffe90:  3fff0000 00000008 3fff3640 00000000  
3ffffea0:  3fffaa8c 3fff88e4 3fffa984 4021d370  
3ffffeb0:  3fffaa78 3fffaa6c 00000017 3fff59c0  
3ffffec0:  3fff5c34 3fff59c0 3fffaa8c 3fff5c7c  
3ffffed0:  3fff88e4 3fff5c80 3fff5c81 402410c1  
3ffffee0:  402307a4 3fff3cf8 3fff5690 3fffdab0  
3ffffef0:  00000010 00000000 3fff56b8 00000030  
3fffff00:  00000000 000005c0 3ffe8680 3fff59c0  
3fffff10:  3fff5c34 3fffaaaa 3fffaa8c 40246161  
3fffff20:  00000014 3fff59c0 00000000 4023dcb9  
3fffff30:  00000000 000004c6 3ffe8680 40100ba6  
3fffff40:  40262c74 3fff847c 3fff634c 3fff63bc  
3fffff50:  3fff59c0 00000008 3fffaa8c 4023d379  
3fffff60:  3fffdc80 3fff634c 3fff847c 4023d188  
3fffff70:  40265e29 3fff634c 3fff847c 40265e3b  
3fffff80:  3fffaa9c 3fffaa8c 00000000 3fffdcb0  
3fffff90:  3fff3d38 00000000 3fff847c 40267113  
3fffffa0:  40000f49 3fffdab0 ffffff01 40000f49  
<<<stack<<<

Decoded it reads:

Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address
PC: 0x4021d28c:  is in AsyncClient::_recv(std::shared_ptr<ACErrorTracker>&, tcp_pcb*, pbuf*, int) (/home/petric/Arduino/libraries/ESPAsyncTCP/src/ESPAsyncTCP.h:103).
EXCVADDR: 0x000004aa

Decoding stack results
0x4023dd6d: memp_free at core/memp.c:383
0x4021d370:  is in AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, int) (/home/petric/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/xtensa-lx106-elf/include/c++/10.3.0/bits/shared_ptr_base.h:1324).
0x402410c1: tcp_input at core/tcp_in.c:501
0x402307a4: EspClass::setDramHeap() at /home/petric/.arduino15/packages/esp8266/hardware/esp8266/3.1.2/cores/esp8266/Esp.cpp:983
0x40246161: ip4_input at core/ipv4/ip4.c:1467
0x4023dcb9: mem_malloc at core/mem.c:210
0x40100ba6:  is in umm_free_core(umm_heap_context_t*, void*) (/home/petric/.arduino15/packages/esp8266/hardware/esp8266/3.1.2/cores/esp8266/umm_malloc/umm_malloc.cpp:642).
0x4023d379: ethernet_input_LWIP2 at netif/ethernet.c:188
0x4023d188: esp2glue_ethernet_input at glue-lwip/lwip-git.c:118
0x40265e29: ethernet_input at glue-esp/lwip-esp.c:365
0x40265e3b: ethernet_input at glue-esp/lwip-esp.c:373

Seems to be a bug in arduino esp8266 board package. Do you agree ?

If yes how to go on ?

petricf avatar Jul 01 '25 18:07 petricf

After some reading it may be that i took too much time in the callbacks. Evaluating more.

petricf avatar Jul 05 '25 22:07 petricf

To be Closed: It took too long in the async callbacks. Watchdog restarts the device.

petricf avatar Jul 14 '25 09:07 petricf