Skip to content

displayio REPL output on LCD can stop updating after a control-c on long output #2689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kevinjwalters opened this issue Mar 8, 2020 · 2 comments

Comments

@kevinjwalters
Copy link

kevinjwalters commented Mar 8, 2020

If I inspect a huge array in CircuitPython 5.0.0's REPL with the serial console output active on the LCD (on Adafruit CLUE) and interrupt the output with control-C "half" way through then the serial console over USB continues to work fine as expected but the LCD screen freezes and no longer updates.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>>
>>>
>>> bigarray = [12345] * 10000
>>> bigarray   # press control-c after a second or two
[12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345,
 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345,
 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 
 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345,
 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345,
 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345, 12345,
@dhalbert dhalbert added this to the 5.x.x - Bug Fixes milestone Mar 12, 2020
@kevinjwalters
Copy link
Author

kevinjwalters commented Apr 26, 2020

I just experienced a variant of this or perhaps a different issue on CircuitPython 5.2.0. I tried to copy over code.py as I normally would and it paused and didn't appear to copy any bytes. After maybe 20 second Windows popped up a very unique looking error. I've never seen an Adafruit board elicit one of these before, Error 0x80070079: The semaphore timeout period has expired:

20200426-cp-5 2 0-windows-error-after-some-timeout-explorer-copying-over-circuitpy-code py

The serial console was being written to by the application and that continued for a while but then did stop and go into the "no output, only accepting control-c" mode.

After that I could copy files onto CIRCUITPY ok and it would trigger a restart of the application. The application froze and I'm guessing that's because it's blocked writing to the serial console. Reconnecting to the serial console over USB connects up but no output and oddly control-c doesn't even work.

The reset button the boad saved the day.

Actually re-reading this ticket, this is more like #2686.

@tannewt tannewt modified the milestones: 5.x.x - Bug Fixes, Long term Jul 14, 2020
jepler added a commit to jepler/circuitpython that referenced this issue Aug 25, 2020
In relatively unusual circumstances, such as entering `l = 17 ** 17777`
at the REPL, you could hit ctrl-c, but not get KeyboardInterrupt.
This can lead to a condition where the display would stop updating (adafruit#2689).
jepler added a commit to jepler/circuitpython that referenced this issue Aug 25, 2020
In adafruit#2689, hitting ctrl-c during the printing of an object with a lot of sub-objects could cause the screen to stop updating (without showing a KeyboardInterrupt).  This makes the printing of such objects acutally interruptable, and also correctly handles the KeyboardInterrupt:

```
>>> l = ["a" * 100] * 200
>>> l
['aaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaa', Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyboardInterrupt:
>>>
```
@kevinjwalters
Copy link
Author

I can't remember if control-c would actually interrupt the serial output on 5.0.0. I just tried this with lists and ulab arrays on 5.3.1 and control-c cannot interrupt a variable inspection from REPL over USB serial console.

I suppose the memory constraints of these devices mean that the output will tend to complete in a reasonable amout of time for straightforward data structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants