The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_CreateTexture seg fault when low video RAM
AntTheAlchemist


Joined: 13 Feb 2015
Posts: 60
Location: UK
I'm getting a Sementation fault when calling SDL_CreateTexture when I limit video memory in the BIOS to 8mb. I know it's a ridiculously low amount of memory, but it's not an excuse for SDL to crash; returning an error would be preferable.

my code:

SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_TARGET, 1024, 768);

Code works as expected when video RAM is set to 32mb+. Is it another bug?
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Sure you are checking the return value isn't/is NULL?
AntTheAlchemist


Joined: 13 Feb 2015
Posts: 60
Location: UK
There is no return value, since it doesn't return, it causes a seg fault, crashing the whole system.
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
The only thing I can think is happening (as there are failure checks) is that an infinite loop is happening if a supported format is not found
SDL_CreateTexture seg fault when low video RAM
Raymond Jennings
Guest

Wouldn't an infinite loop cause a hang and not a crash?

Nitpicking, sure, but it does make me curious.


On Sat, Sep 12, 2015 at 5:02 AM, MrTAToad wrote:
Quote:
The only thing I can think is happening (as there are failure checks) is that an infinite loop is happening if a supported format is not found


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL_CreateTexture seg fault when low video RAM
j_post
Guest

If the infinite loop is eating stack space it will crash *real* quickly.


On Saturday 19 September 2015 06:54:43 Raymond Jennings wrote:
Quote:
Wouldn't an infinite loop cause a hang and not a crash?

Nitpicking, sure, but it does make me curious.

On Sat, Sep 12, 2015 at 5:02 AM, MrTAToad

wrote:
Quote:
The only thing I can think is happening (as there are failure checks) is
that an infinite loop is happening if a supported format is not found

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org