We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4271 - Hanging during IMG_isXV
Summary: Hanging during IMG_isXV
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-25 21:15 UTC by pdJeeves
Modified: 2018-09-27 01:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pdJeeves 2018-09-25 21:15:13 UTC
Trying to load a file from this repo: https://github.com/KhronosGroup/glTF-Sample-Models 

This hangs/freezes:

if(IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG)
{
	FILE * file = fopen("Models/glTF-Sample-Models-master/2.0/Duck/glTF/DuckCM.png", "rb");

	fseek(file, 0, SEEK_END);
	size_t size = ftell(file);
	fseek(file, 0, SEEK_SET);

	std::vector<uint8_t> vec(size);
	fread(&vec[0], 1, size, file);
	fclose(file);

	SDL_RWops* rwOps = SDL_RWFromConstMem(&vec[0], size);
	image = IMG_LoadType_RW(rwOps, 1, "PNG");
}

this works:

if(IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG)
{
	image = IMG_Load("Models/glTF-Sample-Models-master/2.0/Duck/glTF/DuckCM.png");
}

The debugger indicates that it's actually hanging in IMG_isXV; and valgrind indicates lots of uninitialized memory reads.

$sdl-config --version 
2.0.6
Comment 1 pdJeeves 2018-09-26 14:31:42 UTC
I thought i should add that i'm using a ryzen CPU, which seemed to cause crashes in a lot of libraries when it was first released, i don't know if there's something weird about the chipset that causes issues.  But i thought that may be relevant.
Comment 2 Ryan C. Gordon 2018-09-26 19:45:32 UTC
This doesn't reproduce for me, and Valgrind reports no errors, with anything from SDL2_image 2.0.0 to the latest in revision control. If you want to paste the Valgrind errors you got into this bug report, we can reopen the bug and take a look, though!

--ryan.
Comment 3 pdJeeves 2018-09-26 23:53:39 UTC
Reinstalling SDL fixed it, i guess it was a corrupt .so?
Comment 4 Ryan C. Gordon 2018-09-27 01:06:01 UTC
(In reply to pdJeeves from comment #3)
> Reinstalling SDL fixed it, i guess it was a corrupt .so?

Weird, but I'm glad it worked out!

--ryan.