esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16k stars 13.33k forks source link

Random crash (except 28 / except 9 ) of CaptivePortal.ino #866

Closed luc-github closed 8 years ago

luc-github commented 8 years ago

I got random crash in my project was able to narrow down some until captive portal I used sample CaptivePortal.ino where I just added Serial.begin(9600); in setup I use nodemcu 1.0 and latest staging and just connect an android tablet to the AP and wait watching serial monitor, even not touching the tablet. after 10min or 1h, it depend, I have some exceptions - so I have activated DEBUG and here one output

New client
method: GET url: /cgi-bin/micromsg-bin/newgetdns search: uin=0&clientversion=637666612&scene=0&net=1&md5=c40f5f959aadf7c3d45203250ea72a21&devicetype=android-22&lan=fr&sigver=1
headerName: Accept
headerValue: */*
headerName: Accept-Encoding
headerValue: deflate
headerName: Cache-Control
headerValue: no-cache
headerName: Connection
headerValue: close
headerName: Content-Type
headerValue: application/octet-stream
headerName: Host
headerValue: dns.weixin.qq.com
headerName: User-Agent
headerValue: MicroMessenger Client
args: uin=0&clientversion=637666612&scene=0&net=1&md5=c40f5f959aadf7c3d45203250ea72a21&devicetype=android-22&lan=fr&sigver=1
args count: 8
pos 0=@ 3 &@ 5
arg 0 key: uin value: 0
pos 6=@ 19 &@ 29
arg 1 key: clientversion value: 637666612
pos 30=@ 35 &@ 37
arg 2 key: scene value: 0
pos 38=@ 41 &@ 43
arg 3 key: net value: 1
pos 44=@ 47 &@ 80
arg 4 key: md5 value: c40f5f959aadf7c3d45203250ea72a21
pos 81=@ 91 &@ 102
arg 5 key: devicetype value: android-22
pos 103=@ 106 &@ 109
arg 6 key: lan value: fr
pos 110=@ 116 &@ -1
arg 7 key: sigver value: 1
args count: 8
Request: /cgi-bin/micromsg-bin/newgetdns
 Arguments: uin=0&clientversion=637666612&scene=0&net=1&md5=c40f5f959aadf7c3d45203250ea72a21&devicetype=android-22&lan=fr&sigver=1
request handler not found
New client
method: POST url: http://hkshort.weixin.qq.com/cgi-bin/micromsg-bin/getkvidkeystrategyrsa search: 
headerName: Accept
headerValue: */*
headerName: Cache-Control
headerValue: no-cache
headerName: Connection
headerValue: close
headerName: Content-Length
headerValue: 162
headerName: Content-Type
headerValue: application/octet-stream
headerName: Host
headerValue: hkshort.weixin.qq.com
headerName: User-Agent
headerValue: MicroMessenger Client
Plain: ��&4
args: plain=��&4
args count: 2
pos 0=@ 5 &@ 9
arg 0 key: plain value: ��
pos 10=@ -1 &@ -1
arg missing value: 1
args count: 1
Request: http://hkshort.weixin.qq.com/cgi-bin/micromsg-bin/getkvidkeystrategyrsa
 Arguments: plain=��&4
request handler not found
New client
Invalid request: 
New client
method: POST url: /upload search: 
headerName: User-Agent
headerValue: Mozilla/4.0
headerName: Connection
headerValue: eep-alive
headerName: Host
headerValue: 92.168.1.1
headerName: Content-Length
headerValue: 76
Plain: wns
args: plain=wns
args count: 1
pos 0=@ 5 &@ -1
arg 0 key: plain value: wns
args count: 1
Request: /upload
 Arguments: plain=wns
request handler no
Exception (28):
epc1=0x401017ee epc2=0x00000000 epc3=0x00000000 excvaddr=0x131791a0 depc=0x00000000

ctx: cont 
sp: 3ffec810 end: 3ffeca40 offset: 01a0

>>>stack>>>
3ffec9b0:  40207814 3fff4698 3ffeb90c 3fff4308  
3ffec9c0:  3ffed1b8 00000040 3fff4698 40203f93  
3ffec9d0:  00000000 000003e9 3ffeadd4 40203930  
3ffec9e0:  3fffdc20 000003e9 3ffeadd4 40206226  
3ffec9f0:  3ffe9620 00000000 000003e8 0062aeb8  
3ffeca00:  00000000 3fff4698 00000016 40101bcd  
3ffeca10:  3fffdc20 00000000 3ffeca64 40202382  
3ffeca20:  00000000 00000000 3ffeca64 40201896  
3ffeca30:  00000000 00000000 3ffeba20 40100398  
<<<stack<<<��1L�L�'1�q�
luc-github commented 8 years ago

and the second kind of exception

New client
Invalid request: 
DNS responds: 192.168.1.1 for mtalk.google.com
New client
method: HEAD url: / search: 
headerName: Host
headerValue: pvbtkaum
headerName: Connection
headerValue: keep-alive
headerName: Content-Length
headerValue: 0
headerName: User-Agent
headerValue: Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY48T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Safari/537.36
headerName: Accept-Encoding
headerValue: gzip, deflate
args: 
Request: /
 Arguments: 
request handler not found
DNS responds: 192.168.1.1 for android.clients.google.com
New client
method: POST url: /upload search: 
headerName: User-Agent
headerValue: Mozilla/4.0
headerName: Connection
headerValue: eep-alive
headerName: Host
headerValue: 92.168.1.1
headerName: Content-Length
headerValue: 64
Plain: wns
args: plain=wns
args count: 1
pos 0=@ 5 &@ -1
arg 0 key: plain value: wns
args count: 1
Request: /upload
 Arguments: plain=wns
request handler not found
DNS responds: 192.168.1.1 for eventlog.beacon.qq.com
New client
method: GET url: /generate_204 search: 
headerName: User-Agent
headerValue: Dalvik/2.1.0 (Linux; U; Android 5.1.1; Nexus 7 Build/LMY48T)
headerName: Host
headerValue: clients3.google.com
headerName: Connection
headerValue: Keep-Alive
headerName: Accept-Encoding
headerValue: gzip
args: 
Request: /generate_204
 Arguments: 
request handler not found
New client
method: POST url: /analytics/upload search: mType=beacon
headerName: wup_version
headerValue: 3.0
headerName: Content-Length
headerValue: 2075
headerName: Host
headerValue: eventlog.beacon.qq.com
headerName: Connection
headerValue: Keep-Alive
Plain: PK
args: mType=be
Exception (9):
epc1=0x401017ee epc2=0x00000000 epc3=0x00000000 excvaddr=0x00b7e3c7 depc=0x00000000

ctx: sys 
sp: 3ffffdc0 end: 3fffffb0 offset: 01a0

>>>stack>>>
3fffff60:  4020cc1f 3fff48f8 3ffed5e8 3fff10a0  
3fffff70:  40219c18 ffffffff 00000000 00000001  
3fffff80:  3fff10a0 4021970d 3fffdab0 00000000  
3fffff90:  3fffdcc0 3ffeda80 00000000 3fffdcc0  
3fffffa0:  3ffeda80 40000f49 3fffdab0 40000f49  
<<<stack<<<
��1L�L�<1�q�
luc-github commented 8 years ago

I have just added some initialization and sanity check of _buffer pointer in DNSServer.cpp and seems solve the problem. Currently I am in second long run test, first passed alread, once done I will do a PR

luc-github commented 8 years ago

this one should be ok https://github.com/esp8266/Arduino/pull/912

luc-github commented 8 years ago

thank you