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
Segfault in example aliens script if ran in loop #2543
Comments
is last part executed pre crash |
another |
I did some more testing and replaced https://github.com/Pycryptor10/pygame/blob/patch-1/src_py/sprite.py#L117-L133 with
but I never saw it get past: |
As far as I can confidently see is that the segfault happens within https://github.com/pygame/pygame/blob/main/src_py/sprite.py#L117-L133. Not sure beyond that. |
is last thing given when running python with --trace That matches to https://github.com/pygame/pygame/blob/main/src_py/sprite.py#L371 because of my debug code |
If REW1L is correct about the cause of this issue, which I am inclined to think they are, this is not a mac specific issue, and can be reproduced with import pygame
import gc
pygame.font.init()
font = pygame.font.Font(None, 20)
pygame.font.quit()
pygame.font.init()
del font
gc.collect()
print('hey') # never reached |
Fix issue #2543 segfault in font dealloc after reinit
I cannot seem to reproduce this segfault in the latest version which has the font segfault fix PR merged, so this issue is fixed by that as well (please re-open if you can still reproduce this :) ) |
Environment:
You can get some of this info from the text that pops up in the console when you run a pygame program.
Current behavior:
After ~5 minutes of playing, python will give
zsh: segmentation fault python3 -m pygame.examples.aliens
Expected behavior:
The game does not segfault
Screenshots
If applicable, copy and paste screenshots to help explain your problem.
Steps to reproduce:
python3 -m pygame.examples.aliens
Test code
https://github.com/pygame/pygame/compare/main...Pycryptor10:patch-1.diff
Stack trace/error output/other error logs
See files attached to https://bugs.python.org/issue43671 as I thought it could be a python issue first
The text was updated successfully, but these errors were encountered: