On 2023/06/08 13:31, Lianbo Jiang wrote:
> Crash tool will fail to load vmcore with the following error:
>
> #crash vmlinux /var/crash/127.0.0.1-2023-06-07-22\:03\:24/vmcore -s
> crash: invalid structure size: note_buf
> FILE: diskdump.c LINE: 121 FUNCTION: have_crash_notes()
>
> [./crash] error trace: 101859ac => 10291798 => 10291450 => 10266038
>
> 10266038: SIZE_verify+156
> 10291450: have_crash_notes+308
> 10291798: map_cpus_to_prstatus_kdump_cmprs+448
> 101859ac: task_init+11980
>
> The reason is that the note_buf is not intialized before using the
> SIZE(note_buf) in the have_crash_notes(). Let's initialize the variable
> note_buf in the ppc64_init() to fix this issue.
Thanks for the patch.
Most of the architectures already have it, but some still do not have,
I don't have a 4 cpus s390x machine on hand, and am still trying to find it.
e.g. is s390x ok? It might be better to put it in task_init() because
It was initialized in the machdep_init(POST_GDB), see the following code:
...
read_in_kernel_config(IKCFG_INIT);
kernel_init();
machdep_init(POST_GDB); <---
vm_init();
machdep_init(POST_VM);
module_init();
help_init();
task_init();
vfs_init();
net_init();
dev_init();
machdep_init(POST_INIT);
...
I would suggest putting it at the end of the kernel_init(), so that the original initialization order will basically no be changed