linux-debuggers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH kdumpid 0/3] Prevent segfault on missing disassembler
@ 2023-06-28 21:03 Stephen Brennan
  2023-06-28 21:03 ` [PATCH kdumpid 1/3] cdefs.sh: require bash Stephen Brennan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stephen Brennan @ 2023-06-28 21:03 UTC (permalink / raw)
  To: Petr Tesarik; +Cc: linux-debuggers

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
#5  0x0000000000404c98 in main (argc=2, argv=0x7fffffffe168) at main.c:248

The print_insn function pointer was NULL and calling it resulted in the
segfault. So I've included a patch to check the return value of
disassembler() and avoid calling print_insn in those cases.

I also added some fixes to build issues I encountered - hopefully to
help you avoid autotools for even longer :P

Thanks,
Stephen

Stephen Brennan (3):
  cdefs.sh: require bash
  Use -lz unconditionally
  Gracefully handle missing dissasembler function

 Makefile | 2 +-
 cdefs.sh | 2 +-
 libs.sh  | 3 ---
 ppc.c    | 2 ++
 ppc64.c  | 2 ++
 s390.c   | 2 ++
 x86.c    | 2 ++
 7 files changed, 10 insertions(+), 5 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-29  6:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH kdumpid 0/3] Prevent segfault on missing disassembler Stephen Brennan
2023-06-29  6:26 ` Petr Tesařík

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).