-
Notifications
You must be signed in to change notification settings - Fork 629
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
huge images cause bad_array_new_length exception in exrdisplay #610
Comments
Probably. I just fixed a couple bugs like that (in the deep image handling code). It wouldn't surprise me if there were more lurking. We should probably make sure the unit tests exercise code paths with very large images that are constructed to purposely overflow 32 bit math. |
Can you share how you generated the image, so we can reproduce it for testing? Is there anything particularly special about it other than the large size? |
I tried some Nothing special apart from large dimensions. File has The large file was created with The tiles were created with I gave arguments to |
If you just want a quick way to generate a large test image and have OpenImageIO installed, you can do something like:
(oops, fixed typo) |
@lgritz, I get a similar error from
|
oops. Interesting! |
Works for me on my laptop, but the internal allocation for a float image of those dimensions will be around 23GB, so I can see that it might die if you don't have enough system memory. |
Ah yes, the machine I tried had less that 23GB including swap. I've found a couple of bugs - still working on one of them |
I'm now in the same position: exrdisplay opens but doesn't draw anything in the image. I suspect my graphics card can't handle rendering images that wide either. exrdisplay simply isn't intended for displaying large images. It doesn't have a pan/zoom facility, so it tries to open a 64,000 pixel wide window, and loads and renders the entire image, not just a small subsection of it. Perhaps other viewers would be better suited to this task? |
@peterhillman You inspired me to make a couple fixes: AcademySoftwareFoundation/OpenImageIO#2414 With this patch, you can generate a big file with only a 6 GB memory footprint:
Also, OIIO's "iv" viewer -- which honestly I'm not especially proud of in general -- is able to display a 64k x 32k file just fine (though rather slowly to load), even before the patch. |
Following up on this, @peterhillman, you mentioned finding a couple bugs, are these covered in your recent commits? If so, @claudeha, can you confirm that it no longer crashes? I'd recommending calling this resolved if the crash is fixed. As @peterhillman says, exrdisplay isn't really suited to displaying huge images. |
Commit bd6ab91 has the "bug fix" which should prevent the bad_array_length exception, but may still run out of main memory or GPU memory when displaying large images. This may itself cause a crash, or might not display the image. You will also get a window that is very large, since there is no zoom facility. |
There is still a 32bit overflow it seems (somewhere something goes negative, and is sign extended to a huge 64bit value), but I haven't checked if that is before or after the data is passed to OpenGL:
Checking the value:
Window is large (as expected), contents of the image region are plain grey (bug):
It seems It could be that the overflow is internal to Mesa/amdgpu? I might be able to check on an older NVIDIA system next week, to rule that out, or also try to replicate the issue with a smaller OpenGL program. |
With a
There are no error reports from amdgpu printed. |
I have successfully constructed a huge image using the openexr libraries (over 2 gigapixels, about 13GB of image data, about 9GB compressed):
But I can't display it:
I imagine the most likely cause might be a signed 32bit type overflowing to negative?
The text was updated successfully, but these errors were encountered: