On Mon, 2011-12-05 at 09:46 -0500, Dave Anderson wrote:
 
 ----- Original Message -----
 > Hi Dave,
 > 
 > If a user by mistake issues the below command some junk characters are
 > printed on the console. (crash vmlinux.gz or any .gz file) Please advise.
 > 
 > linux:/boot # crash vmlinux-3.0.10-0.7-default.gz
 > 
 > crash: ��{�UU����3ܣ@bjb
 > R�I-& ��
 >        
 >
�c�"O9�Y��X^f<3��86���v1RS�q��\`������#��^����k�s@��}���=�׳d��g_�^{���Z{�����O-
 > F�-W|y�7���f9�k���g���: compressed file name does
 > not start with "vmlinux"
 >        Use "-f vmlinux-3.0.10-0.7-default.gz" on command line to
 >        override.
 > 
 > crash: vmlinux-3.0.10-0.7-default.gz: not a supported file format
 
 Hmmm, I'm not sure why that's happening, although the name string in the
 header does get clipped.  The closest example I have on hand is this one,
 where the pre-compressed filename was vmlinux-2.6.36-0.16.rc3.git0.fc15.x86_64,
 and the .gz filename is vmlinux-2.6.36-0.16.rc3.git0.fc15.x86_64.gz, and 
 which works fine.  And if I change its name to "vmlinux.gz", that still
 works as expected.  So I don't know how to reproduce what you are seeing.
 
 Anyway, the file command shows the (possibly clipped) string in the header
 that is being looked at:
 
 $ file vmlinux-2.6.36-0.16.rc3.git0.fc15.x86_64.gz
 vmlinux-2.6.36-0.16.rc3.git0.fc15.x86_64.gz: gzip compressed data, was
"vmlinux-2.6.36-0.16.rc3.git0.fc", from Unix, last modified: Tue Oct 12 14:43:02
2010
 $ 
 
 What does your .gz files show when you run "file" against them?
 And is yours an x86_64 file?
 
 Dave 
Yeah its an x86_64 file.
linux:/boot:file vmlinux-3.0.10-0.7-default.gz 
vmlinux-3.0.10-0.7-default.gz: gzip compressed data, from Unix, max
compression
and "by mistake" i meant if a user issues crash on a .gz file without
using -f option.
Aruna.
 
 
 
 
 > 
 > Aruna
 > 
 > On Mon, 2011-12-05 at 08:28 -0500, Dave Anderson wrote:
 > > The whole point of the "vmlinux" name check is to verify from
 > > the compressed header itself whether it was generated from a file
 > > that started with the name-string "vmlinux".  It's not
interested
 > > in whatever the .gz creator named the compressed file.  If you want
 > > to work around that restriction, use "crash -f ...".
 > > 
 > > Dave
 > > 
 > > 
 > > ----- Original Message -----
 > > > Signed-off-by: Aruna Balakrishnaiah <aruna(a)linux.vnet.ibm.com>
 > > > 
 > > > ---
 > > >  symbols.c |    4 ++--
 > > >  1 files changed, 2 insertions(+), 2 deletions(-)
 > > > 
 > > > diff --git a/symbols.c b/symbols.c
 > > > index 0cd3a01..acd8ad5 100755
 > > > --- a/symbols.c
 > > > +++ b/symbols.c
 > > > @@ -2995,10 +2995,10 @@ is_compressed_kernel(char *file, char
 > > > **tmp)
 > > >  	type = 0;
 > > >  
 > > >  	if ((header[0] == 0x1f) && (header[1] == 0x8b) &&
(header[2] ==
 > > >  	8))
 > > >  	{
 > > > -		if (!STRNEQ((char *)&header[10], "vmlinux") &&
 > > > +		if (!STRNEQ(basename(file), "vmlinux") &&
 > > >  		    !(st->flags & FORCE_DEBUGINFO)) {
 > > >  			error(INFO, "%s: compressed file name does not "
 > > > -			    "start with \"vmlinux\"\n", &header[10]);
 > > > +			    "start with \"vmlinux\"\n", file);
 > > >  			error(CONT,
 > > >  			    "Use \"-f %s\" on command line to
override.\n\n",
 > > >  				file);
 > > > 
 > > > 
 > > 
 > 
 > 
 >