While attempting to resolve a low memory error condition, I stumbled across an infinite while
condition during a trace() operation. Initially, I thought I was up against a garbage collection
process anomaly, until I obsereved a weird dump() output. Attempting to also capture a trace at
the same time, allowed this oversight to be revealed.
I attempted to resolve this in post #9 thinking this was specific to the online IDE
but a resolution to capture the trace output was never responded to, and during the wait, I ended up having to stitch what I could.
// many iterations of the following as one contiguous block
#489[r1,l2] Name String [1 blocks] "w" #490[r1,l0] Function {
#491[r1,l2] Name Param "\xFFa" undefined
#492[r1,l2] Name Param "\xFFb" undefined
#494[r1,l2] Name String [1 blocks] "\xFFcod" #493[r1,l0] NativeString [1 blocks] "if(b)return a(b);f.cmd(\"AT+CWMODE=\"+p+\"\\r\\n\",1E3,function(b){\"no change\"!=b&&\"OK\"!=b&&\"WIFI DISCONNECT\"!=b?a(\"CWMODE failed: \"+(b?b:\"Timeout\")):a(null)})"
// many more deleted - included in attached file
EDIT: Just uncovered that there are characters in the output that prevent rendering here, so will provide the text output as an upload.
The best I could do, as there was a massive amount of characters in the console text area I attempted to copy to the clipboard, and that process was flawed, limited by what could be seen as mouse scroll prevented more than around twenty at a time. I even attempted to just move to the top of the console window, but the sequence of events that led up to the decision to perform the dump() and trace() were forever gone to the Goddess of byte reclaim heaven.
allowed me to look into the underlying code that produces the trace output. To those curious onlookers, I highly recommend spending an hour and follow all the links presented to get a better grasp on how stuff works under the hood, and maybe down the road have some insight to locate the code line and provide assistance in providing a suitable fix for your issues that are uncovered.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Wed 2020.04.29
While attempting to resolve a low memory error condition, I stumbled across an infinite while
condition during a trace() operation. Initially, I thought I was up against a garbage collection
process anomaly, until I obsereved a weird dump() output. Attempting to also capture a trace at
the same time, allowed this oversight to be revealed.
I attempted to resolve this in post #9 thinking this was specific to the online IDE
but a resolution to capture the trace output was never responded to, and during the wait, I ended up having to stitch what I could.
EDIT: Just uncovered that there are characters in the output that prevent rendering here, so will provide the text output as an upload.
The best I could do, as there was a massive amount of characters in the console text area I attempted to copy to the clipboard, and that process was flawed, limited by what could be seen as mouse scroll prevented more than around twenty at a time. I even attempted to just move to the top of the console window, but the sequence of events that led up to the decision to perform the dump() and trace() were forever gone to the Goddess of byte reclaim heaven.
@Gordon 's assistance in post #6 and #8
allowed me to look into the underlying code that produces the trace output. To those curious onlookers, I highly recommend spending an hour and follow all the links presented to get a better grasp on how stuff works under the hood, and maybe down the road have some insight to locate the code line and provide assistance in providing a suitable fix for your issues that are uncovered.
Posted a suggested fix in issue #1809 at GitHub
Now back to the vain attempt to make this condition repeatable in order to provide an example and it's resulting trace output.
1 Attachment