Crash when reading large JPEG #120113

Closed
opened 2024-03-31 12:41:13 +02:00 by Richard Antalik · 6 comments

System Information
Operating system: Linux-6.2.0-39-generic-x86_64-with-glibc2.37 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.146.02

Blender Version
Broken: version: 4.0 - 4.2.0 Alpha, branch: main, commit date: 2024-03-25 22:39, hash: 7314c86869a7
Worked: 3.6.10

Caused by 406cfd214a

Short description of error
Blender crashes shortly after opening .blend file

Exact steps for others to reproduce the error
Open .blend file from #120085

**System Information** Operating system: Linux-6.2.0-39-generic-x86_64-with-glibc2.37 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.146.02 **Blender Version** Broken: version: 4.0 - 4.2.0 Alpha, branch: main, commit date: 2024-03-25 22:39, hash: `7314c86869a7` Worked: 3.6.10 Caused by 406cfd214aaa **Short description of error** Blender crashes shortly after opening .blend file **Exact steps for others to reproduce the error** Open [.blend file](https://projects.blender.org/attachments/62e3653f-1d4c-4a5b-b46b-df9525a9cce6) from #120085
Richard Antalik added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2024-03-31 12:41:14 +02:00
Author
Member

Could not access memory of rect at

ibJpegImageFromCinfo(jpeg_decompress_struct * cinfo, int flags, int max_size, size_t * r_width, size_t * r_height) (/home/me/blender-git/1/source/blender/imbuf/intern/jpeg.cc:320)
imb_load_jpeg(const uchar * buffer, size_t size, int flags, char * colorspace) (/home/me/blender-git/1/source/blender/imbuf/intern/jpeg.cc:468)
IMB_ibImageFromMemory(const uchar * mem, size_t size, int flags, char * colorspace, const char * descr) (/home/me/blender-git/1/source/blender/imbuf/intern/readimage.cc:103)
load_image_single(Image * ima, ImageUser * iuser, int cfra, const int view_id, const bool has_packed, const bool is_sequence, bool * r_cache_ibuf) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4174)
image_load_image_file(Image * ima, ImageUser * iuser, int entry, int cfra, bool is_sequence) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4279)
image_acquire_ibuf(Image * ima, ImageUser * iuser, void ** r_lock) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4676)
BKE_image_acquire_ibuf(Image * ima, ImageUser * iuser, void ** r_lock) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4752)
image_get_gpu_texture(Image * ima, ImageUser * iuser, const bool use_viewers, const bool use_tile_mapping) (/home/me/blender-git/1/source/blender/blenkernel/intern/image_gpu.cc:428)
BKE_image_get_gpu_material_texture(Image * image, ImageUser * iuser, const bool use_tile_mapping) (/home/me/blender-git/1/source/blender/blenkernel/intern/image_gpu.cc:494)
DRW_shgroup_add_material_resources(DRWShadingGroup * grp, GPUMaterial * material) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_data.cc:1831)
material_opaque(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Material * ma, const bool is_hair) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_materials.cc:677)
eevee_material_cache_get(bool is_hair, int slot, Object * ob, EEVEE_ViewLayerData * sldata, EEVEE_Data * vedata) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_materials.cc:797)
EEVEE_materials_cache_populate(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Object * ob, bool * cast_shadow) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_materials.cc:846)
EEVEE_cache_populate(void * vedata, Object * ob) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_engine.cc:120)
drw_engines_cache_populate(Object * ob) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_c.cc:1087)
DRW_draw_render_loop_ex(Depsgraph * depsgraph, RenderEngineType * engine_type, ARegion * region, View3D * v3d, GPUViewport * viewport, const bContext * evil_C) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_c.cc:1722)
DRW_draw_view(const bContext * C) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_c.cc:1625)
view3d_draw_view(const bContext * C, ARegion * region) (/home/me/blender-git/1/source/blender/editors/space_view3d/view3d_draw.cc:1571)
view3d_main_region_draw(const bContext * C, ARegion * region) (/home/me/blender-git/1/source/blender/editors/space_view3d/view3d_draw.cc:1606)
ED_region_do_draw(bContext * C, ARegion * region) (/home/me/blender-git/1/source/blender/editors/screen/area.cc:528)
Could not access memory of `rect` at ``` ibJpegImageFromCinfo(jpeg_decompress_struct * cinfo, int flags, int max_size, size_t * r_width, size_t * r_height) (/home/me/blender-git/1/source/blender/imbuf/intern/jpeg.cc:320) imb_load_jpeg(const uchar * buffer, size_t size, int flags, char * colorspace) (/home/me/blender-git/1/source/blender/imbuf/intern/jpeg.cc:468) IMB_ibImageFromMemory(const uchar * mem, size_t size, int flags, char * colorspace, const char * descr) (/home/me/blender-git/1/source/blender/imbuf/intern/readimage.cc:103) load_image_single(Image * ima, ImageUser * iuser, int cfra, const int view_id, const bool has_packed, const bool is_sequence, bool * r_cache_ibuf) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4174) image_load_image_file(Image * ima, ImageUser * iuser, int entry, int cfra, bool is_sequence) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4279) image_acquire_ibuf(Image * ima, ImageUser * iuser, void ** r_lock) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4676) BKE_image_acquire_ibuf(Image * ima, ImageUser * iuser, void ** r_lock) (/home/me/blender-git/1/source/blender/blenkernel/intern/image.cc:4752) image_get_gpu_texture(Image * ima, ImageUser * iuser, const bool use_viewers, const bool use_tile_mapping) (/home/me/blender-git/1/source/blender/blenkernel/intern/image_gpu.cc:428) BKE_image_get_gpu_material_texture(Image * image, ImageUser * iuser, const bool use_tile_mapping) (/home/me/blender-git/1/source/blender/blenkernel/intern/image_gpu.cc:494) DRW_shgroup_add_material_resources(DRWShadingGroup * grp, GPUMaterial * material) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_data.cc:1831) material_opaque(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Material * ma, const bool is_hair) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_materials.cc:677) eevee_material_cache_get(bool is_hair, int slot, Object * ob, EEVEE_ViewLayerData * sldata, EEVEE_Data * vedata) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_materials.cc:797) EEVEE_materials_cache_populate(EEVEE_Data * vedata, EEVEE_ViewLayerData * sldata, Object * ob, bool * cast_shadow) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_materials.cc:846) EEVEE_cache_populate(void * vedata, Object * ob) (/home/me/blender-git/1/source/blender/draw/engines/eevee/eevee_engine.cc:120) drw_engines_cache_populate(Object * ob) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_c.cc:1087) DRW_draw_render_loop_ex(Depsgraph * depsgraph, RenderEngineType * engine_type, ARegion * region, View3D * v3d, GPUViewport * viewport, const bContext * evil_C) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_c.cc:1722) DRW_draw_view(const bContext * C) (/home/me/blender-git/1/source/blender/draw/intern/draw_manager_c.cc:1625) view3d_draw_view(const bContext * C, ARegion * region) (/home/me/blender-git/1/source/blender/editors/space_view3d/view3d_draw.cc:1571) view3d_main_region_draw(const bContext * C, ARegion * region) (/home/me/blender-git/1/source/blender/editors/space_view3d/view3d_draw.cc:1606) ED_region_do_draw(bContext * C, ARegion * region) (/home/me/blender-git/1/source/blender/editors/screen/area.cc:528) ```
Member

I can confirm this behaviour on macOS, but not Windows (tested with a Nvidia and AMD GPU on Windows). The crash on macOS occurs during the setup of Metal textures. While according to your crash logs on linux, it points to a issue while loading the image. So these might not be the same issue.

I did look at the file and the jpeg file seems to be corrupted because there is a region in the middle of the image that seems to have the wrong colour, and the top of the image uses the alpha channel to turn transparent. Yet jpeg doesn't support alpha channels, so I'm not sure how this part got here. Confirming at the moment.

System Information
Operating system: macOS-14.2.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Pro 1.2
Blender version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: 40a5e739e270

I can confirm this behaviour on macOS, but not Windows (tested with a Nvidia and AMD GPU on Windows). The crash on macOS occurs during the setup of Metal textures. While according to your crash logs on linux, it points to a issue while loading the image. So these might not be the same issue. I did look at the file and the jpeg file seems to be corrupted because there is a region in the middle of the image that seems to have the wrong colour, and the top of the image uses the alpha channel to turn transparent. Yet jpeg doesn't support alpha channels, so I'm not sure how this part got here. Confirming at the moment. **System Information** Operating system: macOS-14.2.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 Pro 1.2 Blender version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: `40a5e739e270`
Alaska added
Status
Confirmed
Module
Pipeline, Assets & IO
and removed
Status
Needs Triage
labels 2024-03-31 13:16:22 +02:00
Member

Are we talking about du01.jpg from #120085 (attached here again)?

Dont see any wrong colors or alpha (when inspected in other applications like gimp)

Prefer if we set crashers to High priority (of course could be lowered again if considered not severe enough)

Are we talking about `du01.jpg` from #120085 (attached here again)? Dont see any wrong colors or alpha (when inspected in other applications like gimp) Prefer if we set crashers to High priority (of course could be lowered again if considered not severe enough)
Member

Sorry, the weird colours and alpha only appear when it's opened in Blender. Which means the file is corrupted when it's opened by Blender, not that the file is corrupt itself.

I only discovered this later on.

Sorry, the weird colours and alpha only appear when it's opened in Blender. Which means the file is corrupted when it's opened by Blender, not that the file is corrupt itself. I only discovered this later on.
Member

And this loads fine into 3.6.10, will check when this broke

And this loads fine into 3.6.10, will check when this broke
Member

Caused by 406cfd214a

CC @Sergey (possible fix is in !120214 -- havent checked though if this is an issue in other spots affected by 406cfd214a as well...)

Caused by 406cfd214aaa CC @Sergey (possible fix is in !120214 -- havent checked though if this is an issue in other spots affected by 406cfd214aaa as well...)
Philipp Oeser changed title from Crash when reading JPEG to Crash when reading large JPEG 2024-04-03 16:35:22 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-03 17:39:28 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
3 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#120113
No description provided.