diff --git a/runtime/legion/legion_config.h b/runtime/legion/legion_config.h index 7ccd116cae..61bb752262 100644 --- a/runtime/legion/legion_config.h +++ b/runtime/legion/legion_config.h @@ -1156,6 +1156,7 @@ typedef enum legion_error_t { ERROR_EXCEEDED_MAXIMUM_NUMBER_LOCAL_FIELDS = 387, ERROR_UNABLE_ALLOCATE_LOCAL_FIELD = 388, ERROR_TASK_ATTEMPTED_ALLOCATE_FIELD = 389, + ERROR_DEFERRED_BUFFER_DOUBLE_DELETE = 390, //ERROR_PREDICATED_TASK_LAUNCH_FOR_TASK = 392, ERROR_PREDICATED_INDEX_TASK_LAUNCH = 393, ERROR_ATTEMPTED_INLINE_MAPPING_REGION = 395, diff --git a/runtime/legion/legion_context.cc b/runtime/legion/legion_context.cc index 8d6f76a25a..66a9252851 100644 --- a/runtime/legion/legion_context.cc +++ b/runtime/legion/legion_context.cc @@ -623,9 +623,11 @@ namespace Legion { { std::map::iterator finder = task_local_instances.find(instance); -#ifdef DEBUG_LEGION - assert(finder != task_local_instances.end()); -#endif + if (finder == task_local_instances.end()) + REPORT_LEGION_ERROR(ERROR_DEFERRED_BUFFER_DOUBLE_DELETE, + "Detected double deletion of deferred buffer " IDFMT + "in parent task %s (UID %lld).", + instance.id, get_task_name(), get_unique_id()) task_local_instances.erase(finder); MemoryManager *manager = runtime->find_memory_manager(instance.get_location()); diff --git a/runtime/legion/region_tree.inl b/runtime/legion/region_tree.inl index 40c1ece091..54d4a194ba 100644 --- a/runtime/legion/region_tree.inl +++ b/runtime/legion/region_tree.inl @@ -3885,6 +3885,7 @@ namespace Legion { { const DomainPoint color = partition->color_space->delinearize_color_to_point(*itr); + ApEvent child_ready; Realm::IndexSpace child_space; if (future_map_domain.contains(color)) { @@ -3910,11 +3911,12 @@ namespace Legion { context->runtime->profiler->add_partition_request(requests, op, DEP_PART_INTERSECTIONS); Realm::IndexSpace result; - ApEvent ready(Realm::IndexSpace::compute_intersection( - parent_space, child_space, result, requests, parent_ready)); + child_ready = ApEvent( + Realm::IndexSpace::compute_intersection( + parent_space, child_space, result, requests, parent_ready)); child_space = result; - if (ready.exists()) - result_events.insert(ready); + if (child_ready.exists()) + result_events.insert(child_ready); } } else @@ -3922,7 +3924,7 @@ namespace Legion { IndexSpaceNodeT *child = static_cast*>( partition->get_child(*itr)); - if (child->set_realm_index_space(child_space, ApEvent::NO_AP_EVENT)) + if (child->set_realm_index_space(child_space, child_ready)) delete child; } if (result_events.empty())