All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: Petr Tesarik <petr@tesarici.cz>
Cc: linux-debuggers@vger.kernel.org
Subject: Re: [PATCH kdumpid 0/3] Prevent segfault on missing disassembler
Date: Wed, 28 Jun 2023 15:12:39 -0700	[thread overview]
Message-ID: <87mt0jjkx4.fsf@oracle.com> (raw)
In-Reply-To: <20230628210344.357073-1-stephen.s.brennan@oracle.com>

Sorry, I forgot to add one thing!

Stephen Brennan <stephen.s.brennan@oracle.com> writes:
> Hi Petr,
>
> I didn't know quite where to send patches for kdumpid, so I elected to
> send direct to you, and CC the linux-debuggers list. Hope that's ok!
>
> I encountered a segmentation fault of kdumpid (master branch):
>
> #0  0x0000000000000000 in ?? ()
> #1  0x0000000000406aa9 in disas_at (dd=0x7fffffffde70, info=0x7fffffffdc80, pc=0) at ppc64.c:112
> #2  0x0000000000406d42 in looks_like_kcode_ppc64 (dd=0x7fffffffde70, addr=0) at ppc64.c:174
> #3  0x0000000000405616 in explore_kernel (dd=0x7fffffffde70, fn=0x405880 <explore_utsname>) at util.c:269
> #4  0x0000000000405d3f in explore_raw_data (dd=0x7fffffffde70) at util.c:465

As you can see by the fact that the code fell into the need_explore() /
explore_kernel() path... this vmcore was missing much of the important
metadata, since it was generated by qemu without a vmcoreinfo device.

I think I shared before, but I have a small piece of code [1] which can
locate the vmcoreinfo note reasonably quickly by iterating over pages
and simply testing the first bytes against "OSRELEASE=", since the
vmcoreinfo can only occur on a page boundary. If you'd like, I could
send a patch with some sort of "explore_vmcoreinfo()" function to do
this? I know it's not necessarily the most efficient, but I believe that
it would be valuable when all other heuristics fail.

Thanks,
Stephen

[1] https://github.com/brenns10/kernel_stuff/blob/master/vmcoreinfo/dumpphys.c

  parent reply	other threads:[~2023-06-28 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 21:03 [PATCH kdumpid 0/3] Prevent segfault on missing disassembler Stephen Brennan
2023-06-28 21:03 ` [PATCH kdumpid 1/3] cdefs.sh: require bash Stephen Brennan
2023-06-28 21:03 ` [PATCH kdumpid 2/3] Use -lz unconditionally Stephen Brennan
2023-06-28 21:03 ` [PATCH kdumpid 3/3] Gracefully handle missing dissasembler function Stephen Brennan
2023-06-28 22:12 ` Stephen Brennan [this message]
2023-06-29  6:26 ` [PATCH kdumpid 0/3] Prevent segfault on missing disassembler Petr Tesařík

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mt0jjkx4.fsf@oracle.com \
    --to=stephen.s.brennan@oracle.com \
    --cc=linux-debuggers@vger.kernel.org \
    --cc=petr@tesarici.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.