On 11/6/2026 3:58 PM, Rui Yang wrote:
[Some people who received this message don't often get email from
yangrr.2009(a)tsinghua.org.cn. Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]
Add Kazu's gmail in cc
On 11/6/26 3:53 PM, Rui Yang wrote:
> Hi,
>
> On 11/5/26 9:10 PM, Pu Hu wrote:
>> From: Pu Hu <hupu(a)transsion.com>
>>
>> note_buf_t is a typedef of a u32 array. Clang often omits it from
>> vmlinux DWARF even when the crash_notes symbol is present.
>> SIZE(note_buf) then aborts session startup:
>>
>> crash: invalid structure size: note_buf
>> FILE: arm64.c FUNCTION: arm64_get_crash_notes()
>>
>> Look up note_buf_t first and note_buf second. When neither type is
>> available, measure one NT_PRSTATUS note from the per-cpu crash note
>> in memory and include the terminating empty Elf note header. The
>> length stays local to arm64_get_crash_notes() and is not written into
>> size_table. If it still cannot be determined, warn and continue so a
>> raw RAM dump can be opened.
>>
>> A vmlinux that already contains note_buf_t keeps the previous size.
>> No constant note length is introduced.
>
> I wonder if this is a general issue or arm64 specific, in this old thread something
is done in task_init()
> Can it be done as a general thing instead of arm64 only?
>
https://lists.crash-utility.osci.io/archives/list/devel@lists.crash-utili...
>
> Kazu, you reviewed the old patch from Lianbo for ppc64, any idea about above?
>
Hi Rui,
Thank you for your reply.
I agree this is a common problem, not specific to arm64. Clang often
omits the note_buf_t typedef from DWARF. When that happens,
SIZE(note_buf) aborts startup in have_crash_notes(), which task_init()
calls on the kdump and diskdump paths for all architectures. The v1
patch only handled the arm64 get_crash_notes() path, so it did not fix
the point where startup actually fails.
Following the direction Kazu suggested in the 2023 ppc64 thread, v2
moves the handling into common code. crash_note_size() looks up
note_buf_t, then note_buf. If neither exists, it measures one
NT_PRSTATUS note plus the terminating empty note header. The measured
size stays in a local variable and is not written into size_table. The
per-architecture get_crash_notes() functions and sadump use the same
helper. I will send v2 shortly.
I agree the change touches more files than I would like. Most of the
per-architecture hunks make the same replacement of SIZE(note_buf) with
the local note size. So far I have only built it for ARM64. I do not
have full dumps from other platforms to test with, so I cannot verify
the x86, ppc, mips, riscv, or loongarch64 paths myself. Testing on those
architectures would be very helpful.
Thanks,
Pu Hu