On Fri, 04 Apr 2008 10:02:20 -0400
Dave Anderson <anderson(a)redhat.com> wrote:
> Jeff Layton wrote:
>> Looks like we might have gotten bitten by some upstream changes
>> again...
>>
>> When I run crash on a recent rawhide x86_64 kernel, I seem to be
>> getting this error:
>>
>> crash: invalid structure member offset: task_struct_parent
>> FILE: task.c LINE: 2163 FUNCTION: store_context()
>>
>> [/usr/bin/crash] error trace: 49150a => 495bb8 => 4963be => 4fc1bc
>> /usr/bin/nm: /usr/bin/crash: no symbols
>> /usr/bin/nm: /usr/bin/crash: no symbols
>> /usr/bin/nm: /usr/bin/crash: no symbols
>> /usr/bin/nm: /usr/bin/crash: no symbols
>>
>> Relevant package versions:
>>
>> crash-4.0-6.2.x86_64
>> kernel-2.6.25-0.185.rc7.git6.fc9.x86_64
>>
>> ...machine is a x86_64 FV xen guest. Any thoughts?
>>
>> Thanks,
>
> Yep, although the change is not upstream in Linus's tree, Roland's
> linux-2.6-utrace.patch removes it in Fedora:
>
> @@ -1070,18 +1063,26 @@ struct task_struct {
> /*
> * pointers to (original) parent process, youngest child,
> younger sibling,
> * older sibling, respectively. (p->father can be replaced with
> - * p->parent->pid)
> + * p->real_parent->pid)
> */
> - struct task_struct *real_parent; /* real parent process (when
> being debugged) */
> - struct task_struct *parent; /* parent process */
> + struct task_struct *real_parent; /* real parent process */
> /*
> - * children/sibling forms the list of my children plus the
> - * tasks I'm ptracing.
> + * children/sibling forms the list of my natural children
> */
>
> AFAICT, task_struct.real_parent can be substituted. Try the attached
> patch. (and then wait to see what else has been broken...)
>
> Dave
>
>
>
> ------------------------------------------------------------------------
>
> --- task.c.orig 2008-04-04 09:48:38.000000000 -0400
> +++ task.c 2008-04-04 09:50:13.000000000 -0400
> @@ -208,6 +208,9 @@
> MEMBER_OFFSET_INIT(task_struct_processor, "task_struct",
"processor");
> MEMBER_OFFSET_INIT(task_struct_p_pptr, "task_struct",
"p_pptr");
> MEMBER_OFFSET_INIT(task_struct_parent, "task_struct",
"parent");
> + if (INVALID_MEMBER(task_struct_parent))
> + MEMBER_OFFSET_INIT(task_struct_parent, "task_struct",
> + "real_parent");
> MEMBER_OFFSET_INIT(task_struct_has_cpu, "task_struct",
"has_cpu");
> MEMBER_OFFSET_INIT(task_struct_cpus_runnable,
> "task_struct", "cpus_runnable");
That worked! I didn't do any extensive testing, but that seems to allow
crash to start and do a "ps".
Many thanks!
--
Jeff Layton <jlayton(a)redhat.com>