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

Fatal python error when blitting onto large surfaces #3055

Open
PreciousFood opened this issue Aug 15, 2024 · 1 comment
Open

Fatal python error when blitting onto large surfaces #3055

PreciousFood opened this issue Aug 15, 2024 · 1 comment
Labels
bug Not working as intended segfault For PRs that fix segfaults or issues containing segfaults which have an higher priority

Comments

@PreciousFood
Copy link

Environment:

Platform:               Windows-10-10.0.22631-SP0
System:                 Windows
System Version:         10.0.22631
Processor:              Intel64 Family 6 Model 170 Stepping 4, GenuineIntel
Architecture:           Bits: 64bit     Linkage: WindowsPE

Python:                 CPython 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
pygame version:         2.5.0
SDL versions:           Linked: 2.30.3  Compiled: 2.30.3
SDL Mixer versions:     Linked: 2.8.0   Compiled: 2.8.0
SDL Font versions:      Linked: 2.22.0  Compiled: 2.22.0
SDL Image versions:     Linked: 2.8.2   Compiled: 2.8.2
Freetype versions:      Linked: 2.11.1  Compiled: 2.11.1

Display Driver:         windows
Mixer Driver:           wasapi

Current behavior:

A fatal python error occurs when blitting a surface onto a large coordinate on a large surface.

  • Doesn't happen when the surface is small
  • Doesn't happen when the target coordinate is small

The provided code is a stripped down version of the project I was working on. When I was testing it
I decided to see what would happen when the surface got large. My computer bluescreened with a VIDEO TDR FAILURE. This only happened the first time. I have only gotten the fatal python error since then.

It is possible that this is connected to #2288 although that claims to be fixed in SDL 2.30.x
Also might be connected to #2961 as both have to do with drawing on large surfaces

Expected behavior:

No error/crash or at the verry least an error explaining that the operation is not possible due to whatever applicable limitations

Steps to reproduce:

Run the following...

# pygame-ce 2.5.0 (SDL 2.30.3, Python 3.11.9)
import pygame

pygame.init()

pygame.print_debug_info()

a = pygame.Surface((40_000, 40_000))
b = pygame.Surface((100, 100))

a.blit(b, (20_000, 20_000))  # the problem

Result...

Fatal Python error: pygame_parachute: (pygame parachute) Segmentation Fault
Python runtime state: initialized

Current thread 0x00005ce8 (most recent call first):
  File "c:\Users\XXXXXXXX\fail.py", line 15 in <module>

Extension modules: pygame.base, pygame.constants, pygame.rect, pygame.rwobject, pygame.surflock, pygame.bufferproxy, pygame.math, pygame.surface, pygame.window, pygame.display, pygame.draw, pygame.joystick, pygame.event, pygame.imageext, pygame.image, pygame.key, pygame.mouse, pygame.time, pygame.mask, pygame.pixelcopy, pygame.transform, pygame.font, pygame.mixer_music, pygame.mixer, pygame.scrap, pygame.system, pygame._freetype (total: 27)
@PreciousFood PreciousFood added the bug Not working as intended label Aug 15, 2024
@bilhox
Copy link
Contributor

bilhox commented Aug 15, 2024

gdb stacktrace :

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
Downloading source file /usr/src/libsdl2-2.30.0+dfsg-1build3/src/video/SDL_blit_copy.c
SDL_memcpySSE (len=<optimized out>, src=0x1112560 "",
    dst=0x7ffdf94508a0 <error: Cannot access memory at address 0x7ffdf94508a0>)
    at /usr/src/libsdl2-2.30.0+dfsg-1build3/src/video/SDL_blit_copy.c:41
41              _mm_stream_ps((float *)(dst + 16), values[1]);

Specific line in surface.c :

3895|        result = SDL_BlitSurface(src, srcrect, dst, dstrect);

@damusss damusss added the segfault For PRs that fix segfaults or issues containing segfaults which have an higher priority label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended segfault For PRs that fix segfaults or issues containing segfaults which have an higher priority
Projects
None yet
Development

No branches or pull requests

3 participants