Crash on 2.80.30 race condition #57783

Closed
opened 2018-11-12 00:10:55 +01:00 by Tyler Furby · 8 comments

System Information
macOS 10.13, 2x1080ti's, i9-7980XE

Blender Version
Build & Hash: (2.80.30 - a48bc15707)
This issue works only with: (Scenes with less objects - though the script ran perfectly fine in 2.79 with context.scene instead of context.depsgraph)

There appears to be a race condition when working with depsgraph to get mesh data and then removing the mesh to free up memory.

This issue occurs when rendering a scene with my custom add-on: Arnold Render engine.
Based on this script here:

@contextmanager
    def _Mesh(ob):
        pc = time.perf_counter()
        mesh = ob.to_mesh(depsgraph, apply_modifiers=True, calc_undeformed=True)
        if mesh is not None:
            try:
                mesh.calc_normals_split()
                arnold.AiMsgDebug(b"    mesh (%f)", ctypes.c_double(time.perf_counter() - pc))
                yield mesh
            finally:
                data.meshes.remove(mesh)
        else:
            yield None
**System Information** macOS 10.13, 2x1080ti's, i9-7980XE **Blender Version** Build & Hash: (2.80.30 - a48bc157078) This issue works only with: (Scenes with less objects - though the script ran perfectly fine in 2.79 with `context.scene` instead of `context.depsgraph`) **There appears to be a race condition when working with depsgraph to get mesh data and then removing the mesh to free up memory.** **This issue occurs when rendering a scene with my custom add-on: Arnold Render engine.** Based on this script here: ``` @contextmanager def _Mesh(ob): pc = time.perf_counter() mesh = ob.to_mesh(depsgraph, apply_modifiers=True, calc_undeformed=True) if mesh is not None: try: mesh.calc_normals_split() arnold.AiMsgDebug(b" mesh (%f)", ctypes.c_double(time.perf_counter() - pc)) yield mesh finally: data.meshes.remove(mesh) else: yield None ```
Author

Added subscriber: @tylerfurby

Added subscriber: @tylerfurby
Author
# Blender 2.80 (sub 30), Commit date: 2018-11-07 23:10, Hash a421cfa8d31
bpy.ops.object.editmode_toggle()  # Operator

# backtrace
0   blender                             0x00000001046ed0c7 BLI_system_backtrace + 55
1   blender                             0x0000000103ba9c0a sig_handle_crash + 362
2   libsystem_platform.dylib            0x00007fff59404f5a _sigtramp + 26
3   ???                                 0x000000012221efc0 0x0 + 4867616704
4   blender                             0x00000001043ab833 BKE_libblock_remap_locked + 531
5   blender                             0x00000001043ac607 BKE_libblock_delete + 183
6   blender                             0x000000010455f2a9 BlendDataMeshes_remove_call + 41
7   blender                             0x00000001044fbaa2 RNA_function_call + 18
8   blender                             0x0000000103f97784 pyrna_func_call + 2004
9   blender                             0x0000000105dd8ae1 _PyObject_FastCallKeywords + 577
10  blender                             0x0000000105eaaf2d call_function + 589
11  blender                             0x0000000105ea3002 _PyEval_EvalFrameDefault + 4114
12  blender                             0x0000000105de77d2 gen_send_ex + 242
13  blender                             0x0000000105ea0264 builtin_next + 100
14  blender                             0x0000000105dd992e _PyMethodDef_RawFastCallKeywords + 686
15  blender                             0x0000000105dd8ccc _PyCFunction_FastCallKeywords + 44
16  blender                             0x0000000105eaaec8 call_function + 488
17  blender                             0x0000000105ea3090 _PyEval_EvalFrameDefault + 4256
18  blender                             0x0000000105dd91c0 function_code_fastcall + 256
19  blender                             0x0000000105dd9c56 _PyObject_Call_Prepend + 150
20  blender                             0x0000000105dd84d8 _PyObject_FastCallDict + 360
21  blender                             0x0000000105ea2d73 _PyEval_EvalFrameDefault + 3459
22  blender                             0x0000000105eabd3a _PyEval_EvalCodeWithName + 2906
23  blender                             0x0000000105dd8c86 _PyFunction_FastCallKeywords + 230
24  blender                             0x0000000105eaaf58 call_function + 632
25  blender                             0x0000000105ea3126 _PyEval_EvalFrameDefault + 4406
26  blender                             0x0000000105dd91c0 function_code_fastcall + 256
27  blender                             0x0000000105eaaf58 call_function + 632
28  blender                             0x0000000105ea3002 _PyEval_EvalFrameDefault + 4114
29  blender                             0x0000000105dd91c0 function_code_fastcall + 256
30  blender                             0x0000000103f9ea01 bpy_class_call + 961
31  blender                             0x00000001045e5838 engine_update + 136
32  blender                             0x0000000103f6d0bb RE_engine_render + 907
33  blender                             0x0000000103f77754 do_render_all_options + 372
34  blender                             0x0000000103f772a8 RE_BlenderFrame + 200
35  blender                             0x0000000103eca047 render_startjob + 119
36  blender                             0x0000000103bbfa8f do_job_thread + 31
37  libsystem_pthread.dylib             0x00007fff5940e661 _pthread_body + 340
38  libsystem_pthread.dylib             0x00007fff5940e50d _pthread_body + 0
39  libsystem_pthread.dylib             0x00007fff5940dbf9 thread_start + 13

My apologies, I forgot to add the crash log. Thanks for your time.

``` # Blender 2.80 (sub 30), Commit date: 2018-11-07 23:10, Hash a421cfa8d31 bpy.ops.object.editmode_toggle() # Operator # backtrace 0 blender 0x00000001046ed0c7 BLI_system_backtrace + 55 1 blender 0x0000000103ba9c0a sig_handle_crash + 362 2 libsystem_platform.dylib 0x00007fff59404f5a _sigtramp + 26 3 ??? 0x000000012221efc0 0x0 + 4867616704 4 blender 0x00000001043ab833 BKE_libblock_remap_locked + 531 5 blender 0x00000001043ac607 BKE_libblock_delete + 183 6 blender 0x000000010455f2a9 BlendDataMeshes_remove_call + 41 7 blender 0x00000001044fbaa2 RNA_function_call + 18 8 blender 0x0000000103f97784 pyrna_func_call + 2004 9 blender 0x0000000105dd8ae1 _PyObject_FastCallKeywords + 577 10 blender 0x0000000105eaaf2d call_function + 589 11 blender 0x0000000105ea3002 _PyEval_EvalFrameDefault + 4114 12 blender 0x0000000105de77d2 gen_send_ex + 242 13 blender 0x0000000105ea0264 builtin_next + 100 14 blender 0x0000000105dd992e _PyMethodDef_RawFastCallKeywords + 686 15 blender 0x0000000105dd8ccc _PyCFunction_FastCallKeywords + 44 16 blender 0x0000000105eaaec8 call_function + 488 17 blender 0x0000000105ea3090 _PyEval_EvalFrameDefault + 4256 18 blender 0x0000000105dd91c0 function_code_fastcall + 256 19 blender 0x0000000105dd9c56 _PyObject_Call_Prepend + 150 20 blender 0x0000000105dd84d8 _PyObject_FastCallDict + 360 21 blender 0x0000000105ea2d73 _PyEval_EvalFrameDefault + 3459 22 blender 0x0000000105eabd3a _PyEval_EvalCodeWithName + 2906 23 blender 0x0000000105dd8c86 _PyFunction_FastCallKeywords + 230 24 blender 0x0000000105eaaf58 call_function + 632 25 blender 0x0000000105ea3126 _PyEval_EvalFrameDefault + 4406 26 blender 0x0000000105dd91c0 function_code_fastcall + 256 27 blender 0x0000000105eaaf58 call_function + 632 28 blender 0x0000000105ea3002 _PyEval_EvalFrameDefault + 4114 29 blender 0x0000000105dd91c0 function_code_fastcall + 256 30 blender 0x0000000103f9ea01 bpy_class_call + 961 31 blender 0x00000001045e5838 engine_update + 136 32 blender 0x0000000103f6d0bb RE_engine_render + 907 33 blender 0x0000000103f77754 do_render_all_options + 372 34 blender 0x0000000103f772a8 RE_BlenderFrame + 200 35 blender 0x0000000103eca047 render_startjob + 119 36 blender 0x0000000103bbfa8f do_job_thread + 31 37 libsystem_pthread.dylib 0x00007fff5940e661 _pthread_body + 340 38 libsystem_pthread.dylib 0x00007fff5940e50d _pthread_body + 0 39 libsystem_pthread.dylib 0x00007fff5940dbf9 thread_start + 13 ``` My apologies, I forgot to add the crash log. Thanks for your time.

Added subscriber: @lvxejay

Added subscriber: @lvxejay

Added subscriber: @brecht

Added subscriber: @brecht

Please include a simple script that can be run to reproduce the problem. It's difficult to tell what is happening without more context. Race conditions normally happen with threading, which I guess is not the case here.

There is also some documentation on this topic:
https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#Instancing

Please include a simple script that can be run to reproduce the problem. It's difficult to tell what is happening without more context. Race conditions normally happen with threading, which I guess is not the case here. There is also some documentation on this topic: https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#Instancing

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2018-11-22 12:04:09 +01:00

More than a week without reply or activity. Due to the policy of the tracker archiving for until required info/data are provided.

More than a week without reply or activity. Due to the policy of the tracker archiving for until required info/data are provided.
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
4 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#57783
No description provided.