-
Notifications
You must be signed in to change notification settings - Fork 9
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
Strange crash when paging down a particular file in a text editor #7
Comments
This happens on both the RC2014-compatible board and on a standalone one that I don't think you sell any more, that I bought online from a chap in Gibraltar, which I think rules out any possibility that I have a faulty board. |
From watching the video back frame-by-frame it appears to get stuck on the first line in the file that is more than 80 characters wide (it's 81), which seems like it could be a good clue. The editor is meant to stop the line at 80, but even if it doesn't I don't think the terminal should crash every time it has to line wrap. |
In this file: https://github.com/maccasoft/propeller-vt100-terminal/blob/master/com.serial.terminal.spin#L307 For "other" it only writes into |
I tried making a new file and typing a line that is as wide as the screen and it caused the terminal to crash, so I'm pretty sure this is the problem, but I don't quite see why overflowing a line, other than the bottom one, causes a crash rather than just overwriting the start of the next line. I'm also surprised that this has never been observed before - I wonder if my editor also has an off-by-1 error on the line width which is triggering this bug in a way that most wouldn't. |
I can't actually find anything that calls |
The terminal firmware doesn't provide any editing capability, it only decodes the ANSI escape codes. |
kilo-hamurabi.log I've attached a capture of the bytes output in a session booting up, starting the editor, and paging down 3 times. I believe the line "IN YEAR %u, %u PEOPLE STARVED, %u CAME TO THE CITY" is the one that crashes the terminal. |
I deleted all of the lines apart from "IN YEAR %u" and cat'd it to the VGA Serial PCB via an FTDI cable, and it still crashes. It does not crash if I delete the "ESC [ K" at the end of the line. So I'd say the problem seems to be caused by an "ESC [ K" (clear to end of line) while the cursor is already at the end of the line. |
I think the implementation of "ESC [ K" is here: |
I think the problem is in It's not quite as simple as that because there are some |
Good catch, the problem was that. I have added the zero check and now it should work correctly. If you want to test with a terminal program, the sequence |
Thanks! I've never written a binary to this before and don't have a Prop-Plug, but I'm going to follow these instructions for writing to the EEPROM: http://www.learningaboutelectronics.com/Articles/24LC256-EEPROM-circuit-with-an-arduino.php and hopefully I'll succeed. |
Perfect, that did the trick, thanks again! |
I'd be keen to see the source as I'd like to apply it to https://github.com/MorfeoMatrixx/propeller-vt100-terminal/ which adds dynamic baud rate selection. |
Great stuff, thanks Marco! 👍 |
I'm using an RC2014 VGA Serial Console in a homemade CPU, and I am encountering a strange crash when trying to edit a particular text file. Here's a video demonstrating the problem: https://www.youtube.com/watch?v=OKDQznJkS2M
This happens reliably every single time I try to page down this file by 2 pages. Steps to reproduce (although nobody but me has this computer) are:
I wonder how we would go about debugging this? I think a first step would be to capture the exact bytes that are transmitted and replay them using a USB serial cable and see if it still crashes it - that would rule out some hardware-specific timing problem and would allow others to reproduce the problem. I'll work on doing that.
The text was updated successfully, but these errors were encountered: