Skip to content

Commit

Permalink
tui: Fix segfault when filter is used
Browse files Browse the repository at this point in the history
Honggyu reported that tui crashed when filter is used.  It was from
add_remaining_node() called at the end of processing.  If a task has no
function due to filter, fork() exit entry will remain and it makes to
caller the function with no graph setup for the task.

Fixed: #611

Signed-off-by: Namhyung Kim <[email protected]>
  • Loading branch information
namhyung committed Nov 28, 2018
1 parent 8cddd5c commit aa51e1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmds/tui.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ static void update_report_node(struct uftrace_task_reader *task, char *symname,
struct tui_report_node *node;
struct tui_graph_node *graph_node;

/* graph is not set probably due to filters (or error?) */
if (tg->node == NULL)
return;

node = (struct tui_report_node *)report_find_node(&tui_report.name_tree,
symname);
if (node == NULL) {
Expand Down

0 comments on commit aa51e1f

Please sign in to comment.