Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFi(sta) crashes on ESP32 when connecting to AP under certain parameters (IDFGH-14373) #15161

Open
3 tasks done
ceribus opened this issue Jan 7, 2025 · 2 comments
Open
3 tasks done
Assignees
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@ceribus
Copy link

ceribus commented Jan 7, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.4

Espressif SoC revision.

ESP32-D0WDQ6 (revision v1.0)

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Adafruit ESP32 Feather

Power Supply used.

USB

What is the expected behavior?

When executing the sta_connect command in the example located in examples/wifi/iperf with a valid SSID and an invalid password, the ESP32 should handle the connection attempt with the invalid password gracefully and not crash.

What is the actual behavior?

When executing the sta_connect command in the example located in examples/wifi/iperf on the ESP32, with a valid SSID and an invalid password, the system crashes under certain parameters. This issue does not occur on the ESP32-C3.

Steps to reproduce.

  1. set ESP_WIFI_ENABLE_WPA3_SAE=n
  2. run sta_connect <ValidSSID> <InvalidPwd> --failure_retry=5

Debug Logs.

iperf> sta_connect <SSID> <InvalidPwd> --failure_retry=5
I (28275) WIFI: Connecting to <SSID>...
I (28278) WIFI: DONE.WIFI_CONNECT_START,OK.
iperf> I (28422) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1, snd_ch_cfg:0x0
I (28424) wifi:state: init -> auth (0xb0)
I (28429) wifi:state: auth -> assoc (0x0)
I (28436) wifi:state: assoc -> run (0x10)
I (31480) wifi:state: run -> init (0xf00)
I (31482) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1, snd_ch_cfg:0x0
I (31484) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1, snd_ch_cfg:0x0
I (31495) wifi:state: init -> auth (0xb0)

***ERROR*** A stack overflow in task wifi has been detected.


Backtrace: 0x40081ef1:0x3ffc0250 0x4008a855:0x3ffc0270 0x4008b616:0x3ffc0290 0x4008cca1:0x3ffc0310 0x4008b788:0x3ffc0340 0x4008b73a:0x00000000 |<-CORRUPTED
--- 0x40081ef1: panic_abort at [...]/esp-idf/components/esp_system/panic.c:454
0x4008a855: esp_system_abort at [...]/esp-idf/components/esp_system/port/esp_system_chip.c:92
0x4008b616: vApplicationStackOverflowHook at [...]/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:563
0x4008cca1: vTaskSwitchContext at [...]/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:3701 (discriminator 7)
0x4008b788: _frxt_dispatch at [...]/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:451
0x4008b73a: _frxt_int_exit at [...]/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:246

More Information.

sta_scan shows I (20700) WIFI: +SCAN:[MAC][SSID][rssi=-64][authmode=3][ch=1][second=0][11n] for the access point.

the code of the iperf example was not modified.

sdkconfig:

CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096

CONFIG_FREERTOS_UNICORE=n
CONFIG_FREERTOS_HZ=1000

CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n

CONFIG_LWIP_ETHARP_TRUST_IP_MAC=n
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_TCPIP_TASK_PRIO=23

CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=23
CONFIG_IPERF_REPORT_TASK_PRIORITY=24
CONFIG_COMPILER_OPTIMIZATION_PERF=y

#
# ESP32-specific
#
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP_WIFI_TX_BA_WIN=32
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP_WIFI_RX_BA_WIN=32

CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=n

CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534
CONFIG_LWIP_TCP_WND_DEFAULT=65534
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64

CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y

CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
@ceribus ceribus added the Type: Bug bugs in IDF label Jan 7, 2025
@ceribus
Copy link
Author

ceribus commented Jan 7, 2025

The issue can be reproduced in a custom application, not just in the iperf
example. The iperf example is mentioned here solely for reference purposes.

@github-actions github-actions bot changed the title WiFi(sta) crashes on ESP32 when connecting to AP under certain parameters WiFi(sta) crashes on ESP32 when connecting to AP under certain parameters (IDFGH-14373) Jan 7, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 7, 2025
@hansw123
Copy link
Collaborator

@ceribus
thanks for your report , we have reproduce your issue , we will fix the issue qucikly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants