robhagemans / pcbasic

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

PEEK(9800) crashes system #151

Closed MartinHepperle closed 2 years ago

MartinHepperle commented 2 years ago

PC_BASIC Python BUG with PEEK()

Also: exception output seems to be missing line breaks.

EXCEPTION
:PRINT PEEK(9800)
machine.py:284, get_memory
None
machine.py:432, get_data_memory
None
machine.py:482, get_data_memory_array
None
machine.py:382, get_name_in_memory
None
IndexError: string index out of range
This is a bug in PC-BASIC.
Sorry about that. Please file a bug report at https://sourceforge.net/p/pcbasic/discussion/bugs/ or 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. Thank you!
Ok 

1LIST 2RUN? 3LOAD" 4SAVE" 5CONT? 6,"LPT1 7TRON? 8TROFF? 9KEY 0SCREEN

rbergen commented 2 years ago

@MartinHepperle What versions of PC-BASIC and Python are you using?

robhagemans commented 2 years ago

Hi thanks for the bug report - I can't reproduce, however that is probably because it depends on an array having been defined prior to the PEEK - @MartinHepperle is there program code you could share that reproduces this?

From the stack trace I can tell this is from a 1.2 release - get_name_in_memory no longer exists in 2.0.x, and is at line 382 in machine.py on the last 1.2 release. If you have steps/code to reproduce I can check if it also occurs in 2.0.x, where it would be more likely to get fixed

MartinHepperle commented 2 years ago

Thank you for your time - obvioulsy my copy was rather outdated. I will upgrade to the latest version and report if the problem ist still there.

MartinHepperle commented 2 years ago

Solution: upgraded to most recent version.