prampec / IotWebConf

ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library
MIT License
527 stars 141 forks source link

crash on AP connection #229

Open MicrodigitElettronica opened 2 years ago

MicrodigitElettronica commented 2 years ago

Hi,

I'm having a very strange (but consistent) crash using iotWebConfig in AP mode as reported below...

The strange fact is that it happens only when the connection comes from Win10 clients... no problems using Android or iOS...

I'm also using Bluetooth Classic (in particular the SPP aka Serial Port Profile) at the same time... and it seems to work even with Win10 if I disable the SPP at all.

I've spent the whole day trying to investigate this crash but with no luck at the moment... and AFAICS the heap seems ok.

Anyone else is experiencing similar issues ?

Best Regards,

          GIampaolo

--- Miniterm on COM8 115200,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- Heap Size 1: 29460
State is: 'NotConfigured' Configuration is valid...

Connection to AP. Disconnected from AP. abort() was called at PC 0x401cb593 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x4008fbc8:0x3ffcf140 0x4008fe45:0x3ffcf160 0x401cb593:0x3ffcf180 0x401cb5da:0x3ffcf1a0 0x401cacb3:0x3ffcf1c0 0x401cafea:0x3ffcf1e0 0x401cad51:0x3ffcf200 0x400d6952:0x3ffcf220 0x400d71e5:0x3ffcf260 0x400de129:0x3ffcf290 0x400d344f:0x3ffcf2b0 0x400e16b0:0x3ffcf320 0x4009196e:0x3ffcf340 #0 0x4008fbc8:0x3ffcf140 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715

1 0x4008fe45:0x3ffcf160 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715

2 0x401cb593:0x3ffcf180 in cxxabiv1::terminate(void (*)()) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:112

3 0x401cb5da:0x3ffcf1a0 in std::terminate() at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:112

4 0x401cacb3:0x3ffcf1c0 in __cxa_throw at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/eh_throw.cc:87

5 0x401cafea:0x3ffcf1e0 in operator new(unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_op.cc:54

6 0x401cad51:0x3ffcf200 in operator new[](unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_opv.cc:32

7 0x400d6952:0x3ffcf220 in WiFiUDP::parsePacket() at C:\Users\iw2ls.platformio\packages\framework-arduinoespressif32\cores\esp32/Udp.h:46

8 0x400d71e5:0x3ffcf260 in DNSServer::processNextRequest() at C:\Users\iw2ls.platformio\packages\framework-arduinoespressif32\libraries\DNSServer\src/DNSServer.cpp:62

9 0x400de129:0x3ffcf290 in iotwebconf::IotWebConf::doLoop() at lib\IotWebConf\src/IotWebConf.cpp:254

10 0x400d344f:0x3ffcf2b0 in loop() at src/main.cpp:255

11 0x400e16b0:0x3ffcf320 in loopTask(void*) at C:\Users\iw2ls.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:23

12 0x4009196e:0x3ffcf340 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:10124 load:0x40080400,len:5828 entry 0x400806a8

MicrodigitElettronica commented 2 years ago

below is a little update:

Connection to AP. [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 16 - AP_STACONNECTED [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 18 - AP_STAIPASSIGNED [V][WebServer.cpp:292] handleClient(): New client [V][Parsing.cpp:121] _parseRequest(): method: GET url: /connecttest.txt search: [V][Parsing.cpp:227] _parseRequest(): headerName: Connection [V][Parsing.cpp:228] _parseRequest(): headerValue: Close [V][Parsing.cpp:227] _parseRequest(): headerName: User-Agent [V][Parsing.cpp:228] _parseRequest(): headerValue: Microsoft NCSI [V][Parsing.cpp:227] _parseRequest(): headerName: Host [V][Parsing.cpp:228] _parseRequest(): headerValue: www.msftconnecttest.com [V][Parsing.cpp:255] _parseArguments(): args: [V][Parsing.cpp:238] _parseRequest(): Request: /connecttest.txt [V][Parsing.cpp:239] _parseRequest(): Arguments: [E][WebServer.cpp:633] _handleRequest(): request handler not found Request for www.msftconnecttest.com redirected to 192.168.4.1:80 [V][WebServer.cpp:292] handleClient(): New client [V][Parsing.cpp:121] _parseRequest(): method: GET url: /connecttest.txt search: [V][Parsing.cpp:227] _parseRequest(): headerName: Connection [V][Parsing.cpp:228] _parseRequest(): headerValue: Close [V][Parsing.cpp:227] _parseRequest(): headerName: User-Agent [V][Parsing.cpp:228] _parseRequest(): headerValue: Microsoft NCSI [V][Parsing.cpp:227] _parseRequest(): headerName: Host [V][Parsing.cpp:228] _parseRequest(): headerValue: www.msftconnecttest.com [V][Parsing.cpp:255] _parseArguments(): args: [V][Parsing.cpp:238] _parseRequest(): Request: /connecttest.txt [V][Parsing.cpp:239] _parseRequest(): Arguments: [E][WebServer.cpp:633] _handleRequest(): request handler not found Request for www.msftconnecttest.com redirected to 192.168.4.1:80 [V][WebServer.cpp:292] handleClient(): New client [E][Parsing.cpp:90] _parseRequest(): Invalid request: abort() was called at PC 0x401cf8cb on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x4008fbd4:0x3ffd1270 0x4008fe51:0x3ffd1290 0x401cf8cb:0x3ffd12b0 0x401cf912:0x3ffd12d0 0x401cefeb:0x3ffd12f0 0x401cf322:0x3ffd1310 0x401cf089:0x3ffd1330 0x400d82dd:0x3ffd1350 0x400d8b51:0x3ffd1390 0x400e1845:0x3ffd13c0 0x400d36b3:0x3ffd13e0 0x400e58e0:0x3ffd1440 0x4009197a:0x3ffd1460

Rebooting...

MicrodigitElettronica commented 2 years ago

similar issue here: https://github.com/espressif/arduino-esp32/issues/4222 mitigated (but not resolved in my case) by putting a delay after switching to softAP mode:

WiFi.softAP("XYZ"); delay(2000);