Commit Graph

233 Commits

Author SHA1 Message Date
Dave Anderson
94b8342c71 crash-7.1.1 -> crash-7.1.2 2015-07-13 10:42:01 -04:00
Dave Anderson
b3be954095 If a symbol or symbol+offset argument is passed to the "dis" command,
and there are multiple text symbols with the same symbol name, then
display a message indicating that there are "duplicate text symbols
found", followed by a list of the symbols.  Without the patch, the
duplicate symbol with the lowest virtual address is used.
(atomlin@redhat.com, anderson@redhat.com)
2015-07-09 16:52:30 -04:00
Dave Anderson
21874fe737 Export the previously static symbol_name_count() function, which
returns a count of symbols with the same name.  Export a new
is_symbol_text() function, which checks whether specified symbol
entry is a type 't' or 'T'.
(atomlin@redhat.com, anderson@redhat.com)
2015-07-09 12:56:29 -04:00
Dave Anderson
a8921b155f Update the extensions/eppic.mk file to clone the eppic source code
from https://github.com/lucchouina/eppic.git.
(lucchouina@gmail.com)
2015-07-09 10:45:18 -04:00
Dave Anderson
203853b71e Fix compiler warning generated by extensions/trace.c when compiled
with gcc version 5.  Without the patch, the message "warning: the
use of 'mktemp' is dangerous, better use 'mkstemp'" is generated.
(anderson@redhat.com)
2015-07-08 09:14:18 -04:00
Dave Anderson
39fa580b6d If the starting hexadecimal address of a function is passed to the
"dis" command without a count argument, disassemble the entire
function -- similar to when a symbol name of a function is passed
without a count argument.  Without the patch, only one instruction
is displayed.
(atomlin@redhat.com)
2015-07-06 10:05:04 -04:00
Dave Anderson
9a3cef8342 Force the 32-bit MIPS extensions/eppic.so to be compiled with -m32.
This is required when "make extensions" is executed after the top
level crash binary has been built with "make TARGET=MIPS" on an
x86_64 host.
(rabinv@axis.com)
2015-07-06 09:29:17 -04:00
Dave Anderson
c69e75877d Fix for the error handling of the "foreach task -R struct.member"
format if an invalid structure and/or member is used as an argument.
Without the patch, the command will display the expected error
indicating "task: invalid structure member reference", but then will
be followed by a stream of "task: recursive temporary file usage"
error messages.
(anderson@redhat.com)
2015-07-03 19:04:10 -04:00
Dave Anderson
0ab34ff030 Modified the qualification for the execution of the "runq -g" option.
Without the patch, if the target kernel was not configured with both
CONFIG_FAIR_GROUP_SCHED and CONFIG_RT_GROUP_SCHED, the command fails
with the message "runq: -g option not supported or applicable on this
architecture or kernel".  With this patch, if the kernel was built
with either CONFIG_FAIR_GROUP_SCHED or CONFIG_RT_GROUP_SCHED, the
command will execute.
(rabinv@axis.com)
2015-07-02 15:39:10 -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
7a2ff137fe Commit f95ecdc330 above to speed up
"crash --osrelease" for flattened format dumpfiles inadvertently
broke the option for ELF kdump and compressed kdump dumpfiles.
(anderson@redhat.com)
2015-07-01 16:25:56 -04:00
Dave Anderson
4af766ba41 Fix for the "timer" command when run on a kernel with a large number
of cpus.  Without the patch, the command may fail prematurely with
a dump of the internal crash utility allocated buffer statistics
followed by the message "timer: cannot allocate any more memory!",
(anderson@redhat.com)
2015-07-01 15:30:15 -04:00
Dave Anderson
df8ab4efc2 Fix for the PPC64 "bt" command to align its exception frame verifier
function with the most recent version of the kernel's getvecname()
function, which was updated in Linux 3.12.  Without the patch, the
"Hypervisor Decrementer", "Emulation Assist", "Hypervisor Doorbell",
"Altivec Unavailable", "Instruction Breakpoint", "Denormalisation",
"HMI" and "Altivec Assist" exception types are not recognized and
their exception frames not displayed; the  "Doorbell" exception type
is marked as a "reserved" exception type.
(anderson@redhat.com)
2015-06-29 10:19:25 -04:00
Dave Anderson
af28417771 Fix for the "bt" command on little-endian PPC64 machines for tasks
that are blocked in __schedule().  Without the patch, there will be
two "__switch_to" frames displayed before the normal "__schedule"
frame that is used as the starting point for blocked tasks.
(anderson@redhat.com)
2015-06-29 10:16:18 -04:00
Dave Anderson
4c46b8b028 Fix for the PPC64 "bt" command for active non-panic tasks. Without
the patch, the backtrace may fail immediately with the error message
"bt: invalid kernel virtual address: f  type: Regs NIP value".
(anderson@redhat.com)
2015-06-29 10:13:08 -04:00
Dave Anderson
68b413b9e4 Fix for the internal memory allocation functionality. Without the
patch, in the unlikely event where the GETBUF() facility has to
utilize malloc() to allocate a buffer, and CTRL-c is entered while
that buffer is being zeroed out before being returned to the caller,
it may result in a never-ending set of "malloc-free mismatch" error
messages.
(anderson@redhat.com)
2015-06-25 11:42:54 -04:00
Dave Anderson
cd93c8a0b5 Several fixes associated with the gathering and display of task
state.  Without the patch:
  (1) The "ps" command's ST column shows "??" for tasks in the
      TASK_WAKING state.
  (2) The "ps" command's ST column shows "??" for tasks in the
      TASK_PARKED state in Linux 3.14 and later kernels.
  (3) The STATE field of the initial system banner and the "set"
      command are incorrect if the task state has the TASK_WAKING,
      TASK_WAKEKILL modifier, or TASK_PARKED bits set in Linux 3.14
      and later kernels.
  (4) The "foreach DE" task identifier fails if a task with a PID
      number of 0xDE (222) exists.
  (5) The "foreach" command's "SW", "PA", "TR" and "DE" task
      identifiers inadvertently select all tasks in kernel versions
      that do not have those states.
  (6) The "help -t" output would display incorrect values for the
      TASK_WAKEKILL, TASK_WAKING and TASK_PARKED states in Linux 3.14
      and later kernels.
Lastly, support for the TASK_NOLOAD modifier introduced in Linux 4.2
has been added to STATE field of the "set" command and the initial
system banner.
(anderson@redhat.com)
2015-06-23 15:07:25 -04:00
Dave Anderson
fbf9a6fed1 Fix for the initialization-time sorting mechanism required for
"flattened format" dumpfiles if the dumpfile is truncated/incomplete.
Without the patch, the sorting function continues performing invalid
reads beyond the of the dumpfile, which may lead to an infinite loop
instead of a session-ending error message.  In addition, since the
sorting operation may take several minutes, a "please wait" message
with an incrementing percentage-complete counter will be displayed.
(anderson@redhat.com)
2015-06-18 15:33:50 -04:00
Dave Anderson
f95ecdc330 Speed up the "crash --osrelease" option when used with "flattened"
format dumpfiles.  Without the patch, the rearranged data array
initialization is performed before the vmcoreinfo data in the
header is read, which can take a significant amount of time with
large dumpfiles.  The patch simply looks for the appropriate
vmcoreinfo data string near the beginning of the dumpfile.
(anderson@redhat.com)
2015-06-16 16:40:19 -04:00
Dave Anderson
005eb9e502 Fix to prevent an unnecessary/temporary GETBUF() memory allocation
of 1 MB by the dump_mem_map() utility function when the kernel is
configured with CONFIG_SPARSEMEM.
(yangoliver@gmail.com)
2015-06-16 11:09:28 -04:00
Dave Anderson
cefda9be11 Fix for the S390X "bt" command when running against kernels that have
Linux 4.0 commit 2f859d0dad818765117c1cecb24b3bc7f4592074, which
removes the "async_stack" and "panic_stack" members from the "pcpu"
structure.  Without the patch, backtraces of active tasks that were
executing I/O or machine check interrupts are not displayed, while
other tasks may generate fatal readmem() errors of type "readmem_ul".
(holzheu@linux.vnet.ibm.com)
2015-06-09 10:10:52 -04:00
Dave Anderson
23939b2c44 Enabled the "crash --log vmcore" command line option on the ARM64
architecture.  Without the patch, the option fails with the message
"crash: crash --log not implemented on ARM64: TBD".
(anderson@redhat.com)
2015-06-04 14:01:38 -04:00
Dave Anderson
2e84d38c93 Enabled the "bt -R" option on the ARM64 architecture. Without the
patch, the option fails with the message "bt: -R option not supported
or applicable on this architecture or kernel".
(anderson@redhat.com)
2015-06-04 10:36:06 -04:00
Dave Anderson
15a58e4070 Enhancement of the ARM64 backtrace capability. Without the patch,
backtraces of the active tasks start at the function that is saved
in each per-cpu ELF note.  With the patch, the backtrace will start
at the "crash_kexec" function on the panicking cpu, and at the
"crash_save_cpu" function on the other active cpus.  By doing so,
the backtrace will display the exception handling functions leading
to crash_kexec() or crash_save_cpu(), as well as the exception frame
register set as it was at the time of the fatal exception on the
panic cpu, or when the shutdown IPI was received on the other cpus.
(anderson@redhat.com)
2015-06-02 16:03:11 -04:00
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