[PATCH/RFC] Fix relocation address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I'm having problems getting kdumps from my relocatable kernel (2.6.31-8)
working with crash on a IA-32 board. I use makedumpfile to generate a
compressed dump, and when I try to load it with crash I get

  ./crash vmlinux vmcore --reloc=0x100000
  crash: invalid kernel virtual address: 98  type: "present"
  WARNING: cannot read cpu_present_map
  crash: invalid kernel virtual address: 908bd975  type: "online"
  WARNING: cannot read cpu_online_map
  crash: cannot determine base kernel version
  crash: vmlinux and vmcore do not match!

specifying --reloc also fails:

  ./crash vmlinux vmcore --reloc=0x100000
  crash: seek error: kernel virtual address: c01a2108  type: "cpu_possible_mask"


So I started looking into the code and found something which looks like
a typo in relocate() (patch below). Changing this makes crash work for
me.

Great tool by the way, leaves you longing for the next kernel panic ;-)

// Simon

--- orig-crash-4.1.2/symbols.c	2009-12-09 21:37:40.000000000 +0100
+++ crash-4.1.2/symbols.c	2009-12-17 16:03:24.000000000 +0100
@@ -671,7 +671,7 @@ relocate(ulong symval, char *symname, in
 		break;
 	}
 
-	return (symval - kt->relocate);
+	return (symval + kt->relocate);
 }
 
 /*

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux