[ppc64] cp /prroc/vmcore fails with core generated using latest kexec tools.

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


Sachin P. Sant wrote:
> Apart from this cleanup work i am also chasing a bug that exists with the
> current snapshot of git tree. [ Not related to any of these cleanup patches.
> This is only for ppc64.] While using the kexec tools i am able to generate 
> a vmcore file, but while copying the core file i get error 
> " Invalid argument" and copy fails. I have tried with older kexec tools 
> and it works fine.  will do some debugging and will update you on this.
>   
After some debugging i was able to track this problem down to crashdump-elf.c
file. While setting up the PT_LOAD type program headers, the filesz is 
calculated using start and end values of memory range.

phdr->p_filesz  = phdr->p_memsz = mend - mstart + 1;

On ppc64 this "+ 1" is causing all this trouble. The start and end are used 
to represent the size of memory range on ppc64. ie While storing a range 
of let's say 0x00 - 0xff the start will be Zero and the end will have value 
0x100. That way while calculating size one just need to subtract start from
end. 

Because of the above code the filesz is wrongly computed on ppc64, thus 
causing this problem. After talking to vivek i found that on other arch's
start and end values are stored to show the actual range and not the size.

So it seems that we have two conventions now. On ppc64 the start and end values 
will represent the size of memory, while on i386 / x86_64 they will represent
the range [ + 1 will give the size of that memory range ].

As for this problem, if i remove the extra + 1 while computing the filesz, 
all is well and is able to save and analyze the vmcore file.

Will work on a patch for this problem, but thought will get views from 
the list on this before generating a patch. Commnets  :-) 

Thanks
-Sachin

> Thanks
> -Sachin
>   



[Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Linux Media]     [Linux Resources]

Powered by Linux