Page 1 of 1

ESP32's crashes the if the SSID of the WiFi access point contains a ' symbol

Posted: Fri Nov 07, 2025 5:13 pm
by smth42699
ESP-IDF 5.3.4, No Arduino, Win10.

I've loaded an official "station" example which demonstrates how to connect ESP32 to a home wifi access point. Made only 2 changes: .ssid and .password in the wifi_config:

Code: Select all

wifi_config_t wifi_config = {
    .sta = {
        .ssid = "Jack's S22",
        .password = "1234567899999",
        .threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD,
        .sae_pwe_h2e = ESP_WIFI_SAE_MODE,
        .sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER,
    },
};
Everything compiled, flashed and ran nicely. BUT, problems began when I changed the .password from 1234567899999 to 11111111 and reflashed. ESP32 immediately crashes when it reaches the WIFI:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x401273eb  PS      : 0x00060e30  A0      : 0x80129a3e  A1      : 0x3ffbfe90
--- 0x401273eb: pmksa_cache_flush at D:/ESP-IDF/v5.3.4/esp-idf/components/wpa_supplicant/src/rsn_supp/pmksa_cache.c:254
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x00000000
A6      : 0x00000000  A7      : 0x00000056  A8      : 0xc0000000  A9      : 0x3ffbfe90
A10     : 0x00000103  A11     : 0x00000003  A12     : 0x8008a5b5  A13     : 0x3ffb9e30  
A14     : 0x00000003  A15     : 0x00000000  SAR     : 0x00000018  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffe
--- 0x400014fd: strlen in ROM
--- 0x4000150d: strlen in ROM
I ran some tests afterwards to figure out where (the likely) overflow occurs, and discovered that the ' symbol, surprisingly is the cause:

Experiment 1:
.ssid = "Jack's S22", .password = "1234567899999", Flashes and works, no crash.
Experiment 2, ran straight after Exp.1:
.ssid = "Jack's S22", .password = "11111111", Crash (LoadProhibited)
Experiment 3, ran straight after Exp.2. ' changed to a whitespace:
.ssid = "Jack s S22", .password = "11111111", Works perfectly
I tested some other variations of .ssid and .password combinations, and all the variations that contained the ' inevitably caused crashes when the new password was shorter than the old one. There is basically no information about this quirk on the internet, whether regarding ESP32 or general C/C++.

What may be the reason and how can I avoid this without having a "No ' in your SSID" requirement for the end-user?

Re: ESP32's crashes the if the SSID of the WiFi access point contains a ' symbol

Posted: Fri Nov 14, 2025 5:59 pm
by Bryght-Richard
Quite odd. I wonder if they use a ' character in the NVS storage.

Re: ESP32's crashes the if the SSID of the WiFi access point contains a ' symbol

Posted: Sun Nov 16, 2025 8:29 am
by Sprite
Quite odd. I wonder if they use a ' character in the NVS storage.
No, NVS is all data-length pairs. It's the reason you can also cram binary data in there.

Re: ESP32's crashes the if the SSID of the WiFi access point contains a ' symbol

Posted: Tue Nov 25, 2025 3:58 am
by RandomInternetGuy
Related, and including a proposed fix:
https://github.com/espressif/esp-idf/issues/17674

Alleged fixes submitted for more-than-superficially similar issues:
https://github.com/espressif/esp-idf/issues/15584
https://github.com/espressif/esp-idf/issues/15635



Even if a fix has been pushed and not backported back to 5.3, https://docs.espressif.com/projects/esp ... rt-periods shows that version is about at the halfway mark to expiration anyway.

For MOST projects, it's been my experience that migration within 5.x isn't always 100% without issues (those numbers change for a reason) but it's usually not THAT big of a deal to move to versions where this is likely to have been fixed.

ESP-IDF6 will be more entertaining. https://docs.espressif.com/projects/esp ... index.html ... and beyond the scope of what you're likely to need to try to skate past this. (I can't wait for the sound of the exploding heads of the Arduino crowd.)

Without inside information, but just gambling, and not engineering, it seems likely that moving to 5.4 or 5.5 may address this.