Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for Linux 4.19-rc1 and later kernels that contain kernel commit
2c4704756cab7cfa031ada4dab361562f0e357c0, titled "pids: Move the pgrp
and session pid pointers from task_struct to signal_struct".  Without
the patch, the crash session fails during initialization with the
message "crash: invalid structure member offset: task_struct_pids".
(anderson@redhat.com)
  • Loading branch information
Dave Anderson committed Aug 29, 2018
1 parent e541c5c commit d7eec45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions defs.h
Expand Up @@ -2036,6 +2036,7 @@ struct offset_table { /* stash of commonly-used offsets */
long memcg_cache_params___root_caches_node;
long memcg_cache_params_children;
long memcg_cache_params_children_node;
long task_struct_pid_links;
};

struct size_table { /* stash of commonly-used sizes */
Expand Down
2 changes: 2 additions & 0 deletions symbols.c
Expand Up @@ -8606,6 +8606,8 @@ dump_offset_table(char *spec, ulong makestruct)
OFFSET(task_rss_stat_count));
fprintf(fp, " task_struct_pids: %ld\n",
OFFSET(task_struct_pids));
fprintf(fp, " task_struct_pid_links: %ld\n",
OFFSET(task_struct_pid_links));
fprintf(fp, " task_struct_last_run: %ld\n",
OFFSET(task_struct_last_run));
fprintf(fp, " task_struct_timestamp: %ld\n",
Expand Down
6 changes: 5 additions & 1 deletion task.c
Expand Up @@ -314,6 +314,7 @@ task_init(void)
strcpy(buf, "alias last ps -l");
alias_init(buf);
}
MEMBER_OFFSET_INIT(task_struct_pid_links, "task_struct", "pid_links");
MEMBER_OFFSET_INIT(pid_link_pid, "pid_link", "pid");
MEMBER_OFFSET_INIT(pid_hash_chain, "pid", "hash_chain");

Expand Down Expand Up @@ -2382,7 +2383,10 @@ refresh_radix_tree_task_table(void)
pid_tasks_0 = ULONG(pidbuf + OFFSET(pid_tasks));
if (!pid_tasks_0)
continue;
task = pid_tasks_0 - OFFSET(task_struct_pids);
if (VALID_MEMBER(task_struct_pids))
task = pid_tasks_0 - OFFSET(task_struct_pids);
else
task = pid_tasks_0 - OFFSET(task_struct_pid_links);

if (CRASHDEBUG(1))
console("pid: %lx ns: %lx tasks[0]: %lx task: %lx\n",
Expand Down

0 comments on commit d7eec45

Please sign in to comment.