-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Crash and reboot when reaching getString() method #6688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Why isn't the stack decoded? Please decode it and add it above. |
I do not know how :) |
Just google "decode esp8266 stack". Also, readthedocs. |
Ok, thank you. I edited issue. Is this memory leak ? |
You said:
But from your stack dump, you're using core v2.5.2. Retesting with latest git is needed before this can be looked at further, because there have been several issues fixed, including interrupt and String issues. In other words, it makes no sense to look at this if the issue is already fixed in the latest code base. Instructions for installing latest git are in readthedocs. I am closing for now. If you find more information, please post it here and we can continue to discuss. |
@devyte ok, thank you for instructions.
Can you help me with this ? |
How big is the resource you're trying to GET? |
It's very small ~25kb <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta HTTP-EQUIV="content-type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta name="handheldFriendly" content="true" />
<meta name="viewport" content="width=device-width; initial-scale=1"; user-scalable="yes" />
<title>MultiFun Control System</title>
<link ID="styl_id" rel="stylesheet" type="text/css" media="screen"/> <!--href="style.css"-->
<script language="javascript">
var szer = window.screen.width;
if(navigator.userAgent.indexOf('Opera Mini') > -1)
{
if(szer <= 1024){ document.getElementById('styl_id').href = "opmini.css"; }
else{ document.getElementById('styl_id').href = "style.css"; }
}
else
{
if(szer <= 800) {document.getElementById('styl_id').href = "styleh.css"; }
else if(szer <= 1024){document.getElementById('styl_id').href = "style600.css";}
else{document.getElementById('styl_id').href = "style.css";}
}
</script>
</head>
<body>
<div id="glowny">
<div id="obrazek">
<div id="ziel"><h1 class="green">MultiFun Control System</h1></div>
<!--temperatury od róry-->
<!--spaliny-->
<div id="spaliny"><h1 class="black">32</h1></div>
<!--zewnętrzna-->
<div id="zewnetrzna"><h1 style="font-size: 42px;" class="blue"></h1></div>
<!--pokojowa1-->
<div id="pokojowa1"><h1 class="cherry"></h1></div>
<!--pokojowa2-->
<div id="pokojowa2"><h1 class="cherry"></h1></div>
<!--CO1-->
<div id="CO1"><h1 class="red">23</h1></div>
<!--CO2-->
<div id="CO2"><h1 class="red">26</h1></div>
<!--Kocioł-->
<div id="kociol"><h1 class="red">34</h1></div>
<!--CWU-->
<div id="CWU"><h1 class="red">37</h1></div>
<!--Wyliczone-->
<!--Pokój 1-->
<div id="pokoj1"><h2></h2></div>
<!--Pokój 2-->
<div id="pokoj2"><h2></h2></div>
<!--CO 1-->
<div id="WCO1"><h2>20</h2></div>
<!--CO 2-->
<div id="WCO2"><h2></h2></div>
<!--Kotla-->
<div id="WKOC"><h2>0</h2></div>
<!--CWU-->
<div id="WCWU"><h2>0</h2></div>
<form method="get" action="/opts.cgi">
<div id="th1"><input type="text" name="TH1" size="4" value="35"></div>
<div id="th2"><input type="text" name="TH2" size="4" value=""></div>
<div id="th3"><input type="text" name="TH3" size="4" value="45"></div>
<div id="op1"><input value="1" name="op" type="checkbox"></div>
<div id="op2"><input value="2" name="op" type="checkbox"></div>
<div id="op3"><input value="3" name="op" type="checkbox"></div>
<div id="op4"><input value="4" name="op" type="checkbox"></div>
<div id="op5"><input value="5" name="op" type="checkbox"></div>
<div id="pas"><input name="pass" size="4" type="password"></div>
<div id="but"><input value="OK" type="submit"></div>
</form>
</div>
</div>
</body>
</html> |
I must add that this module works perfectly for about 2-3 months and suddenly stopped working (of course on previous git version of board). I tested this code on other same nodeMCU's but nothing change. This is very strange. |
25KB is most definitely NOT very small, it's about half the total amount of available heap of an empty sketch, and yours is not an empty sketch. |
Sorry, it's 2.9 - 3.1 kb. |
Ok, I have Exception 3 which stands for: LoadStoreErrorCause |
3KB should be ok, then I don't think it's oom (out of memory). |
Response Headers:
Maybe you reopen this issue ? |
@devyte Can you reopen this issue ? |
@devyte thank you |
Just to be clear, you did install latest git following the instructions in readthedocs, right? And not some copy-over-2.5.2 folders or other install weirdness? |
right sir. I did this with readthedocs in 100%. |
The HTML you posted isn't valid, there seem to be syntax issues with it. Reported by Chrome and online validation tools. |
Alright, I put the (bad) html in one ESP behind a (async)webserver, and put the sketch in another ESP to test. Building with today's core, it's been running for 30mins with no crash.
I added the About to getString!! and Done with getString!! prints to fence the getString() call. In other words, I can't reproduce the crash. My guess at this point is that you have either a core installation issue which results in a bad binary or you have a bad board. My suggestion is you pursue this at your end, i.e.:
Closing for now due to can't reproduce. I'll reopen if more info presents itself. |
Hi there,
There is no long tail of errors but still... Can you help me with this a little bit more ? |
Without the ability to reproduce my help is very limited. What I suggest is editing the getString() function by adding Serial.printwhatever, then check in the console which is the last message to print out. That tells you hownthe code execution progresses. If you see that some other function crashes, then you go into that one and do the same. As you go, print out pieces of data (local variables, args, whatever). Eventually you'll reach some code that crashes due to data, e. g. null pointer access or buffer with garbage or missing a null termination, or something that doesn't make sense, like one statement that modifies a completely unrelated piece of data (=> corruption). |
Try this: void loop() {
} delay(10000); |
I ran into the same issue. It turned out to be a problem with a missing |
My server is simple blackbox device. I cannot modify its code. I'm afraid I have to edit main lib and fix this issue.
What do you think?
Mateusz Manaj
Kierownik IT
softgraf.pl
(Krótko bo z iPhone’a)
… Wiadomość napisana przez MatejKotas ***@***.***> w dniu 17.12.2020, o godz. 00:05:
I ran into the same issue. It turned out to be a problem with a missing Content-Length header. When the server doesn't return the header, http.getString() crashes. I fixed it by returning the content length header from the server.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Can you try latest master, I think #7691 solved this issue. |
I experienced the same behaviour: crash on getString(). For me it worked correctly after rewriting The top http.begin( url ) statement was deprecated, but it is still in the examples. |
Same here: very repeatable crash on getString(). Under certain very repeatable conditions, I have received "Exception (9) - LoadStoreAlignmentCause: Load or store to an unaligned address". Details are available, if needed by anyone. |
I also encounter a similar problem and can be fixed by the solution as described by @Flensb and @ArnoldSchw In my case, it crashed on a simple GET request to an API which response with a simple short string such as "zone1". What is weird is that it was working fine at first when I run the API using NodeJs express on my Mac. But It crashed when I deploy the real API in another NodeMCU, even though the request and response are mostly the same. Thanks. |
It definitely helped me. I stopped working on my project one year ago out of boredom at being unable to solve this crappy issue. |
Thank for that reivaxy. I also got a dump on my Wemos D1 R2 Mini when using http.getString(); I rewrote from: and change the sequence of WiFiClient, as your code above, and it worked ok, WiFiClient client; |
Basic Infos
Platform
Settings in IDE
Problem Description
Board crashed when code reaching
Problem occurs when requesting GET from this host: http://192.168.8.218 - this is my stove webserver. For 1 month it was ok but now i cannot getting response. Other host working properly. I tried to change IP of webserver - nothing changed.
Tell me, what needs to happen for getString() method to crash and reboot board ?
In addtion, response from webserver is correct. All packets and whole response is ok.
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: