[Crash-utility] [PATCH] Fix "sys [-t]|mod -S" after "mod -t" when crash runs with -s option
lijiang
lijiang at redhat.com
Mon Jan 25 02:49:41 UTC 2021
Hi, Kazu and John
在 2021年01月25日 07:18, HAGIO KAZUHITO(萩尾 一仁) 写道:
> Hi Lianbo,
>
> -----Original Message-----
>>> When crash runs with -s option, SIZE(taint_flag) and OFFSET(tnt_false)
>>> are not set during initialization. If the "mod -t" option is executed,
>>> it sets the former but does not set the latter. After that, the "sys"
>>> command uses OFFSET(tnt_false) without setting it, because it checks
>>> only if SIZE(taint_flag) is set.
>>>
>>> Without the patch, the "sys [-t]" and "mod -S" options after "mod -t"
>>> option fail with the error message:
>>>
>> Hmm, I also ran into a similar issue with an old vmcore, that can be reproduced
>> with the following steps:
>>
>> crash> history
>> [1] mod -S 3.10.0-957.el7.x86_64
>> [2] mod -s dm_service_time
>> [3] set scope st_create
>> [4] mod -d dm_service_time
>> [5] mod -sr dm_service_time
>> [6] set scope st_create
>> [7] sys
>> [8] set scope st_create
>>
>> And after the step[7] "sys" command, the step[8] will definitely fail. But step[6]
>> is successful before the "sys" command.
>>
>> Seems that it should be another issue.
>
> Do you mean the following error?
> ...
> crash> set scope st_create
> scope: ffffffffc0918270 (st_create)
> crash> sys
> KERNEL: /usr/lib/debug/lib/modules/3.10.0-1127.el7.x86_64/vmlinux
> DUMPFILE: /dev/crash
> ...
> crash> set scope st_create
> set: gdb cannot find text block for address: st_create
>
Usually, it can work with the --readnow(as a workaround) for the bz1811208 John mentioned.
But in my steps[1-8], it won't work. This is another bug(bz1839850)
> This looks strange but different from the issue this patch fixes.
Indeed, they are different issues. So for the following patch:
[PATCH] Fix "sys [-t]|mod -S" after "mod -t" when crash runs with -s option
Acked-by: Lianbo Jiang <lijiang at redhat.com>
> This fixes the following error:
>
> # crash -s
>
> WARNING: kernel relocated [340MB]: patching 87167 gdb minimal_symbol values
> crash> mod -t
> no tainted modules
> crash> sys
>
> sys: invalid structure member offset: tnt_false
> FILE: kernel.c LINE: 10838 FUNCTION: show_kernel_taints_v4_10()
>
> [/usr/bin/crash] error trace: 469008 => 4f4b29 => 4d7e19 => 5376d2
>
> 5376d2: OFFSET_verify+130
> 4d7e19: (undetermined)
> 4f4b29: cmd_sys+121
> 469008: exec_command+760
>
> sys: invalid structure member offset: tnt_false
> FILE: kernel.c LINE: 10838 FUNCTION: show_kernel_taints_v4_10()
>
> My test script runs with this command order..
>
> Thanks,
> Kazu
>
>>
>> Thanks.
>> Lianbo
>>
>>> sys: invalid structure member offset: tnt_false
>>> FILE: kernel.c LINE: 11203 FUNCTION: show_kernel_taints_v4_10()
>>>
>>> Signed-off-by: Kazuhito Hagio <k-hagio-ab at nec.com>
>>> ---
>>> kernel.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/kernel.c b/kernel.c
>>> index 272e0d8751cf..5fcd86575be5 100644
>>> --- a/kernel.c
>>> +++ b/kernel.c
>>> @@ -11160,7 +11160,8 @@ show_kernel_taints_v4_10(char *buf, int verbose)
>>> ulong tainted_mask, *tainted_mask_ptr;
>>> struct syment *sp;
>>>
>>> - if (!VALID_STRUCT(taint_flag)) {
>>> + if (!(VALID_STRUCT(taint_flag) &&
>>> + VALID_MEMBER(tnt_true) && VALID_MEMBER(tnt_false))) {
>>> STRUCT_SIZE_INIT(taint_flag, "taint_flag");
>>> MEMBER_OFFSET_INIT(tnt_true, "taint_flag", "true");
>>> MEMBER_OFFSET_INIT(tnt_false, "taint_flag", "false");
>>> -- 2.18.4
>
More information about the Crash-utility
mailing list