Browse Source

Get callback_func before explicit data dependencies too

read-after-free also seen in filters/frecursive.log otherwise
Samuel Thibault 4 years ago
parent
commit
05d405f9cf
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/core/jobs.c

+ 7 - 7
src/core/jobs.c

@@ -388,6 +388,13 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 	if (_starpu_graph_record)
 		_starpu_graph_drop_job(j);
 
+	/* Get callback pointer for codelet before notifying dependencies, in
+	   case dependencies free the codelet (see starpu_data_unregister for
+	   instance) */
+	void (*callback)(void *) = task->callback_func;
+	if (!callback && task->cl)
+		callback = task->cl->callback_func;
+
 	/* Task does not have a cl, but has explicit data dependencies, we need
 	 * to tell them that we will not exist any more before notifying the
 	 * tasks waiting for us
@@ -405,13 +412,6 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 			_starpu_spin_unlock(&handle->header_lock);
 	}
 
-	/* Get callback pointer for codelet before notifying dependencies, in
-	   case dependencies free the codelet (see starpu_data_unregister for
-	   instance) */
-	void (*callback)(void *) = task->callback_func;
-	if (!callback && task->cl)
-		callback = task->cl->callback_func;
-
 	_STARPU_TRACE_TASK_NAME(j);
 
 	/* If this is a continuation, we do not notify task/tag dependencies