[Bf-blender-cvs] [1743c81] master: Fix T41349: Muting texture nodes can cause crashes.

Lukas Tönne noreply at git.blender.org
Tue Aug 12 12:43:48 CEST 2014


Commit: 1743c81ce1b01e89728f98ea66ba1c07192bcff9
Author: Lukas Tönne
Date:   Tue Aug 12 12:41:26 2014 +0200
Branches: master
https://developer.blender.org/rB1743c81ce1b01e89728f98ea66ba1c07192bcff9

Fix T41349: Muting texture nodes can cause crashes.

Problem is that setup of stack indices which refer to the same stack
entry can lead to cyclic TexDelegate node pointers, causing an infinite
loop.

Fixing this would take too much time and require recoding large parts of
the texnodes system, which is earmarked for scrapping anyway ... So for
now just disabled muting in texnodes to avoid crashes.

===================================================================

M	source/blender/nodes/intern/node_exec.c
M	source/blender/nodes/texture/node_texture_tree.c

===================================================================

diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index ec48183..0893d20 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -159,6 +159,8 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
 	int index;
 	bNode **nodelist;
 	int totnodes, n;
+	/* XXX texnodes have threading issues with muting, have to disable it there ... */
+	bool use_muting = (ntree->type != NTREE_TEXTURE);
 	
 	/* ensure all sock->link pointers and node levels are correct */
 	ntreeUpdateTree(G.main, ntree);
@@ -182,7 +184,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
 		for (sock = node->inputs.first; sock; sock = sock->next)
 			node_init_input_index(sock, &index);
 		
-		if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
+		if (use_muting && (node->flag & NODE_MUTED || node->type == NODE_REROUTE)) {
 			for (sock = node->outputs.first; sock; sock = sock->next)
 				node_init_output_index(sock, &index, &node->internal_links);
 		}
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c
index c0c5787..02f1570 100644
--- a/source/blender/nodes/texture/node_texture_tree.c
+++ b/source/blender/nodes/texture/node_texture_tree.c
@@ -137,6 +137,10 @@ static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, bNodeClassCa
 	func(calldata, NODE_CLASS_LAYOUT, N_("Layout"));
 }
 
+/* XXX muting disabled in previews because of threading issues with the main execution
+ * it works here, but disabled for consistency
+ */
+#if 0
 static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
 {
 	bNode *node, *node_next;
@@ -151,6 +155,11 @@ static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
 		}
 	}
 }
+#else
+static void localize(bNodeTree *UNUSED(localtree), bNodeTree *UNUSED(ntree))
+{
+}
+#endif
 
 static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
 {




More information about the Bf-blender-cvs mailing list