[Crash-utility] [PATCH] Fix a typo for getting the offset "page.index" (Re: crash version 4.0-4.9 is availlable)

Dave Anderson anderson at redhat.com
Wed Nov 21 14:45:46 UTC 2007


Ken'ichi Ohmichi wrote:
> Hi Dave,
> 
> Dave Anderson wrote:
> 
>>- Fix for the "kmem -p" command in kernels configured with
>>  CONFIG_SPARSEMEM, i.e., not CONFIG_SPARSEMEM_EXTREME.  Without
>>  the patch, the page structure address for each physical page
>>  was erroneous.  (oomichi at mxs.nes.nec.co.jp)
> 
> 
>>- Fix for "kmem -p" on i386 CONFIG_SPARSEMEM kernels with greater than
>>  4GB of memory.  Without the patch, the physical address value wraps
>>  back to zero after physical page ffff0000.
>>  (oomichi at mxs.nes.nec.co.jp)
> 
> 
> Thank you for merging my patches.
> 
> I tested the latest crash utility (crash-4.0-4.9), and I found a problem
> that "kmem -p" fails like the following:
> 
>   crash> kmem -p
> 
>   kmem: invalid structure member offset: page_index
>         FILE: memory.c  LINE: 4116  FUNCTION: dump_mem_map_SPARSEMEM()
> 
>   [/usr/bin/crash] error trace: 80a0a75 => 80a3020 => 80a1e25 => 8136ce7
>     PAGE    PHYSICAL   MAPPING    INDEX CNT FLAGS
>   /usr/bin/nm: /usr/bin/crash: no symbols
>   /usr/bin/nm: /usr/bin/crash: no symbols
>   /usr/bin/nm: /usr/bin/crash: no symbols
>   /usr/bin/nm: /usr/bin/crash: no symbols
> 
>   WARNING: Because this kernel was compiled with gcc version 4.1.2, certain
>            commands or command options may fail unless crash is invoked with
>            the  "--readnow" command line option.
> 
>   kmem: invalid structure member offset: page_index
>         FILE: memory.c  LINE: 4116  FUNCTION: dump_mem_map_SPARSEMEM()
> 
>   crash>
> 
> To solve it, this patch fixes a typo for getting the offset "page.index".
> 

Damn.  I introduced this bug when adding the page.index anonymous
member calculation to avoid the "dashing-out" of the mapping
and index values.  This regression warrants an immediate
fix -- I'll post an updated 4.0-4.10 today.

Ken'ichi, thanks for catching this,
   Dave



> 
> Thanks
> Ken'ichi Ohmichi
> 
> Signed-off-by: Ken'ichi Ohmichi <oomichi at mxs.nes.nec.co.jp>
> ---
> diff -rpuN crash-4.0-4.9.org/memory.c crash-4.0-4.9/memory.c
> --- crash-4.0-4.9.org/memory.c	2007-11-21 10:48:38.000000000 +0900
> +++ crash-4.0-4.9/memory.c	2007-11-21 11:17:15.000000000 +0900
> @@ -286,7 +286,7 @@ vm_init(void)
>  			STRUCT_SIZE("atomic_t") + sizeof(ulong);
>          MEMBER_OFFSET_INIT(page_index, "page", "index");
>  	if (INVALID_MEMBER(page_index))
> -		ANON_MEMBER_OFFSET_INIT(page_mapping, "page", "index");
> +		ANON_MEMBER_OFFSET_INIT(page_index, "page", "index");
>          MEMBER_OFFSET_INIT(page_buffers, "page", "buffers");
>  	MEMBER_OFFSET_INIT(page_lru, "page", "lru");
>  	MEMBER_OFFSET_INIT(page_pte, "page", "pte");
> _
> 
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility





More information about the Crash-utility mailing list