[Crash-utility] [PATCH] crash-extension/gcore: fix the failure of invalid structure member offset
lijiang
lijiang at redhat.com
Wed Sep 16 13:49:45 UTC 2020
在 2020年09月16日 14:47, d.hatayama at fujitsu.com 写道:
> Lianbo,
>
> Sorry for the delayed response.
>
No worry.
> Thanks for your report and this patch.
>
> In addition to this patch, it's also necessary to modify ioperm_active() and ioperm_get() accordingly,
> without which, note information of NT_IOPERM fails to be collected.
>
> I'll do the additional fix based on your patch and include it in the next version.
>
OK, good to know. Thanks.
> Thanks.
> HATAYAMA, Daisuke
>
> ________________________________________
> From: crash-utility-bounces at redhat.com <crash-utility-bounces at redhat.com> on behalf of Lianbo Jiang <lijiang at redhat.com>
> Sent: Friday, August 28, 2020 13:04
> To: crash-utility at redhat.com
> Subject: [Crash-utility] [PATCH] crash-extension/gcore: fix the failure of invalid structure member offset
>
> With kernel commit: <577d5cd7e585> ("x86/ioperm: Move iobitmap data into
> a struct"), the io_bitmap_max and io_bitmap_ptr have been changed. And
> move the iobitmap data into a struct io_bitmap.
>
> So, the crash-gcore-command needs to be updated accordingly, otherwise,
> the gcore will fail as below:
>
> crash> bt -t|grep -i task
> PID: 3968 TASK: ffff9e512e97af80 CPU: 86 COMMAND: "bash"
> crash> gcore 3968
>
> gcore: invalid structure member offset: thread_struct_io_bitmap_max
> FILE: libgcore/gcore_x86.c LINE: 846 FUNCTION: ioperm_active()
>
> [./crash] error trace: 7f31fca56108 => 7f31fca593b7 => 53a4e1 => 53a463
>
> 53a463: OFFSET_verify.part.27+51
> 53a4e1: OFFSET_verify+49
>
> gcore: invalid structure member offset: thread_struct_io_bitmap_max
> FILE: libgcore/gcore_x86.c LINE: 846 FUNCTION: ioperm_active()
>
> Failed.
>
> Signed-off-by: Lianbo Jiang <lijiang at redhat.com>
> ---
> gcore.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/gcore.c b/gcore.c
> index 27a11938026a..e3e41ecb435b 100644
> --- a/gcore.c
> +++ b/gcore.c
> @@ -487,6 +487,10 @@ static void gcore_offset_table_init(void)
> GCORE_MEMBER_OFFSET_INIT(thread_struct_xstate, "thread_struct", "i387");
> GCORE_MEMBER_OFFSET_INIT(thread_struct_io_bitmap_max, "thread_struct", "io_bitmap_max");
> GCORE_MEMBER_OFFSET_INIT(thread_struct_io_bitmap_ptr, "thread_struct", "io_bitmap_ptr");
> + if (GCORE_INVALID_MEMBER(thread_struct_io_bitmap_max)) {
> + GCORE_MEMBER_OFFSET_INIT(thread_struct_io_bitmap_max, "io_bitmap", "max");
> + GCORE_MEMBER_OFFSET_INIT(thread_struct_io_bitmap_ptr, "io_bitmap", "bitmap");
> + }
> GCORE_MEMBER_OFFSET_INIT(user_regset_n, "user_regset", "n");
> GCORE_MEMBER_OFFSET_INIT(vm_area_struct_anon_vma, "vm_area_struct", "anon_vma");
> GCORE_MEMBER_OFFSET_INIT(vm_area_struct_vm_ops, "vm_area_struct", "vm_ops");
> --
> 2.17.1
>
> --
> 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