Ran under linux with gdb (makes life loads easier!)
p jsvGetRef(var) to get the reference of the variable that had a problem
break jsLock if ref==that_reference
break jsLockAgain if var==the_vars_pointer
break jsUnLock if var==the_vars_pointer
break where it's happening and after, and step through finding where the locks and unlocks happen
When I found out there wasn't an unlock in the function that locked it, the only way it could have happened is if thisVar got overwritten, so I did watch thisVar and continued until I found where it was getting overwritten
But none of that would have happened without a reproducible test that ran on Linux and the hints about which variable had too many locks - so thanks! The hard part was definitely already done :)
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.
Fixed! https://github.com/espruino/Espruino/commit/4fba95ec89c36b5e337ccbe1c0973b405f81b24a
If it helps, when debugging I did:
p jsvGetRef(var)
to get the reference of the variable that had a problembreak jsLock if ref==that_reference
break jsLockAgain if var==the_vars_pointer
break jsUnLock if var==the_vars_pointer
thisVar
got overwritten, so I didwatch thisVar
and continued until I found where it was getting overwrittenBut none of that would have happened without a reproducible test that ran on Linux and the hints about which variable had too many locks - so thanks! The hard part was definitely already done :)