{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/844","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/844/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/844/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/844/events","html_url":"https://github.com/esp8266/Arduino/issues/844","id":109269759,"number":844,"title":"Exception (28) - test sketch","user":{"login":"luc-github","id":8822552,"avatar_url":"https://avatars.githubusercontent.com/u/8822552?v=3","gravatar_id":"","url":"https://api.github.com/users/luc-github","html_url":"https://github.com/luc-github","followers_url":"https://api.github.com/users/luc-github/followers","following_url":"https://api.github.com/users/luc-github/following{/other_user}","gists_url":"https://api.github.com/users/luc-github/gists{/gist_id}","starred_url":"https://api.github.com/users/luc-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luc-github/subscriptions","organizations_url":"https://api.github.com/users/luc-github/orgs","repos_url":"https://api.github.com/users/luc-github/repos","events_url":"https://api.github.com/users/luc-github/events{/privacy}","received_events_url":"https://api.github.com/users/luc-github/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-01T10:06:12Z","updated_at":"2015-10-01T16:36:51Z","closed_at":null,"body":"Now heap corruption is solved (thank @iggr) here another issue I meet\r\nUsing staging : 1.6.5-1160-gef26c5f - I had hard time to do it but I was able to reproduce a random exception(28) out of my project-  here the test sketch:\r\n\r\nJust need doing some navigation between push button and page 2 then back to home - no need a big stress and it will happen when display home or page 2\r\nI was able to reproduce more easily using PROGMEM  \r\n\r\nI enclose the output and stack for 2 crashes:\r\n\r\nFirst crash you can see memory is still high when crashing\r\nSecond crash you can see memory decreasing  during several seconds then crash\r\n\r\nWhen crashing eError on chrome is : \r\n```\r\nThis webpage is not available\r\n\r\nERR_CONTENT_LENGTH_MISMATCH\r\n```\r\n<h3>Crash 1</h3>\r\n```\r\ncommand\r\n31888\r\nrefresh\r\n31440\r\ncommand\r\n31664\r\n\r\nException (28):\r\nepc1=0x4000df60 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000\r\n\r\nctx: cont \r\nsp: 3ffec570 end: 3ffec890 offset: 01a0\r\n\r\n>>>stack>>>\r\n3ffec710:  00002707 00000001 3ffec77c 40209bba  \r\n3ffec720:  00002729 00000001 3ffec77c 40209f85  \r\n3ffec730:  3ffec750 00000074 3ffec77c 3ffeacac  \r\n3ffec740:  3ffeb478 3fff3f08 3ffec77c 40209fe5  \r\n3ffec750:  3ffe9568 3fff3f08 00000001 40209b15  \r\n3ffec760:  0000000a 3ffec840 00000000 40202345  \r\n3ffec770:  3fff40a8 0000003f 00000031 00000000  \r\n3ffec780:  000026ff 000026f8 3fff4088 0000000f  \r\n3ffec790:  0000000d 00000001 3ffec7e0 40209bba  \r\n3ffec7a0:  3fff4068 0000000f 3fff3f08 402085ee  \r\n3ffec7b0:  3ffeb478 3fff3f08 3ffec7e0 40205f7a  \r\n3ffec7c0:  0000000f 3fff42ac 3fff3f08 40205faa  \r\n3ffec7d0:  3fff4160 0000000f 3ffeac78 40205c18  \r\n3ffec7e0:  3fff4068 0000000f 00000001 0000000f  \r\n3ffec7f0:  00000001 3fff40b0 0000000f 00000003  \r\n3ffec800:  3fff46c0 0000007f 00000000 3ffeb7c8  \r\n3ffec810:  40205f84 00000001 402017ec 0000000f  \r\n3ffec820:  402010ae 00000001 00000001 3ffec8bc  \r\n3ffec830:  3fffdc20 000003bd 3ffeac78 40205d2d  \r\n3ffec840:  3ffe9798 00000000 000003e8 000116b2  \r\n3ffec850:  3ffeac90 3fff45f8 00000016 40101a2d  \r\n3ffec860:  4020180d 00000000 3ffec8b4 40202718  \r\n3ffec870:  3fffdc20 00000000 3ffec8b4 4020186a  \r\n3ffec880:  00000000 00000000 3ffeb870 40100398  \r\n<<<stack<<<\r\n\r\n ets Jan  8 2013,rst cause:1, boot mode:(3,7)\r\n\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x42\r\ncsum 0x42\r\n~ld\r\n```\r\n\r\n<h3>Crash 2</h3>\r\nhere can see the memory drop\r\n\r\n```\r\nrefresh\r\n32184\r\nrefresh\r\n32184\r\nrefresh\r\n32184\r\nrefresh\r\n32184\r\ncommand\r\n21040\r\nrefresh\r\n21528\r\nrefresh\r\n11728\r\nrefresh\r\n11728\r\nrefresh\r\n11728\r\n\r\nException (28):\r\nepc1=0x4000df60 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000\r\n\r\nctx: cont \r\nsp: 3ffec560 end: 3ffec890 offset: 01a0\r\n\r\n>>>stack>>>\r\n3ffec700:  00000b43 00000001 3ffec778 40209bba  \r\n3ffec710:  00000b65 00000001 3ffec778 40209f85  \r\n3ffec720:  3f003332 3ffeacac 3ffec778 00000003  \r\n3ffec730:  00000003 40248f70 3ffec778 40209fe5  \r\n3ffec740:  3ffe9568 40248f70 00000001 40209b15  \r\n3ffec750:  3ffeb478 3ffeb53c 00000000 40202545  \r\n3ffec760:  3fff40a8 0000003f 00000031 3fff40a8  \r\n3ffec770:  0000000f 00000002 00000000 00000b3f  \r\n3ffec780:  00000b34 3fff4088 0000000f 0000000d  \r\n3ffec790:  3fff39d0 00000006 3ffec7e0 3ffeacac  \r\n3ffec7a0:  3ffeb478 3fff3f60 3fff3f60 402085ee  \r\n3ffec7b0:  3ffeb478 3fff3f60 3ffec7e0 40205f7a  \r\n3ffec7c0:  0000000f 3fffdc20 3fff3f60 40205faa  \r\n3ffec7d0:  3fff42e0 0000000f 3ffeac78 40205c18  \r\n3ffec7e0:  3fff4068 0000000f 00000006 0000000f  \r\n3ffec7f0:  00000006 3fff4090 0000000f 00000003  \r\n3ffec800:  3fff47c8 0000007f 00000000 3ffeb7c8  \r\n3ffec810:  40205f84 00000001 402017ec 0000000f  \r\n3ffec820:  402010ae 00000001 00000001 3ffec8bc  \r\n3ffec830:  3fffdc20 000003e8 3ffeac78 40205d2d  \r\n3ffec840:  3ffe9798 00000000 000003e8 0003486b  \r\n3ffec850:  3ffeac90 3fff4308 00000016 40101a2d  \r\n3ffec860:  4020180d 00000000 3ffec8b4 40202718  \r\n3ffec870:  3fffdc20 00000000 3ffec8b4 4020186a  \r\n3ffec880:  00000000 00000000 3ffeb870 40100398  \r\n<<<stack<<<\r\n\r\n ets Jan  8 2013,rst cause:1, boot mode:(3,7)\r\n\r\nload 0x4010f000, len 1264, room 16 \r\ntail 0\r\nchksum 0x42\r\ncsum 0x42\r\n~ld\r\n```\r\nhere the script\r\n\r\n<h3>Test sketch</h3>\r\n```\r\n#include <ESP8266WiFi.h>\r\n#include <ESP8266WebServer.h>\r\nextern \"C\" {\r\n#include \"user_interface.h\"\r\n}\r\n\r\nconst char FILL_THE_VOID1[] PROGMEM =\"Fill the page with something visible\\n\";\r\nconst char FILL_THE_VOID2[] PROGMEM =\"<Div text='Fill the page with something hidden'>\\n\";\r\n\r\nconst char* ssid = \"dlink\";\r\nconst char* password = \"blablabla\";\r\n\r\nESP8266WebServer server(80);\r\n\r\nvoid handleRoot() {\r\n  String IP = WiFi.localIP().toString();\r\n  String  s;\r\n  s = \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n<body>\";\r\n   s += \"<a href='http://\"+IP+\"'>Home</a>&nbsp;&nbsp;<a href='http://\"+IP+\"/page2'>Page 2</a>\" ;\r\n   s += \"<H4>Home</H4>\";\r\n   s += \"<IFRAME width=\\\"2\\\" height=\\\"2\\\" style=\\\"visibility:hidden\\\" ID=\\\"frmcmd\\\" NAME=\\\"frmcmd\\\" ></IFRAME><BR>\";\r\n   s += \"<IFRAME ID=\\\"statusfrm\\\" NAME=\\\"statusfrm\\\" src=\\\"http://\"+IP+\"/STATUS\\\"></IFRAME>\";\r\n   s += \"<BUTTON TYPE=\\\"BUTTON\\\" VALUE=\\\"Emergency Stop\\\" Onclick=\\\"window.open('http://\"+IP;\r\n   s += \"/CMD?cmd=M112','frmcmd');\\\">Emergency Stop</BUTTON><BR>\";\r\n   s += \"<SCRIPT TYPE=\\\"text/javascript\\\">\\r\\n\";\r\n   s += \"setInterval(function(){\";\r\n   s += \"var ifrm=document.getElementById(\\\"statusfrm\\\");var doc=ifrm.contentDocument?ifrm.contentDocument:ifrm.contentWindow.document;\";\r\n   s += \"doc.location.reload(true);},3000);\\r\\n</SCRIPT>\\r\\n\";\r\n  for (int i=0;i<10;i++)\r\n\t{\r\n\ts += String(FILL_THE_VOID1);\r\n\t}\r\nfor (int i=0;i<190;i++)\r\n\t{\r\n\ts += String(FILL_THE_VOID2);\r\n\t}\r\n   s += \"</body></html>\\n\";\r\n  server.send(200, \"text/html\", s);\r\n\r\n}\r\n\r\nvoid handlepage2() {\r\n  String IP = WiFi.localIP().toString();\r\n  String  s;\r\n  s = \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n<body>\";\r\n   s += \"<a href='http://\"+IP+\"'>Home</a>&nbsp;&nbsp;<a href='http://\"+IP+\"/page2'>Page 2</a><BR>\" ;\r\n   s += \"<H4>Page 2</H4>\";\r\n  int n = WiFi.scanNetworks();\r\n  if (n == 0)\r\n    s += \"<H3>no networks found</H3>\";\r\n  else\r\n  {\r\n    s += \"<H3>Networks found</H3>\";\r\n    s += \"<TABLE>\";\r\n    for (int j = 0;j < n; ++j)\r\n    {\r\n\t   s += \"<TR><TD>#\";\r\n      // Print SSID and RSSI for each network found\r\n      s += String(j+ 1) + \"</TD><TD>\";\r\n      s += String(WiFi.SSID(j)) + \"</TD><TD>\" ;\r\n      s +=String(100+WiFi.RSSI(j)) + \"%</TD><TD>\";\r\n      if (WiFi.encryptionType(j) == ENC_TYPE_NONE)s+=\"Not protected\";\r\n      else s+=\"Protected\";\r\n      s += \"</TD></TR>\";\r\n    }\r\n    s += \"</TABLE><BR>\";\r\n  }\r\n  for (int i=0;i<10;i++)\r\n\t{\r\n\ts += String(FILL_THE_VOID1);\r\n\t}\r\n\tfor (int i=0;i<190;i++)\r\n\t{\r\n\ts += String(FILL_THE_VOID2);\r\n\t}\r\n   s += \"</body></html>\\n\";\r\n  server.send(200, \"text/html\", s);\r\n\r\n}\r\n\r\nvoid handleStatus() {\r\n\r\n  String  s = \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n<body>\";\r\n   s += \"Ok\";\r\n   s += \"</body></html>\\n\";\r\n  server.send(200, \"text/html\", s);\r\n  Serial.println(\"refresh\");\r\n  Serial.println(system_get_free_heap_size());\r\n}\r\n\r\nvoid handleCMD() {\r\n\r\n  Serial.println(\"command\");\r\n  Serial.println(system_get_free_heap_size());\r\n}\r\n\r\nvoid setup(void){\r\n Serial.begin(115200);\r\n  delay(10);\r\n  WiFi.begin(ssid, password);\r\n\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(\".\");\r\n  }\r\n\r\n  server.on(\"/\", handleRoot);\r\n  server.on(\"/page2\", handlepage2);\r\n  server.on(\"/CMD\", handleCMD);\r\n  server.on(\"/STATUS\", handleStatus);\r\n\r\n  server.begin();\r\n}\r\n\r\nvoid loop(void){\r\n  server.handleClient();\r\n\r\n} \r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/144781505","html_url":"https://github.com/esp8266/Arduino/issues/844#issuecomment-144781505","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/844","id":144781505,"user":{"login":"luc-github","id":8822552,"avatar_url":"https://avatars.githubusercontent.com/u/8822552?v=3","gravatar_id":"","url":"https://api.github.com/users/luc-github","html_url":"https://github.com/luc-github","followers_url":"https://api.github.com/users/luc-github/followers","following_url":"https://api.github.com/users/luc-github/following{/other_user}","gists_url":"https://api.github.com/users/luc-github/gists{/gist_id}","starred_url":"https://api.github.com/users/luc-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luc-github/subscriptions","organizations_url":"https://api.github.com/users/luc-github/orgs","repos_url":"https://api.github.com/users/luc-github/repos","events_url":"https://api.github.com/users/luc-github/events{/privacy}","received_events_url":"https://api.github.com/users/luc-github/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T16:36:51Z","updated_at":"2015-10-01T16:36:51Z","body":"yes I forget to add it in test sketch you are correct, I do it already in my project, but adding it do no solve the issue :\r\n```\r\n#include <ESP8266WiFi.h>\r\n#include <ESP8266WebServer.h>\r\nextern \"C\" {\r\n#include \"user_interface.h\"\r\n}\r\n\r\nconst char FILL_THE_VOID1[] PROGMEM =\"Fill the page with something visible\\n\";\r\nconst char FILL_THE_VOID2[] PROGMEM =\"<Div text='Fill the page with something hidden'>\\n\";\r\n\r\nconst char* ssid = \"dlink\";\r\nconst char* password = \"1F16264C4D\";\r\n\r\nESP8266WebServer server(80);\r\n\r\nvoid handleRoot() {\r\n  String IP = WiFi.localIP().toString();\r\n  String  s;\r\n  s = \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n<body>\";\r\n   s += \"<a href='http://\"+IP+\"'>Home</a>&nbsp;&nbsp;<a href='http://\"+IP+\"/page2'>Page 2</a>\" ;\r\n   s += \"<H4>Home</H4>\";\r\n   s += \"<IFRAME width=\\\"2\\\" height=\\\"2\\\" style=\\\"visibility:hidden\\\" ID=\\\"frmcmd\\\" NAME=\\\"frmcmd\\\" ></IFRAME><BR>\";\r\n s += \"<IFRAME ID=\\\"statusfrm\\\" NAME=\\\"statusfrm\\\" src=\\\"http://\"+IP+\"/STATUS\\\"></IFRAME>\";\r\n   s += \"<BUTTON TYPE=\\\"BUTTON\\\" VALUE=\\\"Emergency Stop\\\" Onclick=\\\"window.open('http://\"+IP;\r\n   s += \"/CMD?cmd=M112','frmcmd');\\\">Emergency Stop</BUTTON><BR>\";\r\n   s += \"<SCRIPT TYPE=\\\"text/javascript\\\">\\r\\n\";\r\n   s += \"setInterval(function(){\";\r\n   s += \"var ifrm=document.getElementById(\\\"statusfrm\\\");var doc=ifrm.contentDocument?ifrm.contentDocument:ifrm.contentWindow.document;\";\r\n   s += \"doc.location.reload(true);},3000);\\r\\n</SCRIPT>\\r\\n\";\r\n  for (int i=0;i<10;i++)\r\n\t{\r\n\ts += String(FPSTR(FILL_THE_VOID1));\r\n\t}\r\nfor (int i=0;i<190;i++)\r\n\t{\r\n\ts += String(FPSTR(FILL_THE_VOID2));\r\n\t}\r\n   s += \"</body></html>\\n\";\r\n  server.send(200, \"text/html\", s);\r\n\r\n}\r\n\r\nvoid handlepage2() {\r\n  String IP = WiFi.localIP().toString();\r\n  String  s;\r\n  s = \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n<body>\";\r\n   s += \"<a href='http://\"+IP+\"'>Home</a>&nbsp;&nbsp;<a href='http://\"+IP+\"/page2'>Page 2</a><BR>\" ;\r\n   s += \"<H4>Page 2</H4>\";\r\n  int n = WiFi.scanNetworks();\r\n  if (n == 0)\r\n    s += \"<H3>no networks found</H3>\";\r\n  else\r\n  {\r\n    s += \"<H3>Networks found</H3>\";\r\n    s += \"<TABLE>\";\r\n    for (int j = 0;j < n; ++j)\r\n    {\r\n\t   s += \"<TR><TD>#\";\r\n      // Print SSID and RSSI for each network found\r\n      s += String(j+ 1) + \"</TD><TD>\";\r\n      s += String(WiFi.SSID(j)) + \"</TD><TD>\" ;\r\n      s +=String(100+WiFi.RSSI(j)) + \"%</TD><TD>\";\r\n      if (WiFi.encryptionType(j) == ENC_TYPE_NONE)s+=\"Not protected\";\r\n      else s+=\"Protected\";\r\n      s += \"</TD></TR>\";\r\n    }\r\n    s += \"</TABLE><BR>\";\r\n  }\r\n  for (int i=0;i<10;i++)\r\n\t{\r\n\ts += String(FPSTR(FILL_THE_VOID1));\r\n\t}\r\n\tfor (int i=0;i<190;i++)\r\n\t{\r\n\ts += String(FPSTR(FILL_THE_VOID2));\r\n\t}\r\n   s += \"</body></html>\\n\";\r\n  server.send(200, \"text/html\", s);\r\n\r\n}\r\n\r\nvoid handleStatus() {\r\n\r\n  String  s = \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n<body>\";\r\n   s += \"Ok\";\r\n   s += \"</body></html>\\n\";\r\n  server.send(200, \"text/html\", s);\r\n  Serial.println(\"refresh\");\r\n  Serial.println(system_get_free_heap_size());\r\n}\r\n\r\nvoid handleCMD() {\r\n\r\n  Serial.println(\"command\");\r\n  Serial.println(system_get_free_heap_size());\r\n}\r\n\r\nvoid setup(void){\r\n Serial.begin(115200);\r\n  delay(10);\r\n  WiFi.begin(ssid, password);\r\n\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(\".\");\r\n  }\r\n\r\n  server.on(\"/\", handleRoot);\r\n  server.on(\"/page2\", handlepage2);\r\n  server.on(\"/CMD\", handleCMD);\r\n  server.on(\"/STATUS\", handleStatus);\r\n\r\n  server.begin();\r\n}\r\n\r\nvoid loop(void){\r\n  server.handleClient();\r\n\r\n} \r\n\r\n```\r\n\r\n```\r\ncommand\r\n32072\r\ncommand\r\n32072\r\ncommand\r\n32072\r\nrefresh\r\n31400\r\n\r\nException (28):\r\nepc1=0x4000df60 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000\r\n\r\nctx: cont \r\nsp: 3ffec560 end: 3ffec890 offset: 01a0\r\n\r\n>>>stack>>>\r\n3ffec700:  00000c7a 00000001 3ffec778 40209bba  \r\n3ffec710:  00000c9c 00000001 3ffec778 40209f85  \r\n3ffec720:  3f003432 3ffeacac 3ffec778 00000004  \r\n3ffec730:  00000004 40248f70 3ffec778 40209fe5  \r\n3ffec740:  3ffe9568 40248f70 00000001 40209b15  \r\n3ffec750:  3ffeb478 3ffeb53c 00000000 40202545  \r\n3ffec760:  3fff4598 0000003f 00000031 3fff40a8  \r\n3ffec770:  0000000f 00000002 00000000 00000c6f  \r\n3ffec780:  00000c6b 3fff4088 0000000f 0000000d  \r\n3ffec790:  3fff39d0 00000006 3ffec7e0 3ffeacac  \r\n3ffec7a0:  3ffeb478 3fff3f60 3fff3f60 402085ee  \r\n3ffec7b0:  3ffeb478 3fff3f60 3ffec7e0 40205f7a  \r\n3ffec7c0:  0000000f 000007d1 3fff3f60 40205faa  \r\n3ffec7d0:  3fff4290 0000000f 3ffeac78 40205c18  \r\n3ffec7e0:  3fff4068 0000000f 00000006 0000000f  \r\n3ffec7f0:  00000006 3fff4068 0000000f 00000003  \r\n3ffec800:  3fff46f0 0000007f 00000000 40204ba9  \r\n3ffec810:  40205f84 00000001 000003e8 0000000f  \r\n3ffec820:  00000000 3fff46b8 3ffeac78 3ffec8bc  \r\n3ffec830:  3fffdc20 000003e9 3ffeac78 40205d2d  \r\n3ffec840:  3ffe9798 00000000 000003e8 00016dd8  \r\n3ffec850:  3ffeac90 3fff46b8 00000016 40101a2d  \r\n3ffec860:  4020180d 00000000 3ffec8b4 40202718  \r\n3ffec870:  3fffdc20 00000000 3ffec8b4 4020186a  \r\n3ffec880:  00000000 00000000 3ffeb870 40100398  \r\n<<<stack<<<\r\n\r\n ets Jan  8 2013,rst cause:1, boot mode:(1,7)\r\n\r\n\r\n ets Jan  8 2013,rst cause:4, boot mode:(1,7)\r\n\r\nwdt reset\r\n\r\n```\r\n"}}