You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Ok, just fixed. Thanks @tve - that's a hugely important one to have found! Sorry it was such a pain to track down.

    The issue was that the garbage collector would mark/sweep and would remove any vars it found that weren't referenced elsewhere. However, it assumed that once it found an object, that whole object would get removed so to do things quickly it just zeroed everything.

    Unfortunately if that object referenced something that shouldn't get garbage collected, the reference count in that non-gc'd object wouldn't get decremented :(

    In normal Espruino boards the reference count is 16 bits, and on Linux it's 32 bits, so most testing would never have hit it.

    Having said that, a normal Espruino board doing any HTTP request would fail after 65536 requests - so at one request a second it still would have broken after 24 hours!

    I'm actually kind of surprised about that because I've got an Espruino in the loft that's been doing HTTP requests every hour for months now - although I wonder whether we have enough power cuts here that it gets reset before there's a problem :)

About

Avatar for Gordon @Gordon started