depsgraph.c bug / dag_add_material_nodetree_driver_relations #32017

Closed
opened 2012-07-04 21:23:44 +02:00 by Chris Want · 14 comments

Duplicates: #32069

%%%Hi Jeroen & Joshua,

I'm getting crashes when loading a lot of my files while using revision
48609 because there is some bad recursion in depsgraph.c. In particular,
the code seems to bounce endlessly between two function
calls:

0 0x0000000001c57963 in dag_add_material_driver_relations (dag=0x4eba428,

  node=0x4e688f8, ma=0x6db9808)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389

1 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations (

  dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:367

2 0x0000000001c57968 in dag_add_material_driver_relations (dag=0x4eba428,

  node=0x4e688f8, ma=0x6db9808)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389

3 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations (

  dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:367

.
.
.

558 0x0000000001c57968 in dag_add_material_driver_relations (dag=0x4eba428,

  node=0x4e688f8, ma=0x6db9808)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389

559 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations (

  dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:367

560 0x0000000001c57968 in dag_add_material_driver_relations (dag=0x4eba428,

  node=0x4e688f8, ma=0x6db9808)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389

561 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations (

  dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58)
  at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/d

.
.
.

(Same memory addresses keep getting passed each time.)

Cheers,
Chris
%%%

**Duplicates**: #32069 %%%Hi Jeroen & Joshua, I'm getting crashes when loading a lot of my files while using revision 48609 because there is some bad recursion in depsgraph.c. In particular, the code seems to bounce endlessly between two function calls: # 0 0x0000000001c57963 in dag_add_material_driver_relations (dag=0x4eba428, ``` node=0x4e688f8, ma=0x6db9808) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389 ``` # 1 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations ( ``` dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:367 ``` # 2 0x0000000001c57968 in dag_add_material_driver_relations (dag=0x4eba428, ``` node=0x4e688f8, ma=0x6db9808) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389 ``` # 3 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations ( ``` dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:367 ``` . . . # 558 0x0000000001c57968 in dag_add_material_driver_relations (dag=0x4eba428, ``` node=0x4e688f8, ma=0x6db9808) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389 ``` # 559 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations ( ``` dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:367 ``` # 560 0x0000000001c57968 in dag_add_material_driver_relations (dag=0x4eba428, ``` node=0x4e688f8, ma=0x6db9808) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/depsgraph.c:389 ``` # 561 0x0000000001c578a6 in dag_add_material_nodetree_driver_relations ( ``` dag=0x4eba428, node=0x4e688f8, ntree=0x6db9d58) at /home/cwant/blender/bf-blender/blender/source/blender/blenkernel/intern/d ``` . . . (Same memory addresses keep getting passed each time.) Cheers, Chris %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Heres a blend. Seems the problem is when a Material node is the same material as the material itself (in the case of the blend, Material.001 has a node with Material.001).%%%

%%%Heres a blend. Seems the problem is when a Material node is the same material as the material itself (in the case of the blend, Material.001 has a node with Material.001).%%%
Member

%%%Hi Joshua!

Doesn't seem to be a compositor issue, could you check into it.
Last monday I only added two null pointer checks as the id of a groupnode is not always fill with the correct tree.

Greets,
Jeroen%%%

%%%Hi Joshua! Doesn't seem to be a compositor issue, could you check into it. Last monday I only added two null pointer checks as the id of a groupnode is not always fill with the correct tree. Greets, Jeroen%%%
Author

%%%Hi Joshua, Jeroen,

Attached is a patch that solves the crashes. It does so by keeping track of the material at the root of the node tree, and doesn't recurse further if it encounters it again within the nodetree.

You may need to review to see that this functionally does what you want it to.

Chris
%%%

%%%Hi Joshua, Jeroen, Attached is a patch that solves the crashes. It does so by keeping track of the material at the root of the node tree, and doesn't recurse further if it encounters it again within the nodetree. You may need to review to see that this functionally does what you want it to. Chris %%%

%%%I have the same problem in OSX. posting only to keep track of the entry so when solved I can see if it fixes my problem as well.%%%

%%%I have the same problem in OSX. posting only to keep track of the entry so when solved I can see if it fixes my problem as well.%%%

%%%There is another place in object.c which does the same thing in certain situations: material_drivers_update
%%%

%%%There is another place in object.c which does the same thing in certain situations: material_drivers_update %%%
Author

%%%Hi Jason,

I've committed my patch for this. Jason, please check that it addresses the problem that you are experiencing.
Joshua, please review commit 48687.

Cheers,
Chris
%%%

%%%Hi Jason, I've committed my patch for this. Jason, please check that it addresses the problem that you are experiencing. Joshua, please review commit 48687. Cheers, Chris %%%

%%%the patch fixed the crash here, but also loading my "buggy" file in trunk seems to take a bit more time (~20%) than in swiss. I don't think it's the patch, but probably the original functionality. is it only me?%%%

%%%the patch fixed the crash here, but also loading my "buggy" file in trunk seems to take a bit more time (~20%) than in swiss. I don't think it's the patch, but probably the original functionality. is it only me?%%%
Author

%%%Hi Dalai,

I don't notice this issue here, but mind you my files only take about 2 seconds to load, so a 20% difference isn't very noticeable.

Chris

%%%

%%%Hi Dalai, I don't notice this issue here, but mind you my files only take about 2 seconds to load, so a 20% difference isn't very noticeable. Chris %%%
Author

%%%I should add that my test was comparing trunk with revision 48514 (before the crash).
I did not test the speed difference between trunk and swiss cheese.

Chris%%%

%%%I should add that my test was comparing trunk with revision 48514 (before the crash). I did not test the speed difference between trunk and swiss cheese. Chris%%%
Member

%%%Just piling on to confirm the bug - node material inside it's own nodetree crashing files.

  • this was likely created by accident a while ago.%%%
%%%Just piling on to confirm the bug - node material inside it's own nodetree crashing files. - this was likely created by accident a while ago.%%%

%%%There're still issues with this functionality -- infinite recursion still could happen here.

Originally reported to http://projects.blender.org/tracker/index.php?func=detail&aid=32069&group_id=9&atid=498 but think it's ok to redirect all the feedback from that report here.%%%

%%%There're still issues with this functionality -- infinite recursion still could happen here. Originally reported to http://projects.blender.org/tracker/index.php?func=detail&aid=32069&group_id=9&atid=498 but think it's ok to redirect all the feedback from that report here.%%%
Member

%%%Just got around to looking at this (4am local time :-/ )...

Hopefully my latest commit finally solves these issues. I've gone with the LIB_DOIT flagging I've been contemplating for a while.%%%

%%%Just got around to looking at this (4am local time :-/ )... Hopefully my latest commit finally solves these issues. I've gone with the LIB_DOIT flagging I've been contemplating for a while.%%%
Member

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
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
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#32017
No description provided.