From 20be4b1bfc0875047a421d18d7e201ccfa3ad382 Mon Sep 17 00:00:00 2001 From: Julian Robledo Mejia Date: Wed, 20 Mar 2024 11:12:44 +0100 Subject: [PATCH 1/3] Fixed bug that arises when enabling tracing in programs with enclaves. - Action tracing takes the action container as argument, but in a program with enclaves some of the actions might not have a container, which leads to segmentation fault. - The bug was fixed by giving the environment name as parameter instead of the container name, for the actions without a container. - Notice that the bug only arises if a tracing session was started with the ./tracing/start_tracing.sh script, before running the lf program. --- lib/scheduler.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/scheduler.cc b/lib/scheduler.cc index 75e18414..02b612bf 100644 --- a/lib/scheduler.cc +++ b/lib/scheduler.cc @@ -461,7 +461,12 @@ void Scheduler::schedule_sync(BaseAction* action, const Tag& tag) { log_.debug() << "Schedule action " << action->fqn() << (action->is_logical() ? " synchronously " : " asynchronously ") << " with tag " << tag; reactor_assert(logical_time_ < tag); - tracepoint(reactor_cpp, schedule_action, action->container()->fqn(), action->name(), tag); + if(action->container()){ + tracepoint(reactor_cpp, schedule_action, action->container()->fqn(), action->name(), tag); + } + else{ + tracepoint(reactor_cpp, schedule_action, action->environment()->name(), action->name(), tag); + } Statistics::increment_scheduled_actions(); const auto& action_list = event_queue_.insert_event_at(tag); From 65ba45ddd1f3bdf73448e8e872cd5ce587cab5e1 Mon Sep 17 00:00:00 2001 From: Julian Robledo Mejia Date: Thu, 21 Mar 2024 12:46:58 +0100 Subject: [PATCH 2/3] Corrected format --- lib/scheduler.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/scheduler.cc b/lib/scheduler.cc index 02b612bf..e4de650b 100644 --- a/lib/scheduler.cc +++ b/lib/scheduler.cc @@ -461,10 +461,9 @@ void Scheduler::schedule_sync(BaseAction* action, const Tag& tag) { log_.debug() << "Schedule action " << action->fqn() << (action->is_logical() ? " synchronously " : " asynchronously ") << " with tag " << tag; reactor_assert(logical_time_ < tag); - if(action->container()){ + if (action->container() != 0) { tracepoint(reactor_cpp, schedule_action, action->container()->fqn(), action->name(), tag); - } - else{ + } else { tracepoint(reactor_cpp, schedule_action, action->environment()->name(), action->name(), tag); } Statistics::increment_scheduled_actions(); From f891074256a3ff788d44dc99b2160d6c4a6cf289 Mon Sep 17 00:00:00 2001 From: Julian Robledo Mejia Date: Thu, 21 Mar 2024 14:31:37 +0100 Subject: [PATCH 3/3] fixed null ptr value --- lib/scheduler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scheduler.cc b/lib/scheduler.cc index e4de650b..2beac8a4 100644 --- a/lib/scheduler.cc +++ b/lib/scheduler.cc @@ -461,7 +461,7 @@ void Scheduler::schedule_sync(BaseAction* action, const Tag& tag) { log_.debug() << "Schedule action " << action->fqn() << (action->is_logical() ? " synchronously " : " asynchronously ") << " with tag " << tag; reactor_assert(logical_time_ < tag); - if (action->container() != 0) { + if (action->container() != nullptr) { tracepoint(reactor_cpp, schedule_action, action->container()->fqn(), action->name(), tag); } else { tracepoint(reactor_cpp, schedule_action, action->environment()->name(), action->name(), tag);