[Crash-utility] 2.6.22 breaks crash

Dave Anderson anderson at redhat.com
Thu May 24 18:10:40 UTC 2007


Troy Heber wrote:
> There was recent commit[1] to rename the "thread_info" member of the
> task_struct to "stack":
> 
> -       struct thread_info *thread_info;
> +       void *stack;
> 
> To resolve it we simply need to change the hardcoded value for the offset
> lookup in task.c:
> 
> --- task.c.ori  2007-05-24 09:54:43.000000000 -0600
> +++ task.c      2007-05-24 10:41:50.000000000 -0600
> @@ -161,7 +161,7 @@ task_init(void)
>         }
> 
>          MEMBER_OFFSET_INIT(task_struct_thread_info, "task_struct",
> -               "thread_info");
> +               "stack");
>         if (VALID_MEMBER(task_struct_thread_info)) {
>                 MEMBER_OFFSET_INIT(thread_info_task, "thread_info", "task");
>                 MEMBER_OFFSET_INIT(thread_info_cpu, "thread_info", "cpu");
> 
> However, I'm not sure what the best way to keep backwards compatibility for
> kernels < 2.6.22.
> 
> Troy
> 

This should suffice:

<         MEMBER_OFFSET_INIT(task_struct_thread_info, "task_struct",
<               "thread_info");
---
 >       if (MEMBER_EXISTS("task_struct", "thread_info"))
 >               MEMBER_OFFSET_INIT(task_struct_thread_info, "task_struct",
 >                       "thread_info");
 >       else if (MEMBER_EXISTS("task_struct", "stack"))
 >               MEMBER_OFFSET_INIT(task_struct_thread_info, "task_struct",
 >                       "thread_info");
 >       else
 >               ASSIGN_OFFSET(task_struct_thread_info) = INVALID_OFFSET;
 >

Thanks for nipping this one in the bud,
   Dave


> 
> [1] f7e4217b007d1f73e7e3cf10ba4fea4a608c603f
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility





More information about the Crash-utility mailing list