| Summary: | Segmentation fault when using window surface and accelerated renderer | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ferdinand Vesely <erdofves> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus, philipp.wiesemann |
| Version: | 2.0.2 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Test program
GDB backtrace leading to SDL_InvalidateMap GDB backtrace leading to SDL_FreePalette_REAL patch to fix a crash |
||
Created attachment 2323 [details]
GDB backtrace leading to SDL_InvalidateMap
Created attachment 2324 [details]
GDB backtrace leading to SDL_FreePalette_REAL
Created attachment 2328 [details]
patch to fix a crash
The attached patch seems to fix a crash (but maybe only by coincidence and not fixing the actual fault).
(In reply to Philipp Wiesemann from comment #3) > Created attachment 2328 [details] > patch to fix a crash > > The attached patch seems to fix a crash (but maybe only by coincidence and > not fixing the actual fault). This looks like a good fix (whether it resolves this bug or not), so feel free to push that change if you want, Phillipp. --ryan. The first patch was applied here: https://hg.libsdl.org/SDL/rev/08d023f75d78 Thanks! |
Created attachment 2322 [details] Test program I get a segmentation fault (occasionally an invalid pointer error from free()) when accessing the window surface using SDL_GetWindowSurface and then creating a renderer using SDL_CreateRenderer with SDL_RENDERER_ACCELERATED on the same window. The segfault happens when SDL_DestroyWindow is called and the backtrace leads to SDL_InvalidateMap and sometimes to SDL_FreePalette_REAL. I couldn't trigger the segfault it with SDL_RENDERER_SOFTWARE. Also if I remove the call to SDL_GetWindowSurface it works fine. Drawing using the accelerated renderer also works without a problem. The test program is attached.