Commit Graph

325 Commits

Author SHA1 Message Date
Dave Anderson
7136bf8495 Fix for Linux commit edf14cdbf9a0e5ab52698ca66d07a76ade0d5c46, which
has appended a NULL entry as the final member of the pageflag_names[]
array.  Without the patch, a message that indicates "crash: failed to
read pageflag_names entry" is displayed during session initialization
in Linux 4.6 kernels.
(andrej.skvortzov@gmail.com)
2016-05-19 14:01:19 -04:00
Dave Anderson
8cb8e85de6 Recognize and parse the new QEMU_VM_CONFIGURATION and QEMU_VM_FOOTER
sections used for live migration of KVM guests, which are seen in
the "kvmdump" format generated if "virsh dump" is used without the
"--memory-only" option.
(pagupta@redhat.com)
2016-05-16 11:13:54 -04:00
Dave Anderson
5649088bcc Fix for a "[-Werror=misleading-indentation]" compiler warning that
is generated by gdb-7.6/bfd/elf64-s390.c when building S390X in a
Fedora Rawhide environment with gcc-6.0.0.
(anderson@redhat.com)
2016-05-05 09:01:35 -04:00
Dave Anderson
67a815b874 Added support for x86_64 ramdump files. Without the patch, the crash
session fails immediately with the message "ramdump: unsupported
machine type: X86_64".
(anderson@redhat.com)
2016-05-04 14:34:53 -04:00
Dave Anderson
7eb61b3e7b Fix for the support of ELF vmcores created by the KVM "virsh dump
--memory-only" facility if the guest kernel was not configured with
CONFIG_KEXEC, or CONFIG_KEXEC_CORE in Linux 4.3 and later kernels.
Without the patch, the crash session fails during initialization with
the message "crash: cannot resolve kexec_crash_image".
(hirofumi@mail.parknet.co.jp)
2016-05-04 14:24:46 -04: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
a6c585b1ea Mark start of 7.1.6 development with version 7.1.5++ 2016-05-04 11:46:52 -04:00
Dave Anderson
c89b9de0eb crash-7.1.4 -> crash-7.1.5 2016-04-27 15:34:21 -04:00
Dave Anderson
956e309ff1 Account for the Linux 3.17 increase of the ARM64 MAX_PHYSMEM_BITS
definition from 40 to 48.
(Johan.Erlandsson.sonymobile.com)
2016-04-27 10:03:19 -04:00
Dave Anderson
fd2f8ef41e Introduction of support for the 64-bit SPARC V9 architecture. This
version supports running against a live kernel.  Compressed kdump
support is also here, but the crash dump support for the kernel,
kexec-tools, and makedumpfile is still pending.  Initial work was
done by Karl Volz with help from Bob Picco.
(dave.kleikamp@oracle.com)
2016-04-26 14:45:59 -04:00
Dave Anderson
569002249b When reading a task's task_struct.flags field, check for its size,
which was changed from an unsigned long to an unsigned int.
(dave.kleikamp@oracle.com)
2016-04-25 16:06:52 -04:00
Dave Anderson
aad859ec10 Fix for the x86_64 "vm -p" command to properly emulate the kernel's
pte_present() function, which checks for either _PAGE_PRESENT or
_PAGE_PROTNONE to be set.  Without the patch, user pages whose PTE
does not have _PAGE_PRESENT bit set are misconstrued as SWAP pages
with an "(unknown swap location") along with a bogus OFFSET value.
(anderson@redhat.com)
2016-04-25 15:02:25 -04:00
Dave Anderson
1230512818 Fix for the "vm -p" and "vtop <user virtual address>" commands if
a user page is swapped out.  Without the patch, the "/dev" component
of the swap file pathname may be missing from its display.
(anderson@redhat.com)
2016-04-22 17:04:33 -04:00
Dave Anderson
ab91852f94 Introduction of ARM64 support for 64K pages with 3-level page tables
and 48 VA bits.  Until now, support has only existed for 64K pages
with 2-level page tables, and 4K pages with 3-level page tables.
(jim.hull@hpe.com)
2016-04-22 14:51:37 -04:00
Dave Anderson
3064aad387 Fix for the "vm -p" option on kernels that are not configured with
CONFIG_SWAP.  Without the patch, the command may fail prematurely
with the message "nr_swapfiles doesn't exist in this kernel".
(rabinv@axis.com)
2016-04-22 09:42:56 -04:00
Dave Anderson
7f324a4144 Fix for "kmem -[sS]" options for kernels configured with CONFIG_SLUB.
Without the patch, if a freelist pointer is corrupt, the address of
the slab page being referenced may not be displayed by the error
message, showing something like: "kmem: kmalloc-32: slab: 0 invalid
freepointer: 6e652f323a302d74".
(hirofumi@mail.parknet.co.jp)
2016-04-21 11:26:19 -04:00
Dave Anderson
f6918567d7 Fix for "kmem -[sS]" options for kernels configured with CONFIG_SLUB.
Without the patch, the count displayed in the ALLOCATED column may
be too large, and the "kmem -S" display of allocated/free status of
individual objects may be incorrect.
(hirofumi@mail.parknet.co.jp)
2016-04-21 11:09:27 -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
61dfedefcf Apply a fuzz factor of zero to the re-application of a modified
version of the gdb-7.6.patch in a pre-existing build directory.
Without the patch, it is possible that a previously-applied patch
could be applied a second time without the fuzz restriction.
(anderson@redhat.com)
2016-04-21 09:44:54 -04:00
Dave Anderson
7b5be97daa Introduction of the "whatis -r" and "whatis -m" options. The -r
option searches for data structures of a specified size or within a
range of specified sizes.  The -m option searches for data structures
that contain a member of a given type.  If a structure contains
another structure, the members of the embedded structure will also
be subject to the search.  The type string may be a substring of the
data type name.  The output displays the size and name of the data
structure.
(Alexandr_Terekhov@epam.com, anderson@redhat.com)
2016-04-15 16:13:28 -04:00
Dave Anderson
1269b13567 Fixes to address two gcc-4.1.2 compiler warnings introduced by the
previous patch:
  memory.c: In function ‘count_cpu_partial’:
  memory.c:17958: warning: comparison is always false due to limited
                  range of data type
  memory.c: In function ‘count_partial’:
  memory.c:18729: warning: comparison is always false due to limited
                  range of data type
(anderson@redhat.com)
2016-04-13 12:06:13 -04:00
Dave Anderson
76a71fed90 Improvement of the accuracy of the allocated objects count for each
kmem_cache shown by "kmem -s" in kernels configured with CONFIG_SLUB.
Without the patch, the values under the ALLOCATED column may be too
large because cached per-cpu objects are counted as allocated.
(vinayakm.list@gmail.com)
2016-04-12 16:51:50 -04:00
Dave Anderson
c1eb2b99e2 Fix for the "irq -s" option for Linux 4.2 and later kernels. Without
the patch, the irq_chip.name string (e.g. "IO-APIC", "PCI-MSI", etc.)
is missing from the display.
(rabin.vincent@axis.com)
2016-04-08 12:00:55 -04:00
Dave Anderson
0c47739aee Fix for the "dis <function | address>" option if the function or
address is the highest text symbol value in a kernel module.  Without
the patch, the disassembly may continue past the end of the function,
or may show nothing at all.  The patch utilizes in-kernel kallsyms
symbol size information instead of disassembling until reaching the
address of the next symbol in the module.
(anderson@redhat.com)
2016-03-31 16:58:55 -04:00
Dave Anderson
04ab5c560a Put 2016 copyright in initial banner. 2016-03-01 16:16:48 -05:00
Dave Anderson
098cdab16d Fix for the changes made to the kernel module structure introduced by
this kernel commit for Linux 4.5 and later kernels:

  commit 8244062ef1e54502ef55f54cced659913f244c3e
  modules: fix longstanding /proc/kallsyms vs module insertion race.

Without the patch, the crash session fails during initialization
with the error message: "crash: invalid structure member offset:
module_num_symtab".
(anderson@redhat.com)
2016-02-12 14:32:53 -05:00
Dave Anderson
0fd7502221 Further fix for the replacements made to the kernel's cpu_online_mask,
cpu_possible_mask, cpu_present_mask and cpu_active_mask symbols in
the kernel commit for Linux 4.5 and later kernels for when the
crash session is brought up with "crash -d<debug-level>".  Without
the patch, the cpus found in each mask are displayed like this
example:

             cpu_possible_(null): cpus: 0 1 2 3 4 5 6 7
              cpu_present_(null): cpus: 0 1
               cpu_online_(null): cpus: 0 1
               cpu_active_(null): cpus: 0 1

The "(null)" string segments above should read "mask".
(anderson@redhat.com)
2016-02-12 11:22:06 -05:00
Dave Anderson
7a0d2c9e12 Fixes for "[-Werror=misleading-indentation]" compiler warnings that
are generated by the following files, when building X86_64 in a
Fedora Rawhide environment with gcc-6.0.0:

  gdb-7.6/gdb/ada-lang.c
  gdb-7.6/gdb/linux-record.c
  gdb-7.6/gdb/inflow.c
  gdb-7.6/gdb/printcmd.c
  gdb-7.6/gdb/c-typeprint.c

Without the patch, warnings in the gdb-7.6/gdb directory are not
treated as errors, and are non-fatal to the build.
(anderson@redhat.com)
2016-02-10 15:50:49 -05:00
Dave Anderson
0eadd7fc84 Implement support for per-cpu IRQ stacks on the ARM64 architecture,
which were introduced in Linux 4.5 by this commit:

  commit 132cd887b5c54758d04bf25c52fa48f45e843a30
  arm64: Modify stack trace and dump for use with irq_stack

Without the patch, if an active task was operating on its per-cpu
IRQ stack on dumpfiles generated by kdump, its backtrace would start
at the exception frame that was laid down on the process stack.
This patch also adds support for "bt -E" to search IRQ stacks for
exception frames, and the "mach" command displays the addresses
of each per-cpu IRQ stack.
(anderson@redhat.com)
2016-02-10 11:59:09 -05:00
Dave Anderson
1e770f68b0 Configure the embedded gdb module with "--disable-sim" in order to
bypass the unnecessary build of the libsim.a library.
(anderson@redhat.com)
2016-02-03 11:21:25 -05:00
Dave Anderson
517a179654 Fix for a "[-Werror=unused-const-variable]" compiler warning that
is generated by "gdb-7.6/opcodes/mips-dis.c" when building with
"make target=MIPS" on an x86_64 host with gcc-6.0.0.  Without the
patch, the warning is treated as an error and the build is aborted.
(anderson@redhat.com)
2016-02-03 11:15:18 -05:00
Dave Anderson
4fdc95c5f9 Fix for a series of "[-Werror=shift-negative-value]" compiler
warnings that are generated by "gdb-7.6/bfd/elf64-ppc.c" and
"gdb-7.6/opcodes/ppc-opc.c" when building with "make target=PPC64"
on an x86_64 host with gcc-6.0.0.  Without the patch, the warnings
are treated as errors and the build is aborted.
(anderson@redhat.com)
2016-02-02 11:50:44 -05:00
Dave Anderson
8df224099b Fix for a "[-Werror=shift-negative-value]" compiler warning that is
generated by "gdb-7.6/opcodes/arm-dis.c" when building crash with
"make target=ARM64" on an x86_64 host with gcc-6.0.0.  Without the
patch, the warning is treated as an error and the build is aborted.
(anderson@redhat.com)
2016-02-02 10:49:06 -05:00
Dave Anderson
835c360273 Fixes for "[-Werror=misleading-indentation]" compiler warnings that
are generated by the following files, when building X86_64 in a
Fedora Rawhide environment with gcc-6.0.0:

  gdb-7.6/bfd/coff-i386.c
  gdb-7.6/bfd/coff-x86_64.c
  kernel.c
  x86_64.c
  lkcd_common.c

Without the patch, the warnings in the bfd library files are treated
as errors, and abort the build.  The three instances in the top-level
crash source code directory are non-fatal.  There are several other
gdb-specific instances that are non-fatal and are not addressed.
(anderson@redhat.com)
2016-02-02 10:15:11 -05:00
Dave Anderson
1e92f9fad3 Fix for the replacements made to the kernel's cpu_possible_mask,
cpu_online_mask, cpu_present_mask and cpu_active_mask symbols in
this kernel commit for Linux 4.5 and later kernels:

  commit 5aec01b834fd6f8ca49d1aeede665b950d0c148e
  kernel/cpu.c: eliminate cpu_*_mask

Without the patch, behavior is architecture-specific, dependent upon
whether the cpu mask values are used to calculate the number of cpus.
For example, ARM64 crash sessions fail during session initialization
with the error message "crash: zero-size memory allocation! (called
from <address>)", whereas X86_64 sessions come up normally, but
cpu mask values of zero are stored internally.
(anderson@redhat.com)
2016-02-01 16:10:49 -05:00
Dave Anderson
c341345659 The crash utility has not supported Xen dom0 and domU dumpfiles since
since this Linux 3.19 commit:

  commit 054954eb051f35e74b75a566a96fe756015352c8
  xen: switch to linear virtual mapped sparse p2m list

This patch resurrects support for dom0 dumpfiles only.  Without the
patch, the crash session fails during session initialization with the
message "crash: cannot resolve p2m_top".
(daniel.kiper@oracle.com)
2016-01-26 10:18:09 -05:00
Dave Anderson
6f1f78e334 Fix for the changes made to the kernel module structure introduced by
this kernel commit for Linux 4.5 and later kernels:

  commit 7523e4dc5057e157212b4741abd6256e03404cf1
  module: use a structure to encapsulate layout.

Without the patch, the crash session fails during initialization
with the error message: "crash: invalid structure member offset:
module_init_text_size".
(sebott@linux.vnet.ibm.com)
2016-01-20 09:56:36 -05:00
Dave Anderson
63f7707d2b Fix for the "ps -t" option in 3.17 and later kernels that contain
commit ccbf62d8a284cf181ac28c8e8407dd077d90dd4b, which changed the
task_struct.start_time member from a struct timespec to a u64.
Without the patch, the "RUN TIME" value is nonsensical.
(anderson@redhat.com)
2016-01-11 15:53:44 -05:00
Dave Anderson
4641ea1f61 Fix for the "bt" command to properly pull the stack and frame pointer
registers from the NT_PRSTATUS notes of 32-bit tasks running in
user-mode on ARM64.  Without the patch, the "bt" command utilizes
ptregs->sp and ptregs->regs[29] for 32-bit tasks instead of the
architecturally-mapped ptregs->regs[13] and ptregs->regs[11], which
yields unpredictable/invalid results, and possibly a segmentation
violation.
(drjones@redhat.com)
2016-01-05 15:56:34 -05:00
Dave Anderson
e2a2ed3406 Make the "zero excluded" mode default behavior when analyzing SADUMP
dumpfiles because some Fujitsu troubleshooting software assumes the
behavior.  Also, fix the "set -v" option to show the "zero_excluded"
internal variable as "on" if it has been set when analyzing SADUMP
dumpfiles.
(d.hatayama@jp.fujitsu.com)
2016-01-04 12:04:19 -05:00
Dave Anderson
2e29d684a4 Fix for the translation of X86_64 virtual addresses in the vsyscall
region between 0xffffffffff600000 and 0xffffffffffe00000.  Without
the patch, the reading of addresses in that region returns invalid
data; in addition, the "vtop" command for an address in that region
shows an invalid physical address under the "PHYSICAL" column.
(nakajima.akira@nttcom.co.jp, anderson@redhat.com)
2016-01-04 11:40:48 -05:00
Dave Anderson
c0af94a29d Fix for the handling of Xen DomU ELF dumpfiles to prevent the
pre-gathering of p2m frames during session initialization, which
is unnecessary since ELF files contain the mapping information in
their ".xen_p2m" section.  Without the patch, it is possible that the
crash session may be unnecessarily aborted if the p2m frame-gathering
fails, for example, if the CR3 value in the header is invalid.
(ptesarik@suse.com)
2015-12-18 15:02:28 -05:00
Dave Anderson
fd6c2a8c5a crash-7.1.3 -> crash-7.1.4 2015-12-16 11:05:23 -05:00
Dave Anderson
2515ef355f Fix for "crash --osrelease" on Xen kernels that have both VMCOREINFO
and VMCOREINFO_XEN ELF notes.  Without the patch, the command returns
"(unknown)".
(anderson@redhat.com, dietmar.hahn@ts.fujitsu.com)
2015-12-14 09:13:49 -05:00
Dave Anderson
9ba68adb0c Introduction of the "sys -i" option, which displays the kernel's DMI
identification string data if available.
(atomlin@redhat.com, anderson@redhat.com)
2015-12-09 09:25:14 -05:00
Dave Anderson
889f4f665e Added "print_array" as a new internal variable that may be turned
on/off with the "set" command.  When set to "on", gdb's printing of
arrays will be set to "pretty", so that the display of each array
element will consume one line.
(anderson@redhat.com)
2015-12-08 15:46:51 -05:00
Dave Anderson
fa07b6ca33 Enhanced the debug-only display of the first kernel data items read
during session initialization.  This includes the system's cpu maps,
xtime, and utsname data.  These require at least "-d1" as a command
line option value, and are primarily useful as an aide for debugging
suspect dumpfiles that fail during session initialization.
(anderson@redhat.com)
2015-12-03 16:05:34 -05:00
Dave Anderson
58feffd9fd Added a new "list -l <offset>" option that can only be used in
conjunction with "-s", and requires that the "start" address is the
address of a list_head, or other similar list linkage structure whose
first member points to the next linkage structure.  The "-l <offset>"
argument is the offset of the embedded list linkage structure in the
specified "-s" data structure; it can be either a number of bytes or
expressed in "struct.member" format.
(anderson@redhat.com)
2015-12-02 15:13:45 -05:00
Dave Anderson
9ef911789a Fix for 32-bit ARM kernels that are configured with CONFIG_SLAB
and contain percpu array_cache structures that were allocated with
vmalloc().  Without the patch, during session initialization there
will be error messages of the form: "crash: kmem_cache: <vaddr>:
invalid array_cache pointer: <vaddr>", and during runtime, the
"kmem -[sS]" commands will show kmem_cache lines that marked as
"[INVALID/CORRUPTED]".
(anderson@redhat.com)
2015-12-02 11:24:32 -05:00
Dave Anderson
c4887936fa Introduced a general-purpose handler to register data structures that
the kernel has dynamically downsized from the size indicated by the
debuginfo data.  At this time, only "kmem_cache" and "task_struct"
structures that have been downsized are registered, but others may be
added in the future.  If a downsized data structure is passed to gdb
for display, gdb will request a read of the "full" data structure,
which may flow into a memory region that was either filtered by
makedumpfile(8), or perhaps into non-existent memory, thereby killing
the generating command immediately due to a partial read.  With this
patch, commands such as "struct" and "task" that reference downsized
data structures will have their reads flagged to return successfully
if partial read error occurs.
(anderson@redhat.com)
2015-11-30 15:55:26 -05:00