Blender crash when showing thumbnail of a strongly skewed .exr image #89868

Closed
opened 2021-07-15 10:51:33 +02:00 by Alexander Samsonov · 26 comments

System Information
Operating system: Linux-5.8.0-59-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.80

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-07-14 22:15, hash: 4e65b1ef6c
Worked: Unknown

Short description of error
Thumbnail of strongly skewed (aspect ratio > 32) .exr image crashes blender
Blender segfaults with the error: "OpenColorIO Error: PackedImageDesc Error: Invalid image dimensions."

Exact steps for others to reproduce the error

  • Open an Image Editor.
  • Create a new image with aspect ratio greater than 32 (eg. 2048 x 32)
  • Save image as .exr
  • Click on a Image Browser near the image name, where thumbnails usually appear.

or

  • open crash.exr in image editor
  • Click on image browser

Note: the bug is not present for other file formats

crash.exr

blender_debug_output.txt

blender.crash.txt

{F10226406, width=100%}

**System Information** Operating system: Linux-5.8.0-59-generic-x86_64-with-glibc2.31 64 Bits Graphics card: GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.80 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-07-14 22:15, hash: `4e65b1ef6c` Worked: Unknown **Short description of error** Thumbnail of strongly skewed (aspect ratio > 32) .exr image crashes blender Blender segfaults with the error: "OpenColorIO Error: PackedImageDesc Error: Invalid image dimensions." **Exact steps for others to reproduce the error** - Open an Image Editor. - Create a new image with aspect ratio greater than 32 (eg. 2048 x 32) - Save image as .exr - Click on a Image Browser near the image name, where thumbnails usually appear. or - open `crash.exr` in image editor - Click on image browser Note: the bug is not present for other file formats ![crash.exr](https://archive.blender.org/developer/F10224832/crash.exr) [blender_debug_output.txt](https://archive.blender.org/developer/F10224889/blender_debug_output.txt) [blender.crash.txt](https://archive.blender.org/developer/F10224887/blender.crash.txt) {[F10226406](https://archive.blender.org/developer/F10226406/T89868.gif), width=100%}

Added subscriber: @blendersamsonov

Added subscriber: @blendersamsonov

Added subscriber: @deadpin

Added subscriber: @deadpin

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

Please attach the offending .exr image to this report. I attempted to reproduce the problem unsuccessfully using Blender's own image editor and creating an 80x2, 40x1, 2x80, and 1x40 OpenEXR image. Thumbnails and full image loading seem to work fine.

The 1x40 image did show a particular form of thumbnail problem, which has already been filed, but we need to take a look at your particular file here to know if it is different or a duplicate of the other issue. At least provide more information like the exact dimensions used and what program you used to create the .exr file.

Please attach the offending .exr image to this report. I attempted to reproduce the problem unsuccessfully using Blender's own image editor and creating an 80x2, 40x1, 2x80, and 1x40 OpenEXR image. Thumbnails and full image loading seem to work fine. The 1x40 image did show a particular form of thumbnail problem, which has already been filed, but we need to take a look at your particular file here to know if it is different or a duplicate of the other issue. At least provide more information like the exact dimensions used and what program you used to create the .exr file.

This image for example crashes blender in my case. It's an empty 1x64 image.
crash.exr

Again, this was created by blender itself and just saved as .exr image

This image for example crashes blender in my case. It's an empty 1x64 image. ![crash.exr](https://archive.blender.org/developer/F10224832/crash.exr) Again, this was created by blender itself and just saved as .exr image

This is most likely a duplicate of #70356 as the scaling routine has issues when any of the dimensions are 1. There's a patch associated with that bug that still needs to be reviewed that should fix the issue.

This is most likely a duplicate of #70356 as the scaling routine has issues when any of the dimensions are 1. There's a patch associated with that bug that still needs to be reviewed that should fix the issue.

Closed as duplicate of #70356

Closed as duplicate of #70356

Well, I wouldn't think this to be a duplicate, as large images crash blender too. Like this one (4096 x 64)
crash.exr

Well, I wouldn't think this to be a duplicate, as large images crash blender too. Like this one (4096 x 64) ![crash.exr](https://archive.blender.org/developer/F10224852/crash.exr)

Changed status from 'Duplicate' to: 'Needs Triage'

Changed status from 'Duplicate' to: 'Needs Triage'

Resetting, but I'm not able to reproduce a crash on either Windows 10 or a Linux desktop using a recent build. I'll have to leave this for other folks to look at until I can investigate further.

Resetting, but I'm not able to reproduce a crash on either Windows 10 or a Linux desktop using a recent build. I'll have to leave this for other folks to look at until I can investigate further.
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

I can confirm on windows with 2.93 and above (seems fine with 2.92 on first check)

blender.crash.txt

blender_debug_output.txt


System Information

Graphics card : AMD Radeon(TM) 535 ATI Technologies .```
I can confirm on windows with 2.93 and above (seems fine with 2.92 on first check) [blender.crash.txt](https://archive.blender.org/developer/F10224887/blender.crash.txt) [blender_debug_output.txt](https://archive.blender.org/developer/F10224889/blender_debug_output.txt) --- **System Information** ```Operating system : Windows-10-10.0.18362-SP0 64 Bits Graphics card : AMD Radeon(TM) 535 ATI Technologies .```
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

In #89868#1191475, @PratikPB2123 wrote:
I can confirm on windows with 2.93 and above (seems fine with 2.92 on first check)

Makes sense, as the stack trace points to OpenColorIO_v2_0::PackedImageDesc::getNumChannels and OCIO_v2 was added for 2.93.

> In #89868#1191475, @PratikPB2123 wrote: > I can confirm on windows with 2.93 and above (seems fine with 2.92 on first check) Makes sense, as the stack trace points to `OpenColorIO_v2_0::PackedImageDesc::getNumChannels` and OCIO_v2 was added for 2.93.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

In #89868#1191440, @blendersamsonov wrote:
Well, I wouldn't think this to be a duplicate, as large images crash blender too. Like this one (4096 x 64)
crash.exr

I can't redo the crash with the larger image, however resizing smaller images as been fixed 38131cc5e5.

Can you check if the 1px images in this report are now working?

> In #89868#1191440, @blendersamsonov wrote: > Well, I wouldn't think this to be a duplicate, as large images crash blender too. Like this one (4096 x 64) > ![crash.exr](https://archive.blender.org/developer/F10224852/crash.exr) I can't redo the crash with the larger image, however resizing smaller images as been fixed 38131cc5e5. Can you check if the 1px images in this report are now working?
Member

Hi @ideasman42 , can still recreate the crash (broken version: 118803893e)

Ok, I will add a short video to describe the steps :)

Hi @ideasman42 , can still recreate the crash (broken version: 118803893e) Ok, I will add a short video to describe the steps :)

I have also just found out that 16-bit .png image also causes a crash. So the problem might be actually related to the bit depth of the image

I have also just found out that 16-bit .png image also causes a crash. So the problem might be actually related to the bit depth of the image

Ah, now I can repro as well, thanks for the video - I was viewing thumbnails elsewhere. The issue is that we're feeding a 32x0 (obviously wrong) buffer to OpenColorIO

icon_copy_rect does the following which truncates down to 0 for the tiny y dimension in this case:
ey = (short)scaledy;

 	blender.exe!OCIO_reportError(const char * err) Line 61	C++
 	blender.exe!OCIO_reportException(OpenColorIO_v2_0::Exception & exception) Line 66	C++
 	blender.exe!`OCIOImpl::createOCIO_PackedImageDesc'::`1'::catch$0() Line 766	C++
 	[External Code]	
 	blender.exe!OCIOImpl::createOCIO_PackedImageDesc(float * data, long width, long height, long numChannels, long chanStrideBytes, long xStrideBytes, long yStrideBytes) Line 754	C++
 	blender.exe!OCIO_createOCIO_PackedImageDesc(float * data, long width, long height, long numChannels, long chanStrideBytes, long xStrideBytes, long yStrideBytes) Line 274	C++
 	blender.exe!IMB_colormanagement_processor_apply(ColormanageProcessor * cm_processor, float * buffer, int width, int height, int channels, bool predivide) Line 3890	C
 	blender.exe!colormanagement_transform_ex(unsigned char * byte_buffer, float * float_buffer, int width, int height, int channels, const unsigned char * from_colorspace, const unsigned char * to_colorspace, bool predivide, bool do_threaded) Line 1968	C
 	blender.exe!IMB_colormanagement_transform(float * buffer, int width, int height, int channels, const unsigned char * from_colorspace, const unsigned char * to_colorspace, bool predivide) Line 1982	C
 	blender.exe!IMB_rect_from_float(ImBuf * ibuf) Line 756	C
>	blender.exe!icon_copy_rect(ImBuf * ibuf, unsigned int w, unsigned int h, unsigned int * rect) Line 1324	C

 	blender.exe!icon_preview_startjob(void * customdata, short * stop, short * do_update) Line 1406	C
 	blender.exe!common_preview_startjob(void * customdata, short * stop, short * do_update, float * UNUSED_progress) Line 1456	C
 	blender.exe!other_id_types_preview_render(IconPreview * ip, IconPreviewSize * cur_size, const int pr_method, short * stop, short * do_update, float * progress) Line 1508	C
 	blender.exe!icon_preview_startjob_all_sizes(void * customdata, short * stop, short * do_update, float * progress) Line 1585	C
Ah, now I can repro as well, thanks for the video - I was viewing thumbnails elsewhere. The issue is that we're feeding a 32x0 (obviously wrong) buffer to OpenColorIO `icon_copy_rect` does the following which truncates down to 0 for the tiny y dimension in this case: ` ey = (short)scaledy;` ``` blender.exe!OCIO_reportError(const char * err) Line 61 C++ blender.exe!OCIO_reportException(OpenColorIO_v2_0::Exception & exception) Line 66 C++ blender.exe!`OCIOImpl::createOCIO_PackedImageDesc'::`1'::catch$0() Line 766 C++ [External Code] blender.exe!OCIOImpl::createOCIO_PackedImageDesc(float * data, long width, long height, long numChannels, long chanStrideBytes, long xStrideBytes, long yStrideBytes) Line 754 C++ blender.exe!OCIO_createOCIO_PackedImageDesc(float * data, long width, long height, long numChannels, long chanStrideBytes, long xStrideBytes, long yStrideBytes) Line 274 C++ blender.exe!IMB_colormanagement_processor_apply(ColormanageProcessor * cm_processor, float * buffer, int width, int height, int channels, bool predivide) Line 3890 C blender.exe!colormanagement_transform_ex(unsigned char * byte_buffer, float * float_buffer, int width, int height, int channels, const unsigned char * from_colorspace, const unsigned char * to_colorspace, bool predivide, bool do_threaded) Line 1968 C blender.exe!IMB_colormanagement_transform(float * buffer, int width, int height, int channels, const unsigned char * from_colorspace, const unsigned char * to_colorspace, bool predivide) Line 1982 C blender.exe!IMB_rect_from_float(ImBuf * ibuf) Line 756 C > blender.exe!icon_copy_rect(ImBuf * ibuf, unsigned int w, unsigned int h, unsigned int * rect) Line 1324 C blender.exe!icon_preview_startjob(void * customdata, short * stop, short * do_update) Line 1406 C blender.exe!common_preview_startjob(void * customdata, short * stop, short * do_update, float * UNUSED_progress) Line 1456 C blender.exe!other_id_types_preview_render(IconPreview * ip, IconPreviewSize * cur_size, const int pr_method, short * stop, short * do_update, float * progress) Line 1508 C blender.exe!icon_preview_startjob_all_sizes(void * customdata, short * stop, short * do_update, float * progress) Line 1585 C ```
Member

Added subscriber: @Harley

Added subscriber: @Harley
Member

@deadpin - The issue is that we're feeding a 32x0 (obviously wrong) buffer to OpenColorIO

I can see that happening with very small images, but not sure how that could happen with OP’s examples. Image of 2048 x 32 would make a thumbnail of 256x4, and so 2047x32 might get truncated to 256x3.

> @deadpin - The issue is that we're feeding a 32x0 (obviously wrong) buffer to OpenColorIO I can see that happening with very small images, but not sure how that could happen with OP’s examples. Image of 2048 x 32 would make a thumbnail of 256x4, and so 2047x32 might get truncated to 256x3.

This issue was referenced by 0de54a9cfe

This issue was referenced by 0de54a9cfea5a981bfa9fa6ef2fed25a0c0086cc

This issue was referenced by d097d35be6

This issue was referenced by d097d35be6df2f109839dde4bbc35a31f69faf89

This issue was referenced by e82c5c6607

This issue was referenced by e82c5c660778b3805f50f3f2901923692c17db2a

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2021-07-18 02:47:43 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#89868
No description provided.