boblemaire / asyncHTTPrequest

asynchronous HTTP for ESP using ESPasyncTCP. Works like XMLHTTPrequest in JS.
GNU General Public License v3.0
65 stars 31 forks source link

Fatal Exception 28 #11

Closed Legrems closed 5 years ago

Legrems commented 5 years ago

Got a fatal exception with a LOLIN D1 MINI.

................................. CONNECTED !
Debug(10376): setDebug(on)
Debug(10377): open(GET, worldtimeapi.org/api/timezone/Eu)
Debug(  1): _parseURL() HTTP://worldtimeapi.org:80/api/timezone/Europe/Zurich.txt
Debug( 57): _connect()
Debug( 82): send()
Debug(102): _buildRequest()
Debug(133): _send() 94
Debug(158): *client not connected
Debug(194): *can't send
Debug(279): _onConnect handler
Debug(280): _setReadyState(1)
Debug(286): _send() 94
Debug(311): *sent 94
Debug(389): _onData handler HTTP/1.1 200 OK
... (536)
Debug(391): _collectHeaders()
Debug(426): _setReadyState(2)
Debug(456): _setReadyState(3)
Debug(490): _onData handler :00:00+00:00
raw... (156)
Debug(545): *all data received - no disconnect
Debug(595): _setReadyState(4)
Debug(627): responseText() Debug(657): responseText() abbreviation: CE... (361)
abbreviation: CEST
client_ip: 62.2.145.206
datetime: 2019-08-14T15:53:20.600738+02:00
day_of_week: 3
day_of_year: 226
dst: true
dst_from: 2019-03-31T01:00:00+00:00
dst_offset: 3600
dst_until: 2019-10-27T01:00:00+00:00
raw_offset: 3600
timezone: Europe/Zurich
unixtime: 1565790800
utc_datetime: 2019-08-14T13:53:20.600738+00:00
utc_offset: +02:00
week_number: 33
Debug(1090): setDebug(off)
FULL_LOCK
1#2019-8-14T15:53:20

Exception (28):
epc1=0x402045de epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffdc0 end: 3fffffc0 offset: 01a0
3fffff60:  3ffe8667 3ffee5d0 4010033e 3ffee8cc  
3fffff70:  3fffdad0 00000000 3ffee5f8 4020482b  
3fffff80:  3fffdad0 00000000 3ffee5f8 40201471  
3fffff90:  3fffdad0 00000000 3ffee89c 402014d7  
3fffffa0:  3fffdad0 00000000 3ffee89c 4020814c  
3fffffb0:  feefeffe feefeffe 3ffe854c 40100931  
<<<stack<<<

Decoded :

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
PC: 0x402045de: asyncHTTPrequest::_buildRequest() at /home/legrems/Arduino/libraries/asyncHTTPrequest-master/asyncHTTPrequest.cpp line 301
EXCVADDR: 0x00000000

Decoding stack results
0x4010033e: millis() at /home/legrems/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_wiring.cpp line 186
0x4020482b: asyncHTTPrequest::send() at /home/legrems/    _request->write(_URL->scheme);/libraries/asyncHTTPrequest-master/asyncHTTPrequest.cpp line 112
0x40201471: mode_update() at /home/legrems/Documents/*/arduino/arduino.ino line 649
0x402014d7: loop() at /home/legrems/Documents/*/arduino/arduino.ino line 810
0x4020814c: loop_wrapper() at /home/legrems/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 125

On : _request->write(_URL->scheme); in asyncHTTPrequest.cpp

The first request appear in the setup(), and the second one is in the loop() function after xxxx ms.

boblemaire commented 5 years ago

Doesn't look as if this is related to the PR you posted, if so, then please close it. This looks like a send was issued from the calling program (line 649?) but debug was turned off, so we don't know the sequence. Apparently, the URL structure doesn't exist. Are you checking for a false return from open? Is it possible the request wasn't opened? I suppose we should be checking to make sure open succeeded and established the URL data structure before trying to copy the contents to the message header.

Legrems commented 5 years ago

The crash was comming from the _buildRequest. With this PR, i was able to avoid this error :)