CRASH (Compositer and Render-Script) #31102

Closed
opened 2012-04-25 18:44:08 +02:00 by Denis · 6 comments

%%%Crash on Windows 7 / 64 bit
Do not Crash on Windows XP / 32 bit
Tested v2.62 + v2.63RC1

I use a script, that setup materials and set some render setting before rendering.
For this a callback-function is registered.

Rendering simple image work fine, but enabling compositor nodes crash blender.


  1. Run script
  2. Render (F12)
  3. Crash (?)

Here is a problem with:

  1. composite nodes
  2. py.app.handlers.render_pre
  3. scene.render.use_color_management (possible other can also crash)

Uncheck "Use Nodes" - no crash
or
Comment out "use_color_management" - no crash

FILE:
http://www.pasteall.org/blend/13529

%%%

%%%Crash on Windows 7 / 64 bit Do not Crash on Windows XP / 32 bit Tested v2.62 + v2.63RC1 I use a script, that setup materials and set some render setting before rendering. For this a callback-function is registered. Rendering simple image work fine, but enabling compositor nodes crash blender. ------ 1) Run script 2) Render (F12) 3) Crash (?) Here is a problem with: 1) composite nodes 2) py.app.handlers.render_pre 3) scene.render.use_color_management (possible other can also crash) Uncheck "Use Nodes" - no crash or Comment out "use_color_management" - no crash FILE: http://www.pasteall.org/blend/13529 %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Script for quick overview:

import bpy

def script_callback(context):

  print("callback py")
  scene = bpy.context.scene
  scene.render.use_color_management = True # <- THIS CRASH
 	

print("start py")
bpy.app.handlers.render_pre.append(script_callback)
script_callback(0)
%%%

%%%Script for quick overview: import bpy def script_callback(context): ``` print("callback py") scene = bpy.context.scene scene.render.use_color_management = True # <- THIS CRASH ``` print("start py") bpy.app.handlers.render_pre.append(script_callback) script_callback(0) %%%

%%%Valgrind output

2887== Thread 2:

2887== Invalid read of size 8

2887== at 0x9D34FF: render_startjob (render_internal.c:395)

2887== by 0x647E36: do_job_thread (wm_jobs.c:256)

2887== by 0xF1D552: tslot_thread_start (threads.c:219)

2887== by 0x6791E0D: start_thread (in /lib/libpthread-2.15.so)

2887== by 0x75C11EC: clone (in /lib/libc-2.15.so)

2887== Address 0xdc2ab48 is 72 bytes inside a block of size 200 free'd

2887== at 0x4C29A9E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)

2887== by 0xF58F53: rem_memblock (mallocn.c:705)

2887== by 0xF58C14: MEM_freeN (mallocn.c:622)

2887== by 0x9D2DDE: render_freejob (render_internal.c:267)

2887== by 0x64819C: wm_jobs_kill_job (wm_jobs.c:365)

2887== by 0x6481E5: WM_jobs_stop_all (wm_jobs.c:378)

2887== by 0x10221A0: rna_RenderSettings_color_management_update (rna_scene.c:1081)

2887== by 0xF662A7: rna_property_update (rna_access.c:1474)

2887== by 0xF6638F: RNA_property_update (rna_access.c:1498)

2887== by 0xB16EEC: pyrna_py_to_prop (bpy_rna.c:1903)

2887== by 0xB1ACCC: pyrna_struct_setattro (bpy_rna.c:3715)

2887== by 0x5B24FB9: PyObject_SetAttr (object.c:876)

2887== by 0x5B72544: PyEval_EvalFrameEx (ceval.c:2052)

2887== by 0x5B797AE: PyEval_EvalCodeEx (ceval.c:3350)

2887== by 0x5B1061E: function_call (funcobject.c:629)

2887== by 0x5AECE9E: PyObject_Call (abstract.c:2149)

2887== by 0xB10F7B: bpy_app_generic_callback (bpy_app_handlers.c:305)

2887== by 0xEE0320: BLI_exec_cb (callbacks.c:37)

2887== by 0xA77179: RE_BlenderFrame (pipeline.c:2022)

2887== by 0x9D34FA: render_startjob (render_internal.c:393)

2887== by 0x647E36: do_job_thread (wm_jobs.c:256)

2887== by 0xF1D552: tslot_thread_start (threads.c:219)

2887== by 0x6791E0D: start_thread (in /lib/libpthread-2.15.so)

2887== by 0x75C11EC: clone (in /lib/libc-2.15.so)

The problem is the update function for 'use_color_management' kills all render jobs, including the one that initiates the python script.

Possible fix for this is...

  • support by not killing render jobs when the RNA update function is not run in the main thread.
  • not-crash by not running the update function when G.rendering == TRUE

For now, changing this value while rendering isnt supported, this fix will probably have to wait until after 2.63 release.%%%

%%%Valgrind output ## 2887== Thread 2: ## 2887== Invalid read of size 8 ## 2887== at 0x9D34FF: render_startjob (render_internal.c:395) ## 2887== by 0x647E36: do_job_thread (wm_jobs.c:256) ## 2887== by 0xF1D552: tslot_thread_start (threads.c:219) ## 2887== by 0x6791E0D: start_thread (in /lib/libpthread-2.15.so) ## 2887== by 0x75C11EC: clone (in /lib/libc-2.15.so) ## 2887== Address 0xdc2ab48 is 72 bytes inside a block of size 200 free'd ## 2887== at 0x4C29A9E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ## 2887== by 0xF58F53: rem_memblock (mallocn.c:705) ## 2887== by 0xF58C14: MEM_freeN (mallocn.c:622) ## 2887== by 0x9D2DDE: render_freejob (render_internal.c:267) ## 2887== by 0x64819C: wm_jobs_kill_job (wm_jobs.c:365) ## 2887== by 0x6481E5: WM_jobs_stop_all (wm_jobs.c:378) ## 2887== by 0x10221A0: rna_RenderSettings_color_management_update (rna_scene.c:1081) ## 2887== by 0xF662A7: rna_property_update (rna_access.c:1474) ## 2887== by 0xF6638F: RNA_property_update (rna_access.c:1498) ## 2887== by 0xB16EEC: pyrna_py_to_prop (bpy_rna.c:1903) ## 2887== by 0xB1ACCC: pyrna_struct_setattro (bpy_rna.c:3715) ## 2887== by 0x5B24FB9: PyObject_SetAttr (object.c:876) ## 2887== by 0x5B72544: PyEval_EvalFrameEx (ceval.c:2052) ## 2887== by 0x5B797AE: PyEval_EvalCodeEx (ceval.c:3350) ## 2887== by 0x5B1061E: function_call (funcobject.c:629) ## 2887== by 0x5AECE9E: PyObject_Call (abstract.c:2149) ## 2887== by 0xB10F7B: bpy_app_generic_callback (bpy_app_handlers.c:305) ## 2887== by 0xEE0320: BLI_exec_cb (callbacks.c:37) ## 2887== by 0xA77179: RE_BlenderFrame (pipeline.c:2022) ## 2887== by 0x9D34FA: render_startjob (render_internal.c:393) ## 2887== by 0x647E36: do_job_thread (wm_jobs.c:256) ## 2887== by 0xF1D552: tslot_thread_start (threads.c:219) ## 2887== by 0x6791E0D: start_thread (in /lib/libpthread-2.15.so) ## 2887== by 0x75C11EC: clone (in /lib/libc-2.15.so) The problem is the update function for 'use_color_management' kills all render jobs, including the one that initiates the python script. Possible fix for this is... - support by not killing render jobs when the RNA update function is not run in the main thread. - not-crash by not running the update function when G.rendering == TRUE For now, changing this value while rendering isnt supported, this fix will probably have to wait until after 2.63 release.%%%

%%%I think this callback should be moved outside the thread.%%%

%%%I think this callback should be moved outside the thread.%%%

%%%Actually it seems that they do need to run inside the thread, for animation rendering. I've made it not stop the thread now if it's no in the main thread, the jobs system should only ever get manipulated by the main thread anyway. Fix in svn, thanks for the report.%%%

%%%Actually it seems that they do need to run inside the thread, for animation rendering. I've made it not stop the thread now if it's no in the main thread, the jobs system should only ever get manipulated by the main thread anyway. Fix in svn, thanks for the report.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
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#31102
No description provided.