Commit Graph

19 Commits

Author SHA1 Message Date
Dave Anderson
7fcefcd4fe Fix for a crash-7.2.2 regression that may cause the "mount"
command to generate a segmentation violation.  The bug is
dependant upon the compiler version used to build the crash
utility, where a buffer overrun is not seen with more recent
versions of gcc, which hide the bug due to a different stack
layout of a function's local varibles.
(anderson@redhat.com)
2018-05-17 12:12:31 -04:00
Dave Anderson
48b1708609 For live system analysis, if both "/dev/mem" and the "/dev/crash"
memory driver do not exist, try to use "/proc/kcore".  Without
the patch, the session fails immediately with the error message
"crash: /dev/mem: No such file or directory".
(anderson@redhat.com)
2018-04-26 14:05:00 -04:00
Dave Anderson
11eceac4ef Fixes to address several gcc-8.0.1 compiler warnings that are generated
when building with "make warn".  The warnings are all false alarm
messages of type [-Wformat-overflow=], [-Wformat-truncation=] and
[-Wstringop-truncation]; the affected files are extensions.c, task.c,
kernel.c, memory.c, remote.c, symbols.c, filesys.c and xen_hyper.c.
(anderson@redhat.com)
2018-04-20 14:37:52 -04:00
Dave Anderson
a002f07040 Fix the search for the booted kernel on a live system to prevent
selecting the unusable "vmlinux.o" file found in private build
directories.  Without the patch, the non-executable vmlinux.o file
may be selected, and the resulting fatal error message indicates a
somewhat misleading "crash: cannot resolve _stext".
(bhsharma@redhat.com, anderson@redhat.com)
2018-02-28 16:13:51 -05:00
Dave Anderson
494a796e11 Fix to support Linux 4.15 and later kernels that contain kernel
commit e8cfbc245e24887e3c30235f71e9e9405e0cfc39, titled "pid: remove
pidhash".  The kernel's traditional usage of a pid_hash[] array to
store PIDs has been replaced by an IDR radix tree, requiring a new
crash plug-in function to gather the system's task set.  Without the
patch, the crash session fails during initialization with the error
message "crash: cannot resolve init_task_union".
(anderson@redhat.com)
2017-11-28 09:24:39 -05:00
Dave Anderson
21687ddf30 Fix to prevent an initialization-time failure when running a live
session on a host system that does not have a "/usr/src" directory.
Without the patch, the session fails with the message "*** Error in
'crash': free(): invalid pointer: <address> ***".
(Lei Chen)
2017-08-31 15:31:33 -04:00
Dave Anderson
5907614b2a Fixes to address three gcc-7.0.1 compiler warnings that are generated
when building with "make warn".  The warning types are "[-Wnonnull]"
in filesys.c, and "[-Wformat-overflow=]" in kernel.c and cmdline.c.
(anderson@redhat.com)
2017-03-03 15:10:02 -05:00
Dave Anderson
880574406d Fix for the "tree -t radix", "irq", and "files -p" command options
in Linux 4.6 and later kernels due to upstream changes in the radix
tree facility.  Without the patch, the commands will fail with the
message "radix trees do not exist or have changed their format".
(hirofumi@mail.parknet.co.jp)
2017-02-02 16:15:39 -05:00
Dave Anderson
89ed9d0a7f Introduction of support for "live" ramdump files, such as those that
are specified by the QEMU mem-path argument of a memory-backend-file
object.  This allows the running of a live crash session against a
QEMU guest from the host machine.  In this example, the /tmp/MEM file
on a QEMU host represents the guest's physical memory:

  $ qemu-kvm ...other-options... \
  -object memory-backend-file,id=MEM,size=128m,mem-path=/tmp/MEM,share=on \
  -numa node,memdev=MEM -m 128

and a live session run can be run against the guest kernel like so:

  $ crash <path-to-guest-vmlinux> live:/tmp/MEM@0

By prepending the ramdump image name with "live:", the crash session will
act as if it were running a normal live session.
(oleg@redhat.com)
2016-05-04 11:50:19 -04:00
Dave Anderson
dc20e27e0b Include sys/macros.h explicitly in filesys.c for the definitions
of major(), minor() and makedev().  These functions are defined
in the sys/sysmacros.h header, not sys/types.h.  Linux C libraries
are updating to drop the implicit include, so we need to include
it explicitly.
(vapier@gentoo.org)
2016-04-21 09:51:04 -04:00
Dave Anderson
3106fee2be Implementation of two new "files" command options. The "files -c"
option is context-sensitive, similar to the the regular "files"
command when used without an argument, but replaces the FILE and
DENTRY columns with I_MAPPING and NRPAGES columns that reflect
each open file's inode.i_mapping address_space structure address,
and the address_space.nrpages count within it; this shows how
many of each open file's pages are currently in the system's
page cache.  The "files -p <inode>" option takes the address
of an inode, and dumps all of its pages that are currently in the
system's page cache, borrowing the "kmem -p" page structure output.
(yangoliver@gmail.com)
2015-07-02 15:16:53 -04:00
Dave Anderson
1e858ed48e Fix for the "irq", "mount", "kmem -p" and "kmem -v" commands when
they are used in an input file.  If more than one of any of those
four commands are used in an input file, the output of the second
and subsequent command instances will not display their respective
command headers.
(anderson@redhat.com)
2015-05-08 15:58:58 -04:00
Dave Anderson
f7e4297640 Added support for VMware .vmss suspended state files as dumpfiles.
Similar to all other supported dumpfile types, it is invoked as:

  $ crash vmlinux <vmname>.vmss

A "<vmname>.vmss" file created by the VMware vSphere ESX hypervisor
contains a header and the full memory image.  A "<vmname>.vmss" file
created by the VMware Workstation facility only contains the header,
and must be accompanied by a companion "<vmname>.vmem" memory image
that is located in the same directory as the "<vmname>.vmss" file.
(hfu@vmware.com)
2015-02-05 14:40:44 -05:00
Dave Anderson
7e5c0cedef Fix for a misleading fatal error message if a 32-bit crash binary
built on an X86_64 host with "make target=X86" or "make target=ARM"
is used on a live X86_64 system without specifying a vmlinux
namelist.  Without the patch, the session fails with the message
"crash: cannot find booted kernel -- please enter namelist argument".
The error message will be "crash: compiled for the X86 architecture"
or "crash: compiled for the ARM architecture".
(anderson@redhat.com)
2014-11-21 15:19:20 -05:00
Dave Anderson
68c3828210 Add "/lib/modules/<version>/build" to the list of directories that
are searched for the currently-running kernel on live systems.  This
will automatically locate the vmlinux namelist for kernels that were
locally installed with "make modules_install install".
(lrintel@redhat.com)
2014-09-12 15:37:40 -04:00
Dave Anderson
de3daee5ee Fix to recognize that the live system "crash.ko" memory driver may
be compressed and named "crash.ko.xz".  Without the patch, the driver
is not recognized and loaded, and as a result the /dev/mem driver
and/or /proc/kcore will be tried as the live memory source.
(anderson@redhat.com)
2014-08-12 11:15:49 -04:00
Dave Anderson
77e9ca1305 Document the reason behind the deprecation of the "mount -f" option
for Linux 3.13 and later kernels if the option is attempted, and in
the "help mount" output, similar to the deprecated "mount -d" option.
(anderson@redhat.com)
2014-07-08 11:26:52 -04:00
Dave Anderson
5094787767 Deprecate the "mount -f" option for Linux 3.13 and later kernels
containing commit eee5cc2702929fd41cce28058dc6d6717f723f87, which
removed the super_block.s_files list_head member and the open files
list that it contained.  Without the patch, the command option fails
with the error message "mount: invalid structure member offset:
super_block_s_files"
(anderson@redhat.com)
2014-06-27 11:18:23 -04:00
Dave Anderson
03e3937ec7 Initial commit: crash-7.0.4 2014-01-28 16:46:11 -05:00