crash when adjusting textures image size on generated image #27585

Closed
opened 2011-06-05 20:14:12 +02:00 by Glen Montanaro · 15 comments

Duplicates: #30184 #28757 #27597

%%%Hi,

I have a Windows XP with internal SiS M760GX.

Using the official 2.57b from blender.org

This is what i do when blender crashes:

add a new texture to the 3rd cube.
select type image or movie
under image hit new and tick Uv test grid and untick alpha leaving the rest as is
then hit the dropdown thing to select the image and select untitled
when the image is loaded and you change the XY thing (right besides where you select if it is blank or colour grid etc...) values repeatedly after a while blender tends to crash popping up the "Blender has encountered a problem and needs to close. We are sorry for the inconvenience." Window.

this happens also to the default scene but it is more consistent on the attached blend file.

Don't know why....
%%%

**Duplicates**: #30184 #28757 #27597 %%%Hi, I have a Windows XP with internal SiS M760GX. Using the official 2.57b from blender.org This is what i do when blender crashes: add a new texture to the 3rd cube. select type image or movie under image hit new and tick Uv test grid and untick alpha leaving the rest as is then hit the dropdown thing to select the image and select untitled when the image is loaded and you change the XY thing (right besides where you select if it is blank or colour grid etc...) values repeatedly after a while blender tends to crash popping up the "Blender has encountered a problem and needs to close. We are sorry for the inconvenience." Window. this happens also to the default scene but it is more consistent on the attached blend file. Don't know why.... %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%Confirmed, included backtrace, I think we had reports like this before, is it a known todo or already reported?

Assigning to Brecht to check on.

  • 0 0x0000000000ce042a in imb_onehalf_no_alloc (ibuf2=0x2d20168, ibuf1=0x2ee31f8) at /dsk/data/src/blender/blender/source/blender/imbuf/intern/scaling.c:321
  • 1 0x0000000000ce07a4 in IMB_onehalf (ibuf1=0x2ee31f8) at /dsk/data/src/blender/blender/source/blender/imbuf/intern/scaling.c:361
  • 2 0x0000000000cdab15 in IMB_makemipmap (ibuf=0x2ee31f8, use_filter=0) at /dsk/data/src/blender/blender/source/blender/imbuf/intern/filter.c:498
  • 3 0x000000000094bbc5 in image_mipmap_test (tex=0x2d052c8, ibuf=0x2ee31f8) at /dsk/data/src/blender/blender/source/blender/render/intern/source/imagetexture.c:993
  • 4 0x000000000094bd73 in imagewraposa_aniso (tex=0x2d052c8, ima=0x2d13ac8, ibuf=0x2ee31f8, texvec=0x7fffefd3f470, dxt=0x7fffefd3f160, dyt=0x7fffefd3f150, texres=0x7fffefd3f480) at /dsk/data/src/blender/blender/source/blender/render/intern/source/imagetexture.c:1038
  • 5 0x000000000094e346 in imagewraposa (tex=0x2d052c8, ima=0x2d13ac8, ibuf=0x0, texvec=0x7fffefd3f470, DXT=0x7fffefd3f460, DYT=0x7fffefd3f450, texres=0x7fffefd3f480) at /dsk/data/src/blender/blender/source/blender/render/intern/source/imagetexture.c:1405
  • 6 0x0000000000982def in multitex (tex=0x2d052c8, texvec=0x7fffefd3f470, dxt=0x7fffefd3f460, dyt=0x7fffefd3f450, osatex=512, texres=0x7fffefd3f480, thread=1, which_output=0) at /dsk/data/src/blender/blender/source/blender/render/intern/source/render_texture.c:1206
  • 7 0x0000000000983568 in multitex_mtex (shi=0x7fffefd4e108, mtex=0x2e07698, texvec=0x7fffefd3f470, dxt=0x7fffefd3f460, dyt=0x7fffefd3f450, texres=0x7fffefd3f480) at /dsk/data/src/blender/blender/source/blender/render/intern/source/render_texture.c:1350
  • 8 0x00000000009883ad in do_material_tex (shi=0x7fffefd4e108) at /dsk/data/src/blender/blender/source/blender/render/intern/source/render_texture.c:2284
  • 9 0x00000000009a8c51 in shade_lamp_loop (shi=0x7fffefd4e108, shr=0x7fffefd53f88) at /dsk/data/src/blender/blender/source/blender/render/intern/source/shadeoutput.c:1660
  • 10 0x000000000099a685 in shade_material_loop (shi=0x7fffefd4e108, shr=0x7fffefd53f88) at /dsk/data/src/blender/blender/source/blender/render/intern/source/shadeinput.c:110
  • 11 0x000000000099ad3b in shade_input_do_shade (shi=0x7fffefd4e108, shr=0x7fffefd53f88) at /dsk/data/src/blender/blender/source/blender/render/intern/source/shadeinput.c:181
  • 12 0x00000000009cbd4e in shade_tra_samples (ssamp=0x7fffefd4e080, cache=0x0, x=128, y=0, row=0x7fffefd3f930, addpassflag=0) at /dsk/data/src/blender/blender/source/blender/render/intern/source/zbuf.c:3826
  • 13 0x00000000009cd1f0 in zbuffer_transp_shade (pa=0x2d9ccf8, rl=0x2d12068, pass=0x3e90ec8, psmlist=0x7fffefd54d30) at /dsk/data/src/blender/blender/source/blender/render/intern/source/zbuf.c:4160
  • 14 0x0000000000976f9f in zbufshadeDA_tile (pa=0x2d9ccf8) at /dsk/data/src/blender/blender/source/blender/render/intern/source/rendercore.c:1212
  • 15 0x000000000096035d in do_part_thread (pa_v=0x2d9ccf8) at /dsk/data/src/blender/blender/source/blender/render/intern/source/pipeline.c:1480
  • 16 0x0000000000cb6a93 in tslot_thread_start (tslot_p=0x3c9d148) at /dsk/data/src/blender/blender/source/blender/blenlib/intern/threads.c:218
  • 17 0x00007ffff6dc1d40 in start_thread () from /lib/libpthread.so.0
  • 18 0x00007ffff5909aed in clone () from /lib/libc.so.6%%%
%%%Confirmed, included backtrace, I think we had reports like this before, is it a known todo or already reported? Assigning to Brecht to check on. - 0 0x0000000000ce042a in imb_onehalf_no_alloc (ibuf2=0x2d20168, ibuf1=0x2ee31f8) at /dsk/data/src/blender/blender/source/blender/imbuf/intern/scaling.c:321 - 1 0x0000000000ce07a4 in IMB_onehalf (ibuf1=0x2ee31f8) at /dsk/data/src/blender/blender/source/blender/imbuf/intern/scaling.c:361 - 2 0x0000000000cdab15 in IMB_makemipmap (ibuf=0x2ee31f8, use_filter=0) at /dsk/data/src/blender/blender/source/blender/imbuf/intern/filter.c:498 - 3 0x000000000094bbc5 in image_mipmap_test (tex=0x2d052c8, ibuf=0x2ee31f8) at /dsk/data/src/blender/blender/source/blender/render/intern/source/imagetexture.c:993 - 4 0x000000000094bd73 in imagewraposa_aniso (tex=0x2d052c8, ima=0x2d13ac8, ibuf=0x2ee31f8, texvec=0x7fffefd3f470, dxt=0x7fffefd3f160, dyt=0x7fffefd3f150, texres=0x7fffefd3f480) at /dsk/data/src/blender/blender/source/blender/render/intern/source/imagetexture.c:1038 - 5 0x000000000094e346 in imagewraposa (tex=0x2d052c8, ima=0x2d13ac8, ibuf=0x0, texvec=0x7fffefd3f470, DXT=0x7fffefd3f460, DYT=0x7fffefd3f450, texres=0x7fffefd3f480) at /dsk/data/src/blender/blender/source/blender/render/intern/source/imagetexture.c:1405 - 6 0x0000000000982def in multitex (tex=0x2d052c8, texvec=0x7fffefd3f470, dxt=0x7fffefd3f460, dyt=0x7fffefd3f450, osatex=512, texres=0x7fffefd3f480, thread=1, which_output=0) at /dsk/data/src/blender/blender/source/blender/render/intern/source/render_texture.c:1206 - 7 0x0000000000983568 in multitex_mtex (shi=0x7fffefd4e108, mtex=0x2e07698, texvec=0x7fffefd3f470, dxt=0x7fffefd3f460, dyt=0x7fffefd3f450, texres=0x7fffefd3f480) at /dsk/data/src/blender/blender/source/blender/render/intern/source/render_texture.c:1350 - 8 0x00000000009883ad in do_material_tex (shi=0x7fffefd4e108) at /dsk/data/src/blender/blender/source/blender/render/intern/source/render_texture.c:2284 - 9 0x00000000009a8c51 in shade_lamp_loop (shi=0x7fffefd4e108, shr=0x7fffefd53f88) at /dsk/data/src/blender/blender/source/blender/render/intern/source/shadeoutput.c:1660 - 10 0x000000000099a685 in shade_material_loop (shi=0x7fffefd4e108, shr=0x7fffefd53f88) at /dsk/data/src/blender/blender/source/blender/render/intern/source/shadeinput.c:110 - 11 0x000000000099ad3b in shade_input_do_shade (shi=0x7fffefd4e108, shr=0x7fffefd53f88) at /dsk/data/src/blender/blender/source/blender/render/intern/source/shadeinput.c:181 - 12 0x00000000009cbd4e in shade_tra_samples (ssamp=0x7fffefd4e080, cache=0x0, x=128, y=0, row=0x7fffefd3f930, addpassflag=0) at /dsk/data/src/blender/blender/source/blender/render/intern/source/zbuf.c:3826 - 13 0x00000000009cd1f0 in zbuffer_transp_shade (pa=0x2d9ccf8, rl=0x2d12068, pass=0x3e90ec8, psmlist=0x7fffefd54d30) at /dsk/data/src/blender/blender/source/blender/render/intern/source/zbuf.c:4160 - 14 0x0000000000976f9f in zbufshadeDA_tile (pa=0x2d9ccf8) at /dsk/data/src/blender/blender/source/blender/render/intern/source/rendercore.c:1212 - 15 0x000000000096035d in do_part_thread (pa_v=0x2d9ccf8) at /dsk/data/src/blender/blender/source/blender/render/intern/source/pipeline.c:1480 - 16 0x0000000000cb6a93 in tslot_thread_start (tslot_p=0x3c9d148) at /dsk/data/src/blender/blender/source/blender/blenlib/intern/threads.c:218 - 17 0x00007ffff6dc1d40 in start_thread () from /lib/libpthread.so.0 - 18 0x00007ffff5909aed in clone () from /lib/libc.so.6%%%

%%%A backtrace on windows, though it gives similar results to mine.
https://projects.blender.org/tracker/index.php?func=detail&aid=27597&group_id=9&atid=498%%%

%%%A backtrace on windows, though it gives similar results to mine. https://projects.blender.org/tracker/index.php?func=detail&aid=27597&group_id=9&atid=498%%%

%%%closing duplicate [#28757]%%%

%%%closing duplicate [#28757]%%%

%%%Closed report related on the same thread-unsafe Image datablock http://projects.blender.org/tracker/index.php?func=detail&aid=29847&group_id=9&atid=498%%%

%%%Closed report related on the same thread-unsafe Image datablock http://projects.blender.org/tracker/index.php?func=detail&aid=29847&group_id=9&atid=498%%%
%%%losing duplicated report http://projects.blender.org/tracker/?func=detail&atid=498&aid=30184&group_id=9%%%

%%%Any updates here? %%%

%%%Any updates here? %%%

%%%Well, no updates and it's in fact pretty nasty bug. Need to be some kind of image editing lock or so when backing/drawing preview.%%%

%%%Well, no updates and it's in fact pretty nasty bug. Need to be some kind of image editing lock or so when backing/drawing preview.%%%
Member

%%%Will assign this to me.%%%

%%%Will assign this to me.%%%
Member

%%%
Note: adjusting x or y resolution of a texture image in use is not supported; the buttons have been greyed out now.
I also noticed the image gets not assigned, that's fixed.

Fix goes to svn now.%%%

%%% Note: adjusting x or y resolution of a texture image in use is not supported; the buttons have been greyed out now. I also noticed the image gets not assigned, that's fixed. Fix goes to svn now.%%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

%%%Crash would also happen when you're changing generated type of the image. Also i don't feel it's fine to disable resolution sliders just to solve texture preview.%%%

%%%Crash would also happen when you're changing generated type of the image. Also i don't feel it's fine to disable resolution sliders just to solve texture preview.%%%

%%%Actually pretty simple fix would be to make BKE_image_get_ibuf referencing the image buffer (call IMB_refImBuf) and make all users of BKE_image_get_ibuf calling IMB_freeImBuf when they've finished working with the buffer. This should fix all crashes caused by changing the image when it's used.

Ton, do you wanna to look into this yourself or you'd prefer me to make all areas threadsafe with image buffer? ;)

P.S. Mutes to IMB_refImBuf/IMB_freeImBuf should be added tho.%%%

%%%Actually pretty simple fix would be to make BKE_image_get_ibuf referencing the image buffer (call IMB_refImBuf) and make all users of BKE_image_get_ibuf calling IMB_freeImBuf when they've finished working with the buffer. This should fix all crashes caused by changing the image when it's used. Ton, do you wanna to look into this yourself or you'd prefer me to make all areas threadsafe with image buffer? ;) P.S. Mutes to IMB_refImBuf/IMB_freeImBuf should be added tho.%%%

%%%Ton, got some time tonight to make a quick prove-of-concept patch. Attached it here as image_threadsafe_concept.patch

Definitely requires some more time on making mipmaps and colormanage/movieclip freeing looking nice (i still thought mutex is per-thread lock and the same thread could enter the same mutex multiple times, which is in fact wrong, but easy to fix). Also imagetexture.c should stop getting image buffer for every pixel, think it's not so difficult to solve as well.

If you would consider this is correct way, i could finish the work, otherwise will just throw the patch into canal :)

P.S. Another issue is that some areas calls imb_freerectfloat directly. It's not related to this report but also could be real pain and this issue isn't solving by current patch.%%%

%%%Ton, got some time tonight to make a quick prove-of-concept patch. Attached it here as image_threadsafe_concept.patch Definitely requires some more time on making mipmaps and colormanage/movieclip freeing looking nice (i still thought mutex is per-thread lock and the same thread could enter the same mutex multiple times, which is in fact wrong, but easy to fix). Also imagetexture.c should stop getting image buffer for every pixel, think it's not so difficult to solve as well. If you would consider this is correct way, i could finish the work, otherwise will just throw the patch into canal :) P.S. Another issue is that some areas calls imb_freerectfloat directly. It's not related to this report but also could be real pain and this issue isn't solving by current patch.%%%

%%%Argh, that was second time i'm forgetting to mention some information.

This change would make it easy to switch from Image->ibufs "cache" of image sequence to MovieCache which could limit number of cached images by size. It'll resolve old issue with high memory usage when using Image Sequence as, say, viewport background.

So i'm voting for finishing current patch :)%%%

%%%Argh, that was second time i'm forgetting to mention some information. This change would make it easy to switch from Image->ibufs "cache" of image sequence to MovieCache which could limit number of cached images by size. It'll resolve old issue with high memory usage when using Image Sequence as, say, viewport background. So i'm voting for finishing current patch :)%%%
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
5 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#27585
No description provided.