Skip to content

Commit

Permalink
Fixed bug that arises when enabling tracing in programs with enclaves. (
Browse files Browse the repository at this point in the history
#55)

* 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.

* Corrected format

* fixed null ptr value

---------

Co-authored-by: Julian Robledo Mejia <[email protected]>
  • Loading branch information
julianrobledom and Julian Robledo Mejia authored Mar 21, 2024
1 parent 3b25ffe commit f0f62ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,11 @@ 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() != nullptr) {
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);
Expand Down

0 comments on commit f0f62ad

Please sign in to comment.