robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
393 stars 48 forks source link

Editing in Screen Mode 9 crashes in Ubuntu when crossing the right edge #199

Closed goldnchild closed 2 years ago

goldnchild commented 2 years ago

Bug report

Problem

PC Basic crashes when in SCREEN MODE 9 while editing text when you hit the right edge of the screen.

Steps

  1. do a screen 9 command
  2. edit text that goes to the right edge of the screen
  3. tends to blow up when crossing the edge

Program

Crash log

Notes

PC-BASIC version: 2.0.2 Operating system version: Ubuntu 20.04

PC-BASIC crash log

FATAL ERROR version 2.0.2 [] 2020-01-19 08:56:22 python 3.8.10 [64bit ELF] platform Linux-5.4.0-121-generic-x86_64-with-glibc2.29 interface VideoSDL2, AudioSDL2 statement

textscreen.py:214, write_char textscreen.py:240, _check_wrap textscreen.py:514, scroll_down pixels.py:145, move_rect ValueError: negative dimensions are not allowed

This is a bug in PC-BASIC. Sorry about that. To help improve PC-BASIC, please file a bug report at https://github.com/robhagemans/pcbasic/issues Please include the messages above and as much information as you can about what you were doing and how this happened. Please attach the log file /home/customer/.local/share/pcbasic-2.0/crash-20220714-_oncjzuo.log Thank you!

Press a key to close this window. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pcbasic/guard.py", line 66, in protect yield File "/usr/lib/python3/dist-packages/pcbasic/main.py", line 114, in run_session session.interact() File "/usr/lib/python3/dist-packages/pcbasic/basic/api.py", line 124, in interact self._impl.interact() File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 328, in interact line = self.editor.wait_screenline(from_start=True) File "/usr/lib/python3/dist-packages/pcbasic/basic/editor.py", line 119, in wait_screenline prompt_row, left, right = self._interact(prompt_width) File "/usr/lib/python3/dist-packages/pcbasic/basic/editor.py", line 241, in _interact self._screen.write_char(c, do_scroll_down=True) File "/usr/lib/python3/dist-packages/pcbasic/basic/display/textscreen.py", line 214, in write_char self._check_wrap(do_scroll_down) File "/usr/lib/python3/dist-packages/pcbasic/basic/display/textscreen.py", line 240, in _check_wrap self.scroll_down(self.current_row+1) File "/usr/lib/python3/dist-packages/pcbasic/basic/display/textscreen.py", line 514, in scroll_down self.pixels.pages[self.apagenum].move_rect(sx0, sy0, sx1, sy1, tx0, ty0) File "/usr/lib/python3/dist-packages/pcbasic/basic/display/pixels.py", line 145, in move_rect self.buffer[sy0:sy1+1, sx0:sx1+1] = numpy.zeros((h, w), dtype=numpy.int8) ValueError: negative dimensions are not allowed

==== Screen Pages ================================================================================== +--------------------------------------------------------------------------------+ 0 |Ok? | 3 1 |100 dslfkj sdlkfj sdlfkjds lfksdj flkds jfldskfj ldskjf lskdjf lskdjf slkj lkjlk\ 80 2 \jslkdjf a;ldsk jfa;lskdjf a;lkdsjflkdsjflkdsjflkdsjfldskjflkdsjfldskfjj kljdfkdj\ 80 3 \kldkfjsldkjf a;lkds jfa;ldskjf al;kdsj flkdsjflkdsjflkdsjflskdjfldskjfdlkjfkdfjk\ 80 4 \lsldkfjsdl fja;lkdsjf la;kdsjf lkdsjf lskdjflkdsjflkdjfkdjfkdjfkjdkfjkjkjkjlkjlk\ 80 5 \jjjhzdflkjhdsalkfjahdskjfhadslkfh ksjdhfkjsdh kjhdfkjshdlkfajhdsflkjahdskjfjkjkk\ 80 6 \k \ 1 7 \ | 0 8 |199 dkkjsadhf akjdshf akjds hfkajds hflkajds hfkdsjhf kdsjhfkdsjfhkdsjfhjjhjhkjh\ 80 9 \hkjh kzjdhf kljdsahf lkajds hfkjdsahf kjdshfksjdhkuehfkueshfkjsdhfkdsjhfkdsjfhdj\ 80 10 \f \ 1 11 \ | 0 12 |199 dskjdhfk sdjhf ksjd hfkjsdhf ksjdhf kjdshf kjdshfkdsjhfksjdhfkejehkjh kjshek\ 80 13 \ \ 0 14 \ | 0 15 | | 0 16 | | 0 17 | | 0 18 | | 0 19 | | 0 20 | | 0 21 | | 0 22 | | 0 23 | | 0 24 | 1LIST 2RUN 3LOAD" 4SAVE" 5CONT 6,"LPT1 7TRON 8TROFF 9KEY 0SCREEN| 80 +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ 0 | | 0 1 | | 0 2 | | 0 3 | | 0 4 | | 0 5 | | 0 6 | | 0 7 | | 0 8 | | 0 9 | | 0 10 | | 0 11 | | 0 12 | | 0 13 | | 0 14 | | 0 15 | | 0 16 | | 0 17 | | 0 18 | | 0 19 | | 0 20 | | 0 21 | | 0 22 | | 0 23 | | 0 24 | | 0 +--------------------------------------------------------------------------------+ ==== Scalars =======================================================================================

==== Arrays ========================================================================================

==== Strings =======================================================================================

==== Program Buffer ================================================================================

==== Program ======================================================================================= 100 DSLFKJ SDLKFJ SDLFKJDS LFKSDJ FLKDS JFLDSKFJ LDSKJF LSKDJF LSKDJF SLKJ LKJLKJSLKDJF A;LDSK JFA;LSKDJF A;LKDSJFLKDSJFLKDSJFLKDSJFLDSKJFLKDSJFLDSKFJJ KLJDFKDJKLDKFJSLDKJF A;LKDS JFA;LDSKJF AL;KDSJ FLKDSJFLKDSJFLKDSJFLSKDJFLDSKJFDLKJFKDFJKLSLDKFJSDL FJA; 199 DKKJSADHF AKJDSHF AKJDS HFKAJDS HFLKAJDS HFKDSJHF KDSJHFKDSJFHKDSJFHJJHJHKJHHKJH KZJDHF KLJDSAHF LKAJDS HFKJDSAHF KJDSHFKSJDHKUEHFKUESHFKJSDHFKDSJHFKDSJFHDJF ==== Options =======================================================================================

robhagemans commented 2 years ago

Please try with the latest version 2.0.4, I can't reproduce this

goldnchild commented 2 years ago

I tried it on Ubuntu 22.04 and it has the 2.0.4-3 package and couldn't get it to crash.

Thanks for your pcbasic program, I really like writing little programs in it. It's really handy to have something that will do graphics.