Skip to content
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

Crash when running AUTO . #230

Open
PatchMixolydic opened this issue Nov 19, 2023 · 1 comment
Open

Crash when running AUTO . #230

PatchMixolydic opened this issue Nov 19, 2023 · 1 comment
Assignees
Labels

Comments

@PatchMixolydic
Copy link

PatchMixolydic commented Nov 19, 2023

Bug report

Problem

According to the documentation, AUTO . should provide automatic line numbering starting from the last program line stored.
However, attempting to use it causes the interpreter to throw a TypeError.

Steps

  1. Start PC-BASIC.
  2. Execute AUTO ..

Program

10 AUTO .

Crash log

Crash log
PC-BASIC crash log
====================================================================================================
FATAL ERROR
version   2.0.5 [ unreleased ]
python    3.11.2 [64bit ELF] 
platform  Linux-6.1.0-9-amd64-x86_64-with-glibc2.36
interface VideoSDL2, AudioSDL2
statement :AUTO .

main.py:119, _run_session
api.py:149, interact
implementation.py:315, interact
implementation.py:365, _auto_step
TypeError: %d format: a real number is required, not bytes

This is a bug in PC-BASIC.
Sorry about that. You can help improve PC-BASIC:

  • Please file a bug report, including this message and the steps you took
    just before the crash. Go to:
    https://github.com/robhagemans/pcbasic/issues

  • Please include the full crash log in your report.
    You can paste it from the clipboard or from the file at:
    /home/patchmixolydic/.local/share/pcbasic-2.0/crash-20231119-t21nxalz.log
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/pcbasic/guard.py", line 51, in protect
    yield
    File "/usr/lib/python3/dist-packages/pcbasic/main.py", line 119, in _run_session
    session.interact()
    File "/usr/lib/python3/dist-packages/pcbasic/basic/api.py", line 149, in interact
    self._impl.interact()
    File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 315, in interact
    self._auto_step()
    File "/usr/lib/python3/dist-packages/pcbasic/basic/implementation.py", line 365, in _auto_step
    numstr = b'%d' % (self._auto_linenum,)
    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
    TypeError: %d format: a real number is required, not bytes

==== Screen Pages ==================================================================================
+--------------------------------------------------------------------------------+
0 |PC-BASIC 2.0.5 | 14
1 |(C) Copyright 2013--2022 Rob Hagemans. | 38
2 |60300 Bytes free | 16
3 |Ok? | 3
4 |AUTO . | 6
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 | 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

This happens whether or not there are any stored program lines (eg. typing 10 BEEP followed by AUTO . will still crash).

PC-BASIC version: Log from 2.0.5 (provided by Debian), reproduces on 2.0.7 (bb50fbf 2023-04-02 15:17:45.995101)
Operating system version: Log from Debian Sid (Linux-6.1.0-9-amd64-x86_64-with-glibc2.36), reproduces on Arch Linux (Linux-6.1.62-1-lts-x86_64-with-glibc2.38)

@Marrin
Copy link

Marrin commented Nov 19, 2023

I can reproduce this with PC-BASIC 2.0.6.

@robhagemans robhagemans self-assigned this Dec 23, 2023
GBR-613 pushed a commit to GBR-613/pcbasic that referenced this issue Mar 6, 2024
@GBR-613 GBR-613 mentioned this issue Mar 6, 2024
robhagemans added a commit that referenced this issue Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants