Commit Graph

532 Commits

Author SHA1 Message Date
Dave Anderson
ad757cb474 Fix for an ARM64 compilation failure of the embedded gdb file
"aarch-linux-nat.c" in the Fedora fc21 rawhide environment, which
uses glibc-headers-2.19.90-24.fc21.
(anderson@redhat.com)
2014-07-02 14:58:26 -04:00
Dave Anderson
1767e9d4f7 If a compressed kdump is damaged/truncated such that the bitmap data
in the dumpfile header is not contained within the file, attempts
to analyze it with a vmlinux file, or using the "crash --osrelease"
or "crash --log" options with just the vmcore, will result in the
crash utility spinning forever, endlessly performing reads of 0 bytes
from the file without recognizing the EOF condition.
(dwysocha@redhat.com)
2014-06-27 14:37:15 -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
683ae262f4 Fix for the "mod -S" command to find the debuginfo data for Red Hat
"kpatch" modules.  Without the patch, the command would display
"mod: cannot find or load object file for <kpatch-module> module".
(anderson@redhat.com)
2014-06-26 14:55:08 -04:00
Dave Anderson
754f073901 Fix for the "search -t" option if the system has 2064 or more tasks.
Without the patch, the command fails with a dump of the crash utility
memory allocation statistics, ending with "search: cannot allocate
any more memory!".
(anderson@redhat.com)
2014-06-20 16:16:12 -04:00
Dave Anderson
13c0faff75 Fix for file-handling errors when a compressed vmlinux.debug file
is followed by a vmlinux file on the crash command line.  When the
crash session ends, two errors will occur:
  (1) the vmlinux file will be deleted
  (2) the temporary uncompressed version of the vmlinux.debug file
      will remain in /var/tmp
This problem also occurs in the highly unlikely case where a
compressed vmlinux file is followed by a vmlinux.debug file on the
command line, and the uncompressed temporary version of the vmlinux
file is larger than the vmlinux.debug file.  In that case:
  (1) the vmlinux.debug file will be deleted
  (2) the temporary uncompressed version of the vmlinux file
will remain in /var/tmp
(dmair@suse.com)
2014-06-16 10:11:18 -04:00
Dave Anderson
77537c1273 Fix for the handling of 32-bit ELF xendump dumpfiles if the guest
was configured with more than 4GB of memory.  Without the patch, the
crash session may fail during initialization with the error message
"crash: vmlinux and <dumpfile> do not match!".
(dslutz@verizon.com)
2014-06-12 10:42:33 -04:00
Dave Anderson
625e9d3eb8 crash-7.0.6 -> crash-7.0.7 2014-06-09 14:48:49 -04:00
Dave Anderson
ee0286b3b9 Introduce support for 32-bit ARM kernels that are configured with
CONFIG_ARM_LPAE.  The patch implements the virtual-to-physical
address translation of 64-bit PTEs used by ARM LPAE kernels.
(sdu.liu@huawei.com, weijitao@huawei.com)
2014-06-05 15:17:09 -04:00
Dave Anderson
843ac0e0a6 Fix for the "extend" command when running with an x86_64 crash binary
that was built with "make target=ARM64" in order to analyze ARM64
dumpfiles on an x86_64 host.  Without the patch, if the extend
command is used with an extension module built in the same manner,
it fails with the message "extend: <module>.so: not an ELF format
object file".
(Jan.Karlsson@sonymobile.com)
2014-06-05 09:19:29 -04:00
Dave Anderson
d25e4c9e7f Fix for the "runq -g" command on Linux 3.15 and later kernels, where
the cgroup_name() function now utilizes kernfs_name().  Without the
patch, the command fails with the error message "runq: invalid
structure member offset: cgroup_dentry".
(anderson@redhat.com)
2014-06-03 11:09:04 -04:00
Dave Anderson
0480d56427 Fix to prevent a possible segmentation violation generated by the
"runq -g" command when run on a very active live system due to an
active task on a cpu exiting while the command is running.
(anderson@redhat.com)
2014-06-02 16:04:47 -04:00
Dave Anderson
6200290983 Fix a harmless logic error in the last Makefile update to create an
empty gdb-<version>/gdb-<version>.patch file if it doesn't exist.
(anderson@redhat.com)
2014-06-02 10:17:21 -04:00
Dave Anderson
618066f433 If the gdb-<version>.patch file has changed and a rebuild is being
done from within a previously-existing build tree, "patch -N" the
gdb sources, and start the rebuild from the gdb-<version> directory
instead of the gdb-<version>/gdb directory.
(anderson@redhat.com)
2014-05-30 15:16:12 -04:00
Dave Anderson
3967ec84ff Fix for the "DEBUG KERNEL:" display in the initial system banner
and by the "sys" command when using a System.map file with a
Linux 3.0 and later debug kernel.  Without the patch, the kernel
version is not displayed in parentheses following the debug kernel
name.
(anderson@redhat.com)
2014-05-28 15:05:13 -04:00
Dave Anderson
c9e72263ae If the kernel (live or dumpfile) has the "kpatch" module installed,
the tag "[KPATCH]" will be displayed next to the kernel name in the
initial system banner and by the "sys" command.
(anderson@redhat.com)
2014-05-28 14:19:01 -04:00
Dave Anderson
a855bd55e0 Fix for displaying enum values that are greater than 32-bits in
size.  Without the patch, the upper 32-bits are clipped off and
displayed as in integer-sized value.
(anderson@redhat.com)
2014-05-22 13:00:13 -04:00
Dave Anderson
2e6d26effb Fix failure to build from source when compiling the crash utility
with gcc-4.9.  Without the patch, the crash utility build generates
the following error:

  In file included from opncls.c:26:0:
  opncls.c: In function 'bfd_fopen':
  bfd.h:529:65: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
  #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
                                                                  ^
  opncls.c:263:5: note: in expansion of macro 'bfd_set_cacheable' bfd_set_cacheable (nbfd, TRUE);

  cc1: all warnings being treated as errors

(anderson@redhat.com, anatol.pomozov@gmail.com)
2014-05-21 14:18:15 -04:00
Dave Anderson
0ead5809b9 Fix for the "arguments-input-file" feature to protect against a
called command modifying an argument string.  For example, the
"struct" command modifies "-l struct_name.member" argument strings,
and so without the patch, all iterative calls after the first one
will fail.
(anderson@redhat.com)
2014-05-20 11:40:18 -04:00
Dave Anderson
81d7896441 Implemented a new "ps -S" option that displays a summary consisting
of the number of tasks in a task state.
(anderson@redhat.com)
2014-05-19 15:19:43 -04:00
Dave Anderson
6871d539a8 Implemented a new "kmem -h" option that displays the address of
each hugepage hstate array entry, its hugepage size, its free and
total counts, and name string.
(anderson@redhat.com)
2014-05-16 17:19:23 -04:00
Dave Anderson
847d639224 Implemented a new "runq -m" option that is a simliar, complementary
option to "runq -t", but which displays the amount of time that the
active task on each cpu has been running, expressed in a format
consisting of days, hours, minutes, seconds and milliseconds.
(anderson@redhat.com)
2014-05-09 17:23:12 -04:00
Dave Anderson
5d49210868 Implemented a new "ps -m" option that is a similar, complementary
option to "ps -l", but which translates the task timestamp value from
a decimal or hexadecimal nanoseconds value into a more human-readable
string consisting of the number of days, hours, minutes, seconds and
milliseconds that have elapsed since the task started executing on a
cpu.  More accurately described, it is the time difference between
the timestamp copied from the per-cpu runqueue clock when the task
last started executing compared to the most current value of the
per-cpu runqueue clock.
(anderson@redhat.com, bud.brown@redhat.com)

In addition, a new "ps -C <cpu-specifier>" option has been added
that can only be used with "ps -l" and "ps -m", which sorts the
global task list into per-cpu blocks; the cpu-specifier uses the
standard comma or dash separated list, expressed as "-C 1,3,5",
"-C 1-3", "-C 1,3,5-7,10", or "-Call" or "-Ca" for all cpus.
(anderson@redhat.com)
2014-05-08 16:01:22 -04:00
Dave Anderson
3d988346e7 Fix fprintf warning in previous patch when building with "make [wW]arn". 2014-05-05 15:50:41 -04:00
Dave Anderson
b13cab01c9 Implemented a new capability for the "ptov" command that takes a
per-cpu offset and cpu specification argument and translates it
into the kernel virtual addresses for the cpus specified.
(anderson@redhat.com)
2014-05-05 15:38:14 -04:00
Dave Anderson
06dfdb8d87 Fix for the "p", "irq", "struct", "union" and "*" commands if a
cpu specification contains an invalid cpu number.  Without the
patch, a segmentation violation may be generated.
(anderson@redhat.com)
2014-05-02 14:18:57 -04:00
Dave Anderson
e30a874378 Removed the BASELEVEL_REVISION string from defs.h, which serves no
purpose since the deprecation of the remote daemon, and typically
has been out of sync with the crash version.
(anderson@redhat.com)
2014-04-30 16:22:06 -04:00
Dave Anderson
698b34dc23 Fix for the built-in "g" alias, which apparently has not worked
correctly since crash-5.1.4.  Without the patch, if the "g" alias
and the first argument are separated by one space, then the first
first character of that argument would get stripped prior to being
passed to the embedded gdb module.
(anderson@redhat.com)
2014-04-30 15:43:10 -04:00
Dave Anderson
8e15958e1b Fix for the X86_64 "bt" command on Linux 3.3 and later kernels to
properly display exception frame register contents on NMI stacks.
Kernel commit 3f3c8b8c4b2a34776c3470142a7c8baafcda6eb0 added 12 more
values to the NMI exception stack to handle nested NMIs caused by
page faults or breakpoints that could occur while handling an NMI
exception.  The fix has two parts:

  1. Determine if this kernel has the nested NMI layout and set a
     machine-specific flag (NESTED_NMI) if it does.
  2. When backtracing an NMI stack, use the saved values instead of
     those found at the top of stack.

Kernel commit 28696f434fef0efa97534b59986ad33b9c4df7f8 changed
the stack layout again, swapping the location of the "saved" and
"copied" registers. This can be detected automatically, because the
"copied" registers contain either a copy of the "saved" registers,
or point to "repeat_nmi". So, if "repeat_nmi" is found as the return
address, assume that this is the old layout, and adjust the stack
pointer again.  Without the patch, incorrect register values are
displayed in the exception frame dump in the NMI stack backtrace.
(ptesarik@suse.cz)
2014-04-30 14:48:22 -04:00
Dave Anderson
566e8e8757 Fix for compiler warning on older gcc versions (4.1.2-42 and 4.4.6-4)
introduced by previous "bt -c" patch:

  kernel.c: In function ‘cmd_bt’:
  kernel.c:1981: warning: ‘cpus’ may be used uninitialized in this function
2014-04-29 08:47:36 -04:00
Dave Anderson
8bff022b52 Fix for Linux 3.11 and later ARM kernels, in which all non-panicking
cpus offline themselves during a kdump procedure.  This causes an
invalid cpu count determination during crash session initialization
from an ARM vmcore.  The patch utilizes the cpu count found in the
cpu_active_map if it is greater than the count in the cpu_online_map.
In addition, the maximum NR_CPUS value for the ARM architecture has
been raised from 4 to 32.
(sdu.liu@huawei.com)
2014-04-28 15:45:51 -04:00
Dave Anderson
a91e410866 Implemented a new "bt -c cpu(s)" option to display the backtrace
of the active task on one or more cpus.  The cpus must be specified
in a comma- and/or dash-separated list; for examples ""3", "1,8,9",
"1-23", or "1,8,9-14".  Similar to "bt -a", the option is only
applicable with crash dumps.
(atomlin@redhat.com)
2014-04-28 10:41:01 -04:00
Dave Anderson
3cb7e5a66f Linux 3.15 and later kernels configured with CONFIG_RANDOMIZE_BASE
can be now be readily identified because of new kernel symbols that
have been added.  For those kernels, the new "--kaslr=<offset>"
and/or "--kaslr=auto" options are not necessary for ELF or compressed
kdump vmcores, or for live systems that have /proc/kallsyms showing
the relocated symbol values.  A new KASLR initialization function
called kaslr_init() is now called by symtab_init() prior to the
initial symbol-sorting operation.  If kaslr_init() determines that
KASLR may be in effect, it will trigger a search for the relevant
vmlinux symbols during the sorting operation, which in turn will
cause the relocation value to be automatically calculated.
(anderson@redhat.com)
2014-04-23 11:11:39 -04:00
Dave Anderson
f3384d293b Export the static ELF and compressed kdump vmcoreinfo_read_string()
functions from netdump.c and kdump.c via a new read_vmcoreinfo()
method in the global program_context structure.  The function
get_log_from_vmcoreinfo() will access vmcoreinfo data via the
new pointer instead of requiring its callers to pass pointers to
their dumpfile-specific function.
(anderson@redhat.com)
2014-04-17 16:14:32 -04:00
Dave Anderson
2c1cdb80e1 crash-7.0.5 -> crash-7.0.6 2014-04-15 10:30:06 -04:00
Dave Anderson
0249e96b10 Fix for ARM64 /proc/kcore support. Without the patch, the crash
session fails with the warning message "WARNING: cannot read
linux_banner string" followed by the fatal error message "crash:
vmlinux and <dumpfile name> do not match!".  At this point in
time, the kernel requires a patch to the ARM64 kern_addr_valid()
function to properly allow memory to be read from the kernel logical
memory map region.
(anderson@redhat.com)
2014-04-14 15:52:29 -04:00
Dave Anderson
40da7b939e Fix for the ARM64 "vtop <address>" command on kernels configured
with 64K pages if the address argument is located in the kernel
logical memory map region, which uses 512MB hugepage mappings.
Without the patch, the verbose page table walk mistakenly continues
to the PTE level.
(anderson@redhat.com)
2014-04-14 15:48:58 -04:00
Dave Anderson
7010f10be1 Fix for a segmentation violation generated by the "crash -g vmlinux"
command on ARM64.
(anderson@redhat.com)
2014-04-11 14:55:22 -04:00
Dave Anderson
4ee161c475 Increment maximum ARM64 physical address from 40 to 48 bits to match
upstream kernel commit 87366d8cf7b3f6dc34633938aa8766e5a390ce33.
(anderson@redhat.com)
2014-04-08 15:50:45 -04:00
Dave Anderson
bcad624fe2 Fix for the "vm -p" option on ARM64 so that file-backed pages are
properly translated to the filename and offset.  Without the patch,
file-backed pages are erroneously shown as being backed on a swap
device.
(anderson@redhat.com)
2014-04-08 13:10:02 -04:00
Dave Anderson
afcb5b189c Increase the ARM64 PTRS_PER_PGD_L2_64K from 1024 to 9182 to account
for the Linux 3.13 increase of the ARM64 virtual address space size
from 39 to 42 bits when 64K pages are configured.  Without the patch,
the warning message "WARNING: cannot access vmalloc'd module memory"
is displayed during session initialization.
(anderson@redhat.com)
2014-04-07 16:45:32 -04:00
Dave Anderson
81ea0bc877 Implemented support for the ARM64 "bt -f" and "bt -F[F]" options.
(anderson@redhat.com)
2014-04-04 16:09:40 -04:00
Dave Anderson
3d23f36a56 Added support for the ARM64 architecture in the extensions/snap.c
extension module.  Also fixed the progress percentage display to
correct for systems which have non-zero starting physical addresses.
(anderson@redhat.com)
2014-04-04 15:22:43 -04:00
Dave Anderson
9eb2a4a616 Fix for the ARM64 virtual-to-physical translation of vmemmap page
structure addresses for kernels configured with 4K pages.  Without
the patch, any command that required the contents of a page structure
would fail with a readmem error.
(cldu@marvell.com, anderson@redhat.com)
2014-04-04 11:30:13 -04:00
Dave Anderson
b559631d73 Fix false-alarm warning from older compilers resulting from previous
"bt -l" update:

  x86_64.c: In function ‘x86_64_exception_frame’:
  x86_64.c:3814: warning: ‘sp’ may be used uninitialized in this function

(anderson@redhat.com)
2014-04-03 14:58:19 -04:00
Dave Anderson
409256c9d8 Update for the X86_64 "bt -l" option such that it also displays the
available file and line number information for functions indicated as
the "exception RIP" in kernel exception frames.  The line number
information will follow the exception frame register dump.
(anderson@redhat.com)
2014-04-03 14:42:32 -04:00
Dave Anderson
d6ce9d2bba Implemented support for the ARM64 "bt -l" option.
(anderson@redhat.com)
2014-04-03 10:39:54 -04:00
Dave Anderson
12e9faa3cd Implemented support for the ARM64 "bt -e" option.
(anderson@redhat.com)
2014-04-03 10:23:10 -04:00
Dave Anderson
13f25a3e58 Cleaned up the exception frame displays of 64-bit in-kernel and both
32-bit and 64-bit user-mode exceptions.
(anderson@redhat.com)
2014-04-02 15:37:17 -04:00
Dave Anderson
7462950108 Initial working implementation of the basic ARM64 "bt" command, with
several command options still under development.  In-kernel exception
frames are only dumped if the exception handler function is contained
within the symbol boundaries from "__exception_text_start" to
"__exception_text_end"; when ARM64 kdump is eventually implemented,
further exception-related work will be resumed.
(anderson@redhat.com)
2014-04-01 16:31:26 -04:00