[Crash-utility] [PATCH/RFC] Fix relocation address

Dave Anderson anderson at redhat.com
Thu Dec 17 15:50:28 UTC 2009


----- "Simon Kagstrom" <simon.kagstrom at netinsight.net> wrote:

> 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.

Actually it's not a typo -- your patch would presumably break with all kernels
that have a CONFIG_PHYSICAL_START is greater than CONFIG_PHYSICAL_ALIGN, which
is what the patch was written to handle.

What are your kernel's CONFIG_PHYSICAL_START and CONFIG_PHYSICAL_ALIGN
values?  Does crash work with your kernel on the live system?  

Anyway, I believe that the fix would require support for supplying a 
negative --reloc value.

> 
> 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);
>  }
>  
>  /*




More information about the Crash-utility mailing list