New Byte Array fails without message

Issue #193 resolved
Turgut Guneysu created an issue

Upon entering a high value for the new byte array block, the system enters a failure state and the USB connection is disabled without an error message.

Compare: New list block successfully intercepts a high element count and reports a “memory exceeded” error.

Comments (4)

  1. John Maloney repo owner

    When I tried this with a size of 100000 on an M5 StickC I got an error “Error: Insufficient memory to allocate object”, as expected.

    But there could be boundary cases that fail – what board and byte count did you use? Can you provide a reproducible test case?

  2. Turgut Guneysu reporter

    Hi John,

    I was able to produce a case where newByteArray fails consistently!

    At 1000, it fails as shown in the video.

    at 10000 and above, produces error message and all is well !
    I don’t have a video of 10K case.

    micro:bit, Browser version of the IDE running in Chrome.

    micro:bit, stand-alone in WIN10.

    Check out the video for Browser Version:

    https://drive.google.com/file/d/1HN7xD7Bhtn9RjClBtG9P9TQgDhnrGFg4/view?usp=sharing

    Video for stand-alone version:

    https://drive.google.com/file/d/1ckTboImiz4f6ItyCgva__svFG1Ph8B6E/view?usp=sharing

    This could be also indicative of (totally my assumption - might NOT be the case at all) similar errors I have been reporting where editing and some other actions are causing the IDE to go into the similar state of looping trying to establish USB connectivity.

    Hope you will figure it out.

  3. John Maloney repo owner

    Found it!

    On the micro:bit v1 (at least), the virtual machine was crashing when trying to return a byte array larger than 935 bytes as a value. You could do other things with a larger byte array, such as storing it in a variable or operating on it.

    The fix will be in the next release.

    Any bug that causes the board to become unresponsive, like this one, is serious. If you know of any other bugs like that, please a new issue for each one, ideally with a way reproducing it.

    Thanks for finding this one!

  4. Log in to comment