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

SystemError from class 'int' #87045

Closed
jollyoliver657 mannequin opened this issue Jan 9, 2021 · 6 comments
Closed

SystemError from class 'int' #87045

jollyoliver657 mannequin opened this issue Jan 9, 2021 · 6 comments
Labels
3.8 only security fixes

Comments

@jollyoliver657
Copy link
Mannequin

jollyoliver657 mannequin commented Jan 9, 2021

BPO 42879
Nosy @mdickinson, @vstinner, @serhiy-storchaka
Files
  • Movement.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-01-13.09:05:51.828>
    created_at = <Date 2021-01-09.22:50:07.922>
    labels = ['3.8']
    title = "SystemError from class 'int'"
    updated_at = <Date 2021-01-13.11:27:04.052>
    user = 'https://bugs.python.org/jollyoliver657'

    bugs.python.org fields:

    activity = <Date 2021-01-13.11:27:04.052>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-01-13.09:05:51.828>
    closer = 'mark.dickinson'
    components = []
    creation = <Date 2021-01-09.22:50:07.922>
    creator = 'jollyoliver657'
    dependencies = []
    files = ['49731']
    hgrepos = []
    issue_num = 42879
    keywords = []
    message_count = 6.0
    messages = ['384743', '384759', '384762', '384764', '385009', '385018']
    nosy_count = 4.0
    nosy_names = ['mark.dickinson', 'vstinner', 'serhiy.storchaka', 'jollyoliver657']
    pr_nums = []
    priority = 'normal'
    resolution = 'third party'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42879'
    versions = ['Python 3.8']

    @jollyoliver657
    Copy link
    Mannequin Author

    jollyoliver657 mannequin commented Jan 9, 2021

    This is my first bug report so I hope that this is correctly formatted. I am learning how to use pygame and encountered the following error:
    SystemError: <class 'int'> returned a result with an error set

    I googled the error message and came across the following answer on stackoverflow:
    https://stackoverflow.com/a/53796516

    This stated that the problem could exist within the implementation of python and that I should file a bug report here.

    I am using the following software installed through pip/pip3:
    Python 3.8.4
    pygame 2.0.1
    OS Edition: Windows 10 Pro
    OS Version: 20H2
    OS build: 19042.685

    The bug can be reproduced deterministically.

    @jollyoliver657 jollyoliver657 mannequin added 3.8 only security fixes labels Jan 9, 2021
    @mdickinson
    Copy link
    Member

    This is more likely to be a bug in Pygame than in Python itself. What's likely happening here is that some part of the Pygame machinery is setting an exception state but then returning a value as normal. (Generally, if some function in a C extension sets an exception, that function should return NULL or -1.) That then leaves things in an inconsistent state, and Python doesn't notice that inconsistent state until the "int" call happens.

    Please could you report to the Pygame folks, if you haven't done so already? It certainly is *possible* that it's actually a core Python bug, but even then the first step would be to eliminate the Pygame component from the code-to-reproduce.

    @jollyoliver657
    Copy link
    Mannequin Author

    jollyoliver657 mannequin commented Jan 10, 2021

    I will submit the bug report to the pygame bug tracker.

    @serhiy-storchaka
    Copy link
    Member

    With debug build of Python I get a crash in other place:

    $ ./python -Xdev Movement.py 
    pygame 1.9.6
    Hello from the pygame community. https://www.pygame.org/contribute.html
    python: Objects/abstract.c:155: PyObject_GetItem: Assertion `(item != NULL) ^ (PyErr_Occurred() != NULL)' failed.
    Fatal Python error: Aborted

    Current thread 0x00007fc3d0b6e280 (most recent call first):
    File "Movement.py", line 47 in writeGridToSurface
    File "Movement.py", line 100 in <module>

    It is very likely a bug in Pygame. Perhaps it was always here, just Python 3.8 is more strict to programming errors in extensions.

    @mdickinson
    Copy link
    Member

    Downstream issue is here: pygame/pygame#2442

    I'll close this here, since that report indicates a bug in Pygame.

    @vstinner
    Copy link
    Member

    I'll close this here, since that report indicates a bug in Pygame.

    FYI I created bpo-42923 "Py_FatalError(): dump the list of extension modules" to help users to understand that the error can come from third party C extensions rather than Python itself.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants