Crash issues with WiFi

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Crash issues with WiFi

Postby iosixllc » Thu May 04, 2017 5:35 am

I keep getting this crash, even just using WiFi station mode. I'm using essentially the same code as the WiFi powersave example. Thoughts?


I (12) boot: ESP-IDF v2.0-rc1-725-g07b61d54 2nd stage bootloader
I (12) boot: compile time 00:14:16
I (13) boot: Enabling RNG early entropy source...
I (13) qio_mode: Enabling QIO for flash chip ISSI
I (14) boot: SPI Speed : 80MHz
I (15) boot: SPI Mode : QIO
I (15) boot: SPI Flash Size : 2MB
I (16) boot: Partition Table:
I (17) boot: ## Label Usage Type ST Offset Length
I (18) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (19) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (21) boot: 2 factory factory app 00 00 00010000 00100000
I (22) boot: End of partition table
I (23) boot: Disabling RNG early entropy source...
I (24) boot: Loading app partition at offset 00010000
I (651) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512)
I (651) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x0948c ( 38028) map
I (652) boot: segment 2: paddr=0x0002949c vaddr=0x3ffb0000 size=0x02b0c ( 11020) load
I (655) boot: segment 3: paddr=0x0002bfb0 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _iram_start at ??:?

I (656) boot: segment 4: paddr=0x0002c3b8 vaddr=0x40080400 size=0x13ebc ( 81596) load
I (674) boot: segment 5: paddr=0x0004027c vaddr=0x400c0000 size=0x00000 ( 0) load
I (675) boot: segment 6: paddr=0x00040284 vaddr=0x00000000 size=0x0fd84 ( 64900)
I (676) boot: segment 7: paddr=0x00050010 vaddr=0x400d0018 size=0x46a8c (289420) map
0x400d0018: _flash_cache_start at ??:?

I (677) cpu_start: Pro cpu up.
I (678) cpu_start: Starting app cpu, entry point is 0x40080e64
0x40080e64: call_start_cpu1 at C:/ESP32/esp-idf/components/esp32/cpu_start.c:173

I (0) cpu_start: App cpu up.
I (681) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (682) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (682) heap_alloc_caps: At 3FFB7720 len 000288E0 (162 KiB): DRAM
I (683) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (684) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (686) heap_alloc_caps: At 400942BC len 0000BD44 (47 KiB): IRAM
I (687) cpu_start: Pro cpu start user code
I (714) cpu_start: Starting scheduler on PRO CPU.
Booting...
I (38) cpu_start: Starting scheduler on APP CPU.
Starting GPIO...
I (59) wifi: wifi firmware version: ba7c292
I (60) wifi: config NVS flash: enabled
I (60) wifi: config nano formating: disabled
I (73) wifi: Init dynamic tx buffer num: 32
I (73) wifi: Init dynamic rx buffer num: 64
I (73) wifi: wifi driver task: 3ffbcf5c, prio:23, stack:3584
I (73) wifi: Init static rx buffer num: 10
I (73) wifi: Init dynamic rx buffer num: 64
I (74) wifi: Init rx ampdu len mblock:7
I (74) wifi: Init lldesc rx ampdu entry mblock:4
I (74) wifi: wifi power manager task: 0x3ffc4570 prio: 21 stack: 2560
I (75) wifi: wifi timer task: 3ffc55d8, prio:22, stack:3584
I (147) phy: phy_version: 350, Mar 22 2017, 15:02:06, 0, 0
I (147) wifi: mode : sta (18:fe:34:6c:f7:c7)
I (148) wifi: sleep disable
I (148) power_save: SYSTEM_EVENT_STA_START
I (269) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (1258) wifi: state: init -> auth (b0)
I (1262) wifi: state: auth -> assoc (0)
I (1274) wifi: state: assoc -> run (10)
I (1322) wifi: connected with IOSiX, channel 11
I (2560) event: ip: 192.168.86.125, mask: 255.255.255.0, gw: 192.168.86.1
I (2560) power_save: SYSTEM_EVENT_STA_GOT_IP
I (2561) power_save: got ip:192.168.86.125

<ping happens here>

Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x400852bb PS : 0x00060733 A0 : 0x80085418 A1 : 0x3ffbf270
0x400852bb: prvInsertBlockIntoFreeList at C:/ESP32/esp-idf/components/freertos/heap_regions.c:410

A2 : 0x3ffc6a20 A3 : 0x00000000 A4 : 0xff000000 A5 : 0x80ffffff
A6 : 0x3ffb3b58 A7 : 0xffffff80 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x3ffb1370 A11 : 0x3ffc64ba A12 : 0x0000002a A13 : 0x3ffc5e24
A14 : 0x00000821 A15 : 0x00000000 SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x400852bb:0x3ffbf270 0x40085418:0x3ffbf290 0x4008796b:0x3ffbf2b0 0x400879ac:0x3ffbf2d0 0x40081c60:0x3ffbf2f0 0x4000beb2:0x3ffbf310 0x401030f8:
0x3ffbf330 0x40115489:0x3ffbf350 0x40111a6d:0x3ffbf370 0x400ec786:0x3ffbf390 0x400ed038:0x3ffbf460 0x400f4cdc:0x3ffbf480 0x400f6462:0x3ffbf4d0
0x400852bb: prvInsertBlockIntoFreeList at C:/ESP32/esp-idf/components/freertos/heap_regions.c:410

0x40085418: pvPortMallocTagged at C:/ESP32/esp-idf/components/freertos/heap_regions.c:410

0x4008796b: pvPortMallocCaps at C:/ESP32/esp-idf/components/esp32/heap_alloc_caps.c:373

0x400879ac: pvPortMalloc at C:/ESP32/esp-idf/components/esp32/heap_alloc_caps.c:307

0x40081c60: _malloc_r at C:/ESP32/esp-idf/components/newlib/syscalls.c:28

0x401030f8: pbuf_alloc at C:/ESP32/esp-idf/components/lwip/core/pbuf.c:1247

0x40115489: wlanif_input at C:/ESP32/esp-idf/components/lwip/port/netif/wlanif.c:161

0x40111a6d: tcpip_adapter_sta_input at C:/ESP32/esp-idf/components/tcpip_adapter/tcpip_adapter_lwip.c:807

0x400ec786: sta_input at ??:?

0x400ed038: sta_rx_cb at ??:?

0x400f4cdc: ppRxPkt at ??:?

0x400f6462: ppTask at ??:?


CPU halted.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Crash issues with WiFi

Postby ESP_igrr » Thu May 04, 2017 7:06 am

Looks like heap corruption / out of bound array write. Just to clarify, you see this happening when running wifi powersave example?

ESP_Sprite
Posts: 9043
Joined: Thu Nov 26, 2015 4:08 am

Re: Crash issues with WiFi

Postby ESP_Sprite » Thu May 04, 2017 7:08 am

Hard to say... the crash in the location you see usually is caused by something writing past the end of the region it malloc()ed, corrupting the linked list that is used to keep track of free memory regions. What caused that is pretty hard to say at the point of the crash, however.

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: Crash issues with WiFi

Postby iosixllc » Thu May 04, 2017 8:50 am

Thanks for the clues. I will do some more analysis. This is basically powersave example plus GPIO setup, one UART, and LED intensity variation.

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: Crash issues with WiFi

Postby BuddyCasino » Fri May 05, 2017 7:54 pm

Interesting, I just got something similar. The problem only shows in a certain phase of the application, namely in the beginning when there is a period where data is consumed more quickly than can be delivered and the buffer runs empty.

Do you have an idea how to best find out whether or not I am corrupting memory, except by looking very hard?
Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x40083a83 PS : 0x00060e33 A0 : 0x80083cab A1 : 0x3ffdafd0
A2 : 0x3ffdc3d8 A3 : 0x00060e20 A4 : 0x00060e20 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000006 A8 : 0x005f0100 A9 : 0x005f0100
A10 : 0x3ffb1c64 A11 : 0x00060e23 A12 : 0x00060e20 A13 : 0x3ffdb236
A14 : 0x00000061 A15 : 0x00000000 SAR : 0x00000019 EXCCAUSE: 0x0000001c
EXCVADDR: 0x005f0100 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x40083a83:0x3ffdafd0 0x40083cab:0x3ffdaff0 0x40087670:0x3ffdb010 0x40082278:0x3ffdb030 0x4000beca:0x3ffdb050 0x400eb29b:0x3ffdb070 0x400e4ef2:0x3ffdb0b0 0x400e0854:0x3ffdb0e0 0x400f4614:0x3ffdb100 0x40119cf8:0x3ffdb120 0x4011a114:0x3ffdb1a0 0x4011a185:0x3ffdb1d0 0x4011850f:0x3ffdb1f0 0x40116529:0x3ffdb2a0

0x40083a83: prvInsertBlockIntoFreeList at /Users/michaelboeckling/git/esp-idf/components/freertos/./heap_regions.c:410
0x40083a83: prvInsertBlockIntoFreeList at /Users/michaelboeckling/git/esp-idf/components/freertos/./heap_regions.c:410
0x40083cab: vPortFreeTagged at /Users/michaelboeckling/git/esp-idf/components/freertos/./heap_regions.c:410
0x40087670: vPortFree at /Users/michaelboeckling/git/esp-idf/components/esp32/./heap_alloc_caps.c:414
0x40082278: _free_r at /Users/michaelboeckling/git/esp-idf/components/newlib/./syscalls.c:32
0x400eb29b: esf_buf_recycle at ??:?
0x400e4ef2: ppRecycleRxPkt at ??:?
0x400e0854: esp_wifi_internal_free_rx_buffer at ??:?
0x400f4614: pbuf_free at /Users/michaelboeckling/git/esp-idf/components/lwip/core/pbuf.c:1186
0x40119cf8: lwip_recvfrom at /Users/michaelboeckling/git/esp-idf/components/lwip/api/sockets.c:3235
0x4011a114: lwip_recvfrom_r at /Users/michaelboeckling/git/esp-idf/components/lwip/api/sockets.c:3235
0x4011a185: lwip_read_r at /Users/michaelboeckling/git/esp-idf/components/lwip/api/sockets.c:3235
0x4011850f: http_client_get at /Users/michaelboeckling/Documents/eclipse/esp8266/ESP32_MP3_Decoder/components/http/./http.c:96 (discriminator 1)
0x40116529: http_get_task at /Users/michaelboeckling/Documents/eclipse/esp8266/ESP32_MP3_Decoder/components/web_radio/./web_radio.c:40

Who is online

Users browsing this forum: No registered users and 130 guests