Random code corruption/errors #4271
Replies: 1 comment
-
Posted at 2014-12-15 by @gfwilliams Do you have a way to reproduce it? And are you using the latest firmware? I know a while back someone had committed some code that removed a lot of debugging checks, and as a result a few errors crept in. I've fixed those now and I was pretty sure the changes were in 1v71. I think after I posted there were no more complaints until now. Maybe try one of the 'git' builds and see if you still have issues? Posted at 2014-12-15 by @gfwilliams Original here: http://forum.espruino.com/conversations/256404/ I thought I'd fixed it in 1v71, but there was never confirmation Posted at 2014-12-16 by DaveNI I've tried the latest 1v72 but identical error.I can consistently reproduce the error even after a reset & reload and after adding debug code, its always in the same block of code but it is slightly different each time. I honestly cant see anything wrong with the code (but I've been confident about that before yet wrong!!) I'll try to investigate a bit more tonight. Posted at 2014-12-16 by @gfwilliams I can't really think of a way any code - no matter how buggy - should be able to do that! Does it happen almost immediately, or does it take a while to happen? If you could email it to me it'd really be appreciated, and hopefully I can get this fixed. Posted at 2014-12-16 by DaveNI @gfwilliams I've attached the partial output from a trace() after the error occurred. This time it manifested itself in some debug code. Basically a i++ became i,+ but again in the same function. The error is on line 917 of the file. I did a trace before the error occurred and the code was correct (I thought Closure may be corrupting something but that doesn't seem to be the case.) I have no issues giving you the code but it would take a lot of setup to get it running (you would need an ILI9341 with touch & wiz5500io). Maybe there is something else I could try before that? I'm unsure about the trace command - would it be worth doing a trace immediately before the error, then immediately after and doing a diff on them to see if there are more corruptions? (I copied the trace output from the console, is there a better way - maybe a simple dos command to redirect the output from a com port to a file after ECHO trace() > COM5 ?) I can reproduce the error in about 5 seconds of loading the program - basically a few clicks of the buttons on my ILI9341. I tried to reproduce the error with less code but haven't managed to yet. Hopefully i haven't done anything stupid since I don't want to waste your time! EDIT: Just ran it again - this time:
log became lpg. The error always seems to be 1 character out. Attachments: Posted at 2014-12-17 by @gfwilliams I don't know it it's possible, but if you could try and remove the code for the touchscreen and still get it to reproduce the error (maybe using setTimeouts to call the 'touch' callback?) it'd be a huge help. I should then be able to run it on something here (I can connect a WIZnet module, and the ILI9341 is one-way so can just be left off) where I can debug it. The trace isn't too useful at the moment - what's happening is one of the 'JsVars' - the variable blocks - has got marked as unused even though it is used for something else, but has then got included as part of the string. Annoyingly While I could give you an image with some debug code in, I can pretty much guarantee what the error message will say - and it's not going to be any use without a debugger attached. Does the error happen even when you're not using the WIZnet module? I guess it's possible there's a bug in that - and it would explain why I haven't reproduced anything here. Posted at 2014-12-17 by DaveNI I've a 2nd wiznet so as a start I will swap them tonight, I'll also remove the solid state relay unit (which was switching a 240v 40w bulb but is not connected to the power supply at present). I've got a display without touch so could also swap that in. One odd observation - I added some extra code last night to try and move the offending function into a different memory location but the error still occurs in the same place yet the code its now about 100 lines further down the trace. I thought the error may have occurred somewhere else. Posted at 2014-12-17 by @gfwilliams
I wouldn't bother trying it - It's probably a bug in the http+wiznet code in Espruino, in which case it's nothing to do with the hardware module at all. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-12-15 by DaveNI
Hi
All of a sudden I'm getting random code corruption/errors such as this:
As can be seen one of the charCodeAt statements has become charCodeBt !!!
Another example:
The closing bracket has become a + symbol.
Maybe its just how the error is being displayed but I don't think so.
I happen to remember someone else having similar issues - was there ever a solution?
Beta Was this translation helpful? Give feedback.
All reactions