Commit Graph

209 Commits

Author SHA1 Message Date
Dave Anderson
6b04220e76 crash-7.1.0 -> crash-7.1.1 2015-05-27 10:55:27 -04:00
Dave Anderson
8b752d7b95 Fix for the handling of ARM64 kernel module per-cpu symbols. Without
the patch, if the debuginfo data of an ARM64 kernel module that
contains a per-cpu section is loaded by "mod -s <module>" or
"mod -S", commands such as "bt" or "sym" may incorrectly translate
the module's virtual addresses to symbol names.
(Jan.Karlsson@sonymobile.com)
2015-05-27 10:43:54 -04:00
Dave Anderson
3cbecbcd3c Fix for any command that passes strings to gdb for evaluation,
where the string contains a parentheses-within-parentheses
expression along with a ">" or ">>" operator inside the outermost
set of parentheses.  Without the patch, a command such as the
following fails like so:

  crash> p ((1+1) >> 1)
  p: gdb request failed: p ((1+1)
  crash>

(anderson@redhat.com)
2015-05-21 17:28:11 -04:00
Dave Anderson
042639e3f5 Enhanced the "struct.member" display capability of the "struct",
"union", "task", "list" and "tree" commands.  If a specified
structure member contains an embedded structure, the output may
be restricted to just the embedded structure by expressing the
.member argument as "member.member".  If a specified structure
member is an array, the output may be restricted to a single array
element by expressing the .member argument as "member[index]".
Furthermore, these embedded member specifications may extend beyond
one level deep, for example, by expressing the member argument as
"member.member.member", or "member[index].member".
(Alexandr_Terekhov@epam.com, anderson@redhat.com)
2015-05-21 16:46:10 -04:00
Dave Anderson
d4040e2fb4 Fixes for the translation of ARM64 PTEs, as displayed by the "vm -p"
and "vtop" commands.  Without the patch, if "vm -p" references a
swapped-out page on Linux 4.0 and later kernels, the SWAP location
may indicate "(unknown swap location)", and will show an invalid
OFFSET value; on Linux 3.13 and later kernels, running "vtop" on a
user virtual address incorrectly translates the PTE contents of
swapped out pages by showing a PHYSICAL address and FLAGS translation
instead of the SWAP device and OFFSET.  It is possible that there may
be PTE bit translation errors on other kernel versions; the patch
addresses the changes in ARM64 PTE bit definitions made in Linux
3.11, 3.13, and 4.0 kernels.
(anderson@redhat.com)
2015-05-21 09:55:29 -04:00
Dave Anderson
4119e19053 Fix for the DATE display in the initial system banner and by the
"sys" command to account for the Linux 3.17 change that moved
the "timekeeper" symbol and structure into a containing tk_core
structure; the "shadow_timekeeper" timekeeper will be used as an
alternative.  Without the patch, the DATE shows something within
a few hours of the Linux epoch, such as "Wed Dec 31 18:00:00 1969".
(kmcmartin@redhat.com)
2015-05-19 17:09:06 -04:00
Dave Anderson
7623eee904 Fix for the ARM64 page size determination on Linux 4.1 and later
kernels.  Without the patch, the crash session fails during
initialization with the message "crash: invalid/unsupported page
size: 98304" on kernels with 64K pages.  On kernels with 4K pages,
the message is "crash: invalid/unsupported page size: 6144".  In
addition, the "-p <page-size>" command line override option
had no effect on ARM64; that has been fixed as well.
(anderson@redhat.com)
2015-05-19 10:20:04 -04:00
Dave Anderson
83e30b1b74 The "help -r" option has been extended to dump the ARM64 registers
stored in each NT_PRSTATUS note in ELF kdump vmcores.
(anderson@redhat.com)
2015-05-18 16:48:07 -04:00
Dave Anderson
1cb3d906a3 The "help -r" option has been extended to dump the ARM64 registers
stored in each per-cpu NT_PRSTATUS note in compressed kdump vmcores.
(anderson@redhat.com)
2015-05-18 16:33:37 -04:00
Dave Anderson
a2f1df9e98 Minor fixes to previous commit cc1513295e:
X17 was incorrectly shown as X16, and LR was shown as X30
(anderson@redhat.com)
2015-05-18 16:24:57 -04:00
Dave Anderson
cc1513295e Additional output for the "help [-D|-n]" options on ARM64. For ELF
kdump vmcores and compressed kdumps, the elf_prstatus structure in
each NT_PRSTATUS note will be translated.
(anderson@redhat.com)
2015-05-18 14:33:13 -04:00
Dave Anderson
9b41d403b1 Fix for a segmentation violation generated by the "help -[n|D]"
options on ARM64 compressed kdumps.
(anderson@redhat.com)
2015-05-18 11:14:23 -04:00
Dave Anderson
86e55bf87b Remove the leftover ".constructor" build file in the extensions
subdirectory when "make extensions" is complete, and update the
top-level .gitignore file to ignore post-build extensions
subdirectory files.
(anderson@redhat.com)
2015-05-18 11:00:31 -04:00
Dave Anderson
d47a1cd48d Fix to remove an invalid warning message on ARM64 if a crash session
is invoked with the "-d<number>" debug flag.  Without the patch,
the invalid message is "WARNING: SPARSEMEM_EX: questionable section
values".
(anderson@redhat.com)
2015-05-18 10:04:22 -04:00
Dave Anderson
3b51fc6b75 Support enhancement for the 32-bit MIPS architecture that retrieves
the per-cpu registers from the NT_PRSTATUS notes stored in the header
of compressed kdump dumpfiles.
(rabinv@axis.com)
2015-05-13 16:47:40 -04:00
Dave Anderson
a8e7fc1e58 Implemented a new "kmem -m" option that is similar to "kmem -p",
but it allows the user to specify the page struct members to be
displayed.  The option takes a comma-separated list of one or
more page struct members, which will be displayed following the
page structure address.  The "flags" member will always be expressed
in hexadecimal format, and the "_count" and "_mapcount" members will
always be expressed in decimal format.  Otherwise, all other members
will be displayed in hexadecimal format unless the current output
radix is 10 and the member is a signed/unsigned integer.  Members
that are data structures may be specified by the data structure's
member name, or expanded to specify a member of that data structure.
For example, "-m lru" refers to a list_head data structure, in which
case both the list_head.next and list_head.prev pointer values will
be displayed; if "-m lru.next" is specified, just the list_head.next
value will be displayed.
(atomlin@redhat.com, anderson@redhat.com)
2015-05-12 15:17:54 -04:00
Dave Anderson
c50fad9be1 Update/fix for prior commit 1e858ed48e
(anderson@redhat.com)
2015-05-08 16:50:57 -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
466b9f476a A prior commit added support for Linux version 4.x. To prevent surprise
failures due to unexpected kernel version bumps in the future, support
has been added for version 5, keeping it one step ahead.
(anderson@redhat.com)
2015-05-01 10:17:09 -04:00
Dave Anderson
f1dbe49fa8 Remove the non-existent "-L" option from the "ps" command's mutually-
exclusive options error message.
(vvs@parallels.com)
2015-04-30 10:36:17 -04:00
Dave Anderson
d304aab38b Speed up the session invocation time of "flattened" format dumpfiles
created by the makedumpfile(8) facility.  When sorting the blocks of
memory by their intended ELF or compressed kdump file offsets, the
patch replaces the bubble-sort method that is currently used with an
insertion sort method.
(dslutz@verizon.com)
2015-04-29 10:27:03 -04:00
Dave Anderson
7f3731aa09 Fix for a regression in crash-7.1.0 that causes failures when the
"crash -t" option is run on a live system, and when analyzing remote
Linux kernels.  Without the patch, "crash -t" on a live system fails
with the message "crash: cannot open remote memory source: /dev/mem",
and attempts to analyze a Linux kernel remotely just shows the kernel
timestamp and exits immediately.
(dslutz@verizon.com, anderson@redhat.com)
2015-04-28 15:14:12 -04:00
Dave Anderson
4e1dca2133 Fix to address the Xen 4.5.0 hypervisor symbol name change from
"dom0" to "hardware_domain".  Without the patch, the crash session
fails with the error message "crash: cannot resolve: dom0".
(dslutz@verizon.com)
2015-04-28 10:37:39 -04:00
Dave Anderson
1c10f98a56 Fix for "and and" and "the the" typos in the README file.
(weijg.fnst@cn.fujitsu.com)
2015-04-27 12:05:36 -04:00
Dave Anderson
117284469a Fix for a typo in "help foreach", and a fix for a spelling error in
"help input".
(weijg.fnst@cn.fujitsu.com)
2015-04-27 11:15:00 -04:00
Dave Anderson
def93c22f9 Several fixes, updates, and enhancements for 32-bit MIPS support:
(1) The MIPS general purpose registers in the elf_gregset_t
      don't start at index 0 but at index 6.
  (2) Adjust for the kernel's pt_regs structure changes between
      kernel versions.  For example, fields are inserted into the
      middle based on build time options, and the amount of padding
      at the head of the structure was changed relatively recently.
      To handle this, split the structure definition into two parts
      and get the offsets of these two parts dynamically.
  (3) Do not display each parsed kernel symbol during initialization
      when invoked with "crash -d8".
  (4) Add support for loading raw MIPS ramdump dumpfiles.
  (5) Add support for compressed kdump dumpfiles.
(rabinv@axis.com)
2015-04-24 12:07:02 -04:00
Dave Anderson
407ce33ed0 Build extension modules that utilize the generic extensions/Makefile
with -g.  In addition, build the snap.c extension module with -g.
(rabinv@axis.com)
2015-04-24 10:42:54 -04:00
Dave Anderson
c0eae75272 Implemented a new "runq -c cpu(s)" option to display the run queue
data of specified cpus.  It can be used in conjunction with all runq
command options.  The cpus must be specified in a comma- and/or
dash-separated list; for examples, "3", "1,8,9", "1-23", or "1,8-15".
(anderson@redhat.com)
2015-04-22 14:40:11 -04:00
Dave Anderson
b4970528b2 Implemented a new fill_struct_member_data() function that gathers
a bundle of data that describes a structure member.  The function
receives a pointer to a struct_member_data structure, in which the
caller has initialized the "structure" and "member" name pointers:

  struct struct_member_data {
          char *structure;
          char *member;
          long type;
          long unsigned_type;
          long length;
          long offset;
          long bitpos;
          long bitsize;
  };

A gdb "printm" command is crafted using those two fields, and the
output of the command is used to initialize the remaining six fields.
Adapted from Qiao Nuohan's "pstruct" extension module.
(anderson@redhat.com, qiaonuohan@cn.fujitsu.com)
2015-04-14 16:41:49 -04:00
Dave Anderson
70e58f1d10 Implemented a new STRDUPBUF() utility that will duplicate an existing
string into a buffer allocated with GETBUF().  As is the case with
any buffer allocated with GETBUF(), it is only meant to exist during
the life-span of the current command.  If it is not explicitly freed
via FREEBUF(), then it will be freed automatically prior to the next
command.
(anderson@redhat.com)
2015-04-14 16:02:09 -04:00
Dave Anderson
39fffdc78c Fortified the error handling of task gathering from the pid_hash[]
chains during session initialization.  If a chain has been corrupted,
the patch prevents the sequence from entering an infinite loop, and
the error messages associated with corrupt/invalid chains have been
updated to report the pid_hash[] index number.
(anderson@redhat.com)
2015-04-09 11:34:25 -04:00
Dave Anderson
1ed90b28af Enhancement to the support of VMware .vmss suspended state dumpfiles.
There may be holes in the memory address saved for PCI, etc.  In such
cases, the memory dump is divided into regions.  With this patch, up
to 3 memory regions are supported.
(hfu@vmware.com)
2015-03-31 10:46:30 -04:00
Dave Anderson
384a3f0bb7 Fix to support ELF vmcore dumpfiles whose PT_LOAD file offset values
of their respective memory segments are not laid out sequentially
from low to high in the dumpfile.  This has only been seen in ELF
vmcore files created by the VMware vmss2core facility.  Without the
patch, the crash session may fail during initialization, either with
the message "cannot malloc ELF header buffer", or "crash: <dumpfile>:
not a supported file format".
(anderson@redhat.com)
2015-03-26 15:29:43 -04:00
Dave Anderson
2544f3ce85 Fix for ARM64 kernels to account for changes in the virtual memory
layout introduced in Linux 3.17.  The vmalloc region end address, and
the vmemmap start and end addresses are now calculated at kernel
build time, because they depend upon the size of a struct page.
Accordingly, the crash utility needs to calculate those three address
values dynamically, after the embedded gdb module has initialized.
Without the patch, reads of page structures return invalid data due
to incorrect virtual-to-physical translations of memory in the
vmemmap range.  This in turn causes commands that require page
structure contents to fail or show invalid data, such as "kmem -p",
"kmem -[sS]", and the "kmem -[fF]" options.
(anderson@redhat.com)
2015-03-23 15:51:28 -04:00
Dave Anderson
19d7200112 During initialization, reject useless ARM64 "(A)" and "(a)" absolute
symbols that are below the text region.  Without the patch, several
recently-introduced absolute symbols have been introduced into the
kernel, which will be displayed by "sym -l" prior to the first kernel
virtual address symbol, and will show up in command output where
memory values are translated into kernel symbol references.
(anderson@redhat.com)
2015-03-19 14:04:44 -04:00
Dave Anderson
eff086f2d4 Fix to account for Xen hypervisor's "domain" structure member name
change from "is_paused_by_controller" to "controller_pause_count".
Without the patch, in Xen 4.2.5 and later, the crash session fails
during initialization with the error message 'crash: invalid
structure member offset: domain_is_paused_by_controller".
(dietmar.hahn@ts.fujitsu.com)
2015-03-11 09:59:09 -04:00
Dave Anderson
6e74d3e24f When the gdb-<version>.patch file has changed and a rebuild is
done from within a previously-existing build tree, the "patch -N"
option is used to ignore patches that have been previously applied;
this patch also applies the "patch -r-" option to prevent unnecessary
.rej files from being created.
(anderson@redhat.com)
2015-03-03 14:20:28 -05:00
Dave Anderson
88cb8e194f Fix for insecure temporary file usage in _rl_tropen() as reported by
readline library CVE-2014-2524.
(anderson@redhat.com)
2015-03-03 13:48:16 -05:00
Dave Anderson
fe6679f131 Fix for command lines that are redirected to a pipe. Without the
patch, if an external piped-to command contains a quoted string that
includes a "|" character, the command fails with the message "crash:
pipe operation failed".
(anderson@redhat.com)
2015-02-25 11:33:29 -05:00
Dave Anderson
84f96f39a8 Add support for more than 16TB of physical memory space in the SADUMP
dumpfile format.  Without the patch, there is a limitation caused
by several 32-bit members of dump_header structure, in particular
the max_mapnr member, which overflows if the dumpfile contains more
than 16TB of physical memory space.  The header_version member of
the dump_header structure has been increased from 0 to 1 in this
extended new format, and the new 64-bit members will be used.
(d.hatayama@jp.fujitsu.com)
2015-02-20 10:20:08 -05:00
Dave Anderson
db07dbf5a7 Prepare for the future increment of Linux 3.x to 4.x.
(anderson@redhat.com)
2015-02-19 16:16:33 -05:00
Dave Anderson
e43267e888 Remove the LKCD-only "propeller spinner" seen when a dumpfile read
requires more than 2048 page header accesses.  This was put in place
because of the non-random-access design of LKCD dumpfiles.  Without
the patch, the spinner display is intermingled with command output,
which complicates the parsing of the output.
(watters.sam@gmail.com)
2015-02-13 09:57:57 -05:00
Dave Anderson
ceeeeaa2f7 Addressed three Coverity Scan complaints in vmware_vmss.c:
50:leaked_storage: Variable "fp" going out of scope leaks the
     storage it points to.
  53:leaked_storage: Variable "fp" going out of scope leaks the
     storage it points to.
 256⚠️ Use of memory after it is freed
(anderson@redhat.com)
2015-02-12 14:35:33 -05:00
Dave Anderson
6c3f1463aa If the kernel (live or dumpfile) has the TAINT_LIVEPATCH bit set, or
if the Red Hat "kpatch" module is installed, the tag "[LIVEPATCH]"
will be displayed next to the kernel name in the initial system banner
and by the "sys" command.  This new tag replaces the "[KPATCH]" tag
introduced in crash-7.0.7.
(anderson@redhat.com)
2015-02-12 10:12:21 -05:00
Dave Anderson
1af86401e1 Fix for two minor issues with the "net" command. Without the patch,
the "net -a" option appends its correct output with the command's
"Usage:" message; and if either the "net -x" or "net -d" options are
used without also specifying "-s" or "-S", the error message would
indicate "net: illegal flag: 800000" or "net: illegal flag: 1000000"
instead of showing the command's "Usage:" message.
(anderson@redhat.com)
2015-02-11 11:22:35 -05:00
Dave Anderson
a484088de6 Fix CFILES in Makefile: mips.o to mips.c 2015-02-06 13:53:43 -05:00
Dave Anderson
96b198c98c crash-7.0.9 -> crash-7.1.0 2015-02-06 11:48:20 -05: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
28a2bd99a9 Update the extensions/trace.c extension module to account for the
movement of the ftrace_event_call.name member into an anonymous
union in Linux 3.15, commit de7b2973903c6cc50b31ee5682a69b2219b9919d.
(rabin@rab.in)
2015-02-05 09:35:45 -05:00
Dave Anderson
75014edcbd Add appropriate checks for the MIPS architecture to allow extension
modules to be loaded with the "extend" command.
(rabin@rab.in)
2015-02-05 09:33:02 -05:00