“original filename unknown” warning in using crash

On my SuSE with Xen, executing crash command outputs:

# crash
......  
crash: /boot/symtypes-3.12.49-6-xen.gz: original filename unknown
    Use "-f /boot/symtypes-3.12.49-6-xen.gz" on command line to prevent this message.

crash: /boot/symtypes-3.12.49-6-default.gz: original filename unknown
    Use "-f /boot/symtypes-3.12.49-6-default.gz" on command line to prevent this message.

crash: /boot/xen-4.5.1_10-1.gz: original filename unknown
    Use "-f /boot/xen-4.5.1_10-1.gz" on command line to prevent this message.
......

In this post, Dave refers the cause of original filename unknown is “the original filename of the compressed file was not stored in the file's header.“. To verify it, I check the source code ofcrash:

(1) This message is printed from is_compressed_kernel function:

is_compressed_kernel(char *file, char **tmp)
{
    ......
    #define FNAME (1 << 3)
    ......
    if ((header[0] == 0x1f) && (header[1] == 0x8b) && (header[2] == 8)) {
            if (!(header[3] & FNAME)) {
                    if (!(st->flags & FORCE_DEBUGINFO)) {
                    error(INFO, "%s: "
                        "original filename unknown\n",
                        file);
                    error(CONT, 
                            "Use \"-f %s\" on command line to prevent this message.\n\n",
                        file);
                }
            } else if
    ......
}

(2) From gzip spec:

     ID1 (IDentification 1)
     ID2 (IDentification 2)
        These have the fixed values ID1 = 31 (0x1f, \037), ID2 = 139
        (0x8b, \213), to identify the file as being in gzip format.

     CM (Compression Method)
        This identifies the compression method used in the file.  CM
        = 0-7 are reserved.  CM = 8 denotes the "deflate"
        compression method, which is the one customarily used by
        gzip and which is documented elsewhere.

     FLG (FLaGs)
        This flag byte is divided into individual bits as follows:

           bit 0   FTEXT
           bit 1   FHCRC
           bit 2   FEXTRA
           bit 3   FNAME
           bit 4   FCOMMENT
           bit 5   reserved
           bit 6   reserved
           bit 7   reserved
        ......
        If FNAME is set, an original file name is present,
        terminated by a zero byte.  The name must consist of ISO
        8859-1 (LATIN-1) characters; on operating systems using
        EBCDIC or any other character set for file names, the name
        must be translated to the ISO LATIN-1 character set.  This
        is the original name of the file being compressed, with any
        directory components removed, and, if the file being
        compressed is on a file system with case insensitive names,
        forced to lower case. There is no original file name if the
        data was compressed from a source other than a named file;
        for example, if the source was stdin on a Unix system, there
        is no file name.

As expected, after comparing the code with spec, the warning message is printed when the “original name isn’t present”.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.