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

Bug Report: Crash #122

Closed gariemiller closed 3 years ago

gariemiller commented 3 years ago

Bug report

Entering any number after starting pc-basic results in a crash. See attached log typical. Operating system: Linux Mint 20. pc-basic installed via Ubuntu repository. Problem

Steps

Program

Crash log

PC-BASIC crash log

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

contextlib.py:131, exit implementation.py:415, _handle_exceptions implementation.py:424, _handle_error program.py:98, get_line_number TypeError: '<=' not supported between instances of 'int' and 'NoneType'

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/user/.local/share/pcbasic-2.0/crash-20201007-ivwxfggk.log Thank you!

Press a key to close this window. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 410, in _handle_exceptions yield File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 329, in interact self._prompt = not self._store_line(line) File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 362, in _store_line self.program.store_line(self.interpreter.direct_line) File "/usr/lib/python3/dist-packages/pcbasic/basic/program.py", line 180, in store_line raise error.BASICError(error.UNDEFINED_LINE_NUMBER) pcbasic.basic.base.error.BASICError

During handling of the above exception, another exception occurred:

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 329, in interact self._prompt = not self._store_line(line) File "/usr/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 415, in _handle_exceptions self._handle_error(e) File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 424, in _handle_error self.screen.write(e.get_message(self.program.get_line_number(e.pos))) File "/usr/lib/python3/dist-packages/pcbasic/basic/program.py", line 98, in get_line_number if linum_pos <= pos and linum > pre: TypeError: '<=' not supported between instances of 'int' and 'NoneType'

==== Screen Pages ================================================================================== +--------------------------------------------------------------------------------+ 0 |PC-BASIC 2.0.2 | 14 1 |(C) Copyright 2013--2019 Rob Hagemans. | 38 2 |60300 Bytes free | 16 3 |Ok? | 3 4 |a | 1 5 |Syntax error? | 13 6 |Ok? | 3 7 |1 | 1 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 | 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 +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ 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 +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ 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 ================================================================================ b'00' b'0000' (ENDS) b'' b'' ==== Program ======================================================================================= ==== Options ======================================================================================= []

Notes

PC-BASIC version:
Operating system version:

robhagemans commented 3 years ago

This is a duplicate of issue #114 - it was resolved in the latest release 2.0.3, please upgrade.

I don't manage the Ubuntu repo (in fact this is the first time I hear of it having been released there) so please contact the maintainer to let them know as well.

gariemiller commented 3 years ago

Thanks for the quick response Rob. Sorry I didn't notice the earlier 114. I am considering filing a Bug Report at Debian or Ubuntu but they will pick 203 up in their repo at some time in any case.

Garie

gariemiller commented 3 years ago

I see 203 is in Debian "Sid". It will probably get picked up when they release "Bullseye" next year, and thence to Ubuntu 22. I think a Bug Report in this case would clutter things.

Garie

robhagemans commented 3 years ago

Hi Garie, thanks for following up. I guess things (understandably) move quite slowly at Debian/Ubuntu, might be best to just use PyPI which I keep up to date. pip3 install pcbasic should work just fine...