Commit Graph

595 Commits

Author SHA1 Message Date
Dave Anderson
6757991ec4 Fix for a build failure. Without the patch, if the build is done by
a user whose username cannot be determined from the user ID number,
the build fails immediately with a segmentation fault.
(sargun@sargun.me, anderson@redhat.com)
2017-06-28 09:42:58 -04:00
Dave Anderson
307e7f35f5 First phase of future support for x86_64 5-level page tables. New
sets of virtual memory offsets have been #define'd and helper macros
and placeholder functions for the p4d page tables have been added.
The only functional changes with this patchset are dynamically-set
PGDIR_SHIFT and PHYSICAL_MASK_SHIFT values that are based upon the
kernel configuration.
(anderson@redhat.com)
2017-06-23 12:08:23 -04:00
Dave Anderson
08d52677bf Fix to prevent the "tree -t radix" option from failing when it
encounters duplicate entries in a radix_tree_node[slots] array.
Without the patch, if a duplicate slot entry is found, the command
fails with the message "tree: duplicate tree entry: radix_tree_node:
<node address> slots[<index>]: <entry>\n".  (The error can
be prevented if the command is preceded by "set hash off".)  However,
certain radix trees contain duplicate entries by design, such as the
"pgmap_radix" radix tree, in which a radix_tree_node may contain
multiple instances of the same page_map structure.  With the patch,
checks will only be made for duplicate radix_tree_node structures.
(anderson@redhat.com)
2017-06-13 14:20:33 -04:00
Dave Anderson
4d517ad28a Enhancement to the error reporting mechanism for the "kmem -[sS]"
options.  When a fatal error is encountered while gathering basic
CONFIG_SLUB statistics, it is possible that the slab cache name
is not displayed in the error message, and the line containing
the slab cache name, address, etc., is not displayed at all.  With
this patch, an extra error message indicating "kmem: <cache-name>:
cannot gather relevant slab data" will be displayed under the
fatal error message; and under that, the CACHE address, cache NAME,
OBJSIZE, and SSIZE columns will be displayed, but with "?" under
the ALLOCATED, TOTAL, and SLABS columns.
(anderson@redhat.com)
2017-06-08 15:24:53 -04:00
Dave Anderson
183a811327 Fix for the "dis" command to detect duplicate symbols in the case
of a "symbol+offset" argument where the duplicates are not contiguous
in the symbol list.  Without the patch, the first of multiple symbol
instances is used in the address evaluation.  With the patch, the
command will fail with the error message "dis: <symbol+offset>:
duplicate text symbols found:", followed by a list of the duplicate
symbols, and their file and line numbers if available.
(anderson@redhat.com)
2017-06-02 15:27:25 -04:00
Dave Anderson
5c52842a58 Crash 7.1.5 commit c341345659 (xen: Add
support for dom0 with Linux kernel 3.19 and newer) from Daniel Kiper
implemented support for Xen dom0 vmcores after Linux 3.19 kernel
commit 054954eb051f35e74b75a566a96fe756015352c8 (xen: switch to
linear virtual mapped sparse p2m list).  This patch can be deemed
subsequent to Daniel's patch, and implements support Xen PV domU
dumpfiles for Linux 3.19 and later kernels.
(honglei.wang@oracle com)
2017-05-24 11:50:35 -04:00
Dave Anderson
8fef88b2b5 Update Red Hat copyright to 2017 on initial banner.
(anderson@redhat.com)
2017-05-15 12:47:37 -04:00
Dave Anderson
c30fbd7a43 Fix for the validity check of S390X virtual addresses for 5-level
page tables where user space memory is mapped above 8 Petabytes.
Without the patch, "rd -u" fails and indicates "invalid user virtual
address", and "vtop -u" indicates that the address is "(not mapped)".
(zaslonko@linux.vnet.ibm.com)
2017-05-11 15:52:49 -04:00
Dave Anderson
3ef519107a Fix for a 32-bit MIPS compilation error if glibc-2.25 or later has
been installed on the host build machine.  Without the patch, the
build fails with the error message "mips-linux-nat.c:157:1: error:
conflicting types for 'ps_get_thread_area'".
(dengke.du@windriver.com)
2017-05-04 10:24:50 -04:00
Dave Anderson
ad3b84766b Fix for the PPC64 "pte" command. Without the patch, if the target
PTE references a present page, the physical address is incorrect.
(anderson@redhat.com)
2017-05-03 10:29:37 -04:00
Dave Anderson
a4a538caca Fix for Linux 4.10 and later kdump dumpfiles, or kernels that have
backported commit 401721ecd1dcb0a428aa5d6832ee05ffbdbffbbe, titled
"kexec: export the value of phys_base instead of symbol address".
Without the patch, if the x86_64 "phys_base" value in the VMCOREINFO
note is a negative negative decimal number, the crash session fails
during session intialization with a "page excluded" or "seek error"
when reading "page_offset_base".
(anderson@redhat.com)
2017-05-02 16:51:53 -04:00
Dave Anderson
14cbcd58c1 Fix for the "mach -m" command in Linux 4.9 and later kernels that
contain commit 475339684ef19e46f4702e2d185a869a5c454688, titled
"x86/e820: Prepare e280 code for switch to dynamic storage", in
which the "e820" symbol was changed from a static e820map structure
to a pointer to an e820map structure.  Without the patch, the
command either displays just the header, or the header with several
nonsensical entries.
(anderson@redhat.com)
2017-05-02 15:45:23 -04:00
Dave Anderson
c85a70ba75 The native gdb "disassemble" command fails if the kernel has been
compiled with CONFIG_RANDOMIZE_BASE because the embedded gdb module
still operates under the assumption that the (non-relocated) text
locations in the vmlinux file are correct.  The error message that
is issued is somewhat confusing, indicating "No function contains
specified address".  This patch simply clarifies the error message
to indicate "crash: the gdb "disassemble" command is prohibited
because the kernel text was relocated by KASLR; use the crash "dis"
command instead."
(anderson@redhat.com)
2017-05-01 15:40:21 -04:00
Dave Anderson
8717902685 Fix for the "snap.so" extension module to pass the KASLR relocation
offset value in the dumpfile header for kernels that are compiled
with CONFIG_RANDOMIZE_BASE.  Without the patch, it is necessary to
use the "--kaslr=<offset>" command line option, or the session
fails with the message "WARNING: cannot read linux_banner string",
followed by "crash: vmlinux and vmcore do not match!".
(anderson@redhat.com)
2017-05-01 15:14:36 -04:00
Dave Anderson
1e4a3c0953 Mark start of 7.2.0 development phase with version 7.1.9++ 2017-05-01 15:13:06 -04:00
Dave Anderson
4456d154bd crash-7.1.8 -> crash-7.1.9 2017-04-20 14:54:33 -04:00
Dave Anderson
c54bcc5433 Fix for the ARM64 "bt" command. Without the patch, the backtrace of
a non-panicking active task generates a segmentation violation when
analyzing Android 4.4-based dumpfiles.
(zhizhouzhang@asrmicro.com)
2017-04-19 13:54:28 -04:00
Dave Anderson
78330fc5fb Fix for the extensions/trace.c extension module when running on
the ppc64 architecture.  Without the patch, the trace.so extension
module fails to load, indicating "extend: invalid text address:
ring_buffer_read".  On the ppc64 architecture, the text symbol
is ".ring_buffer_read".
(anderson@redhat.com)
2017-04-15 13:54:20 -04:00
Dave Anderson
58fff92459 Fix for the extensions/trace.c extension module to account for
Linux 4.7 kernel commit 9b94a8fba501f38368aef6ac1b30e7335252a220,
which changed the ring_buffer_per_cpu.nr_pages member from an int
to a long.  Without the patch, the trace.so extension module fails
to load on big-endian machines, indicating "extend: Num of pages
is less than 0".
(feij.fnst@cn.fujitsu.com)
2017-04-15 13:45:13 -04:00
Dave Anderson
270d8b40a4 Fix for the "set scope" option if the kernel was configured with
CONFIG_RANDOMIZE_BASE.  Without the patch, the command fails with
the message "set: gdb cannot find text block for address: <symbol>".
This also affects extension modules that call gdb_set_crash_scope()
when running with KASLR kernels.
(anderson@redhat.com)
2017-04-10 14:01:41 -04:00
Dave Anderson
3bb49a5a95 Fix for the "dis" command to detect duplicate symbols in the case
of a "symbol+offset" argument where the duplicates are contiguous
in the symbol list.  In addition, reject "symbol+offset" arguments
if the resultant address goes beyond the end of the function.
(anderson@redhat.com)
2017-04-07 11:51:29 -04:00
Dave Anderson
eb1057eff0 Fix for the determination of the x86_64 "phys_base" value when it is
not passed in the VMCOREINFO data of ELF vmcores.  Without the patch,
it is possible that the base address of the vmalloc region is unknown
and initialized to an incorrect default address during the very early
stages of initialization, which causes the parsing of the PT_LOAD
segments for the START_KERNEL_map region to fail.
(anderson@redhat.com)
2017-04-06 13:13:04 -04:00
Dave Anderson
9578af8191 Provide basic Huge Page usage as part of "kmem -i" output, showing
the total amount of memory allocated for huge pages, and the amount
of the total that is free.
(atomlin@redhat.com)
2017-04-06 11:34:35 -04:00
Dave Anderson
a5ebe53b6b Fix for the "list -[hH]" options if a list_head.next pointer is
encountered that contains an invalid NULL pointer.  Without the
patch, the "list -[hH]" options would complete/continue as if the
NULL were a legitimate end-of-list indicator, and no error would be
reported.
(rabin.vincent@axis.com)
2017-03-31 13:40:02 -04:00
Dave Anderson
b204a20c66 Fix for a compilation error if glibc-2.25 or later has been installed
on the host build machine.  Without the patch, the build fails with
the error message "amd64-linux-nat.c:496:1: error: conflicting types
for 'ps_get_thread_area'".
(anderson@redhat.com)
2017-03-28 15:44:40 -04:00
Dave Anderson
ba176a49e1 Optimization of the "kmem -f <address>" and "kmem <address>" options
to signficantly reduce the amount of time to complete the buddy
allocator free-list scan for the target address.  On very large
memory systems, the patch may reduce the time spent by several orders
of magnitude.
(anderson@redhat.com)
2017-03-24 11:09:59 -04:00
Dave Anderson
0cb149ba43 Enhancement for the determination of the ARM64 "kimage_voffset" value
in Linux 4.6 and later kernels if an ELF format dumpfile does not
contain its value in a VMCOREINFO note, or when running against
live systems using /dev/mem, /proc/kcore, or an older version of
/dev/crash.
(liyueyi@live.com)
2017-03-20 11:20:59 -04:00
Dave Anderson
7c28f077d0 Fix for the "kmem <address>" option and the "search" command
in x86_64 kernels that contain, or have backports of, kernel commit
7c1da8d0d046174a4188b5729d7579abf3d29427, titled "crypto: sha - SHA1
transform x86_64 AVX2", which introduced an "_end" text symbol.
Without the patch, if a base kernel symbol address that is larger
than the "_end" text symbol is passed to "kmem <address>", its
symbol/filename information will not be displayed.  Also, when the
"search" command scans the __START_KERNEL_map region that contains
kernel text and static data, the search will be truncated to stop at
the "_end" text symbol address.
(anderson@redhat.com)
2017-03-17 12:14:20 -04:00
Dave Anderson
f4623a2f14 Implemented a new "log -a" option that dumps the audit logs remaining
in kernel audit buffers that have not been copied out to the
user-space audit daemon.
(d.hatayama@jp.fujitsu.com)
2017-03-15 11:53:35 -04:00
Dave Anderson
ed60e97e31 Linux 4.10 commit 401721ecd1dcb0a428aa5d6832ee05ffbdbffbbe finally
exports the x86_64 "phys_base" value in the VMCOREINFO note, so
utilize it whenever it exists.
(anderson@redhat.com)
2017-03-09 16:41:11 -05:00
Dave Anderson
ce0648294b Fix for the "mod -[sS]" option to prevent the erroneous reassignment
of one or more symbol values of a kernel module.  Without the patch,
when loading a kernel module, a message may indicate "mod: <module>:
last symbol: <symbol> is not _MODULE_END_<module>?" may be displayed,
and one or more symbols may be reassigned an incorrect symbol value.
If none of the erroneous symbol value reassignments are beyond the
end of the module's address space, then there will be no message.
(anderson@redhat.com)
2017-03-07 15:14:32 -05:00
Dave Anderson
a78535cf44 Fix for the PPC64 "mach -o" option to update the OPAL console buffer
size from 256K to 1MB, based upon the latest skiboot firmware source.
(ankit@linux.vnet.ibm.com)
2017-03-06 09:20:01 -05: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
9221942f40 Mark start of 7.1.9 development with version 7.1.8++ 2017-03-03 15:08:30 -05:00
Dave Anderson
a80c0b1dfd crash-7.1.7 -> crash-7.1.8 2017-02-22 14:26:24 -05:00
Dave Anderson
c27dabf7f9 Removed -Werror from the bfd and opcode library builds.
(anderson@redhat.com)
2017-02-21 11:17:13 -05:00
Dave Anderson
e4fbec3d41 Allow the "--kaslr=<offset>" and/or "--kaslr=auto" command line
options to be used with the 32-bit X86 architecture.
(anderson@redhat.com)
2017-02-17 15:01:06 -05:00
Dave Anderson
fc9c517acd Fix for 32-bit X86 kernels to determine the active task in a dumpfile
in the situation where the task was running on its soft IRQ stack,
took a hard IRQ, and then the system crashed while it was running on
its hard IRQ stack.
(hirofumi@mail.parknet.co.jp)
2017-02-17 10:39:24 -05:00
Dave Anderson
e71102d356 Additional fix for Linux 3.15 and later 32-bit X86 kernels containing
kernel commit 198d208df4371734ac4728f69cb585c284d20a15, titled "x86:
Keep thread_info on thread stack in x86_32".  The patch fixes the
stack transition symbol from "handle_IRQ" to "handle_irq" for usage
by the "bt" command.
(anderson@redhat.com)
2017-02-16 09:37:51 -05:00
Dave Anderson
5959759058 Fix for Linux 3.15 and later 32-bit X86 kernels containing kernel
commit 198d208df4371734ac4728f69cb585c284d20a15, titled "x86: Keep
thread_info on thread stack in x86_32".  Without the patch, incorrect
addresses of each per-cpu hardirq_stack and softirq_stack were saved
for usage by the "bt" command.
(hirofumi@mail.parknet.co.jp, anderson@redhat.com)
2017-02-15 16:29:53 -05:00
Dave Anderson
345da6dc90 Remove two one-time warning messages that are displayed when running
the "bt" command on Linux 4.2 and later 32-bit X86 kernels.  Without
the patch, the first "bt" command that is executed will be preceded
by "bt: WARNING: "system_call" symbol does not exist", followed by
"bt: WARNING: neither "ret_from_sys_call" nor "syscall_badsys"
symbols exist".
(anderson@redhat.com)
2017-02-15 15:39:13 -05:00
Dave Anderson
8323490fd9 Another fix for a similar "bt: cannot resolve stack trace" warning
on a 32-bit X86 idle/swapper task, but when running on cpu 0.
(anderson@redhat.com)
2017-02-15 15:04:07 -05:00
Dave Anderson
63dd57685e Fix for an invalid "bt" warning on a 32-bit X86 idle (swapper) task.
Without the patch, the backtrace displays the "cannot resolve stack
trace" warning, dumps the backtrace, and then the text symbols:

  crash> bt
  PID: 0      TASK: f0962180  CPU: 6   COMMAND: "swapper/6"
  bt: cannot resolve stack trace:
   #0 [f095ff1c] __schedule at c0b6ef8d
   #1 [f095ff58] schedule at c0b6f4a9
   #2 [f095ff64] schedule_preempt_disabled at c0b6f728
   #3 [f095ff6c] cpu_startup_entry at c04b0310
   #4 [f095ff94] start_secondary at c04468c0
  bt: text symbols on stack:
      [f095ff1c] __schedule at c0b6ef8d
      [f095ff58] schedule at c0b6f4ae
      [f095ff64] schedule_preempt_disabled at c0b6f72d
      [f095ff6c] cpu_startup_entry at c04b0315
      [f095ff94] start_secondary at c04468c5
  crash>

The backtrace shown is actually correct.
(anderson@redhat.com)
2017-02-14 16:23:56 -05:00
Dave Anderson
ec1a9b967d Fix for a "[-Wmisleading-indentation]" compiler warning and the
associated bug that is generated by lkcd_x86_trace.c when building
32-bit X86 with "make warn" with gcc-6.3.1.
(anderson@redhat.com)
2017-02-14 15:23:01 -05:00
Dave Anderson
69b577e423 Fix for the "bt" command on Linux 4.9 and later 32-bit X86 kernels
containing kernel commit 0100301bfdf56a2a370c7157b5ab0fbf9313e1cd,
subject "sched/x86: Rewrite the switch_to() code".  Without the
patch, backtraces for inactive (sleeping) tasks fail with the message
"bt: invalid structure member offset: task_struct_thread_eip".
(anderson@redhat.com)
2017-02-14 14:25:37 -05:00
Dave Anderson
1a4af84dbd Introduction of a new PPC64-only "mach -o" option that dumps the OPAL
"Open Power Abstraction Layer" console buffer.
(ankit@linux.vnet.ibm.com)
2017-02-14 10:08:33 -05:00
Dave Anderson
222e784fb2 Fix for 32-bit X86 kernels configured with CONFIG_RANDOMIZE_BASE.
Without the patch, an invalid kernel PAGE_OFFSET value is calculated
and as a result the session fails during session initialization just
after the patching of the gdb minimal_symbol values message, showing
the warning message "WARNING: cannot read linux_banner string",
followed by "crash: /vmlinux and /dev/crash do not match!".  This
patch also adds a new "--machdep page_offset=<value>" option that
can be used if the CONFIG_PAGE_OFFSET value is not the default
address of 0xc0000000.
(anderson@redhat.com)
2017-02-10 15:07:58 -05:00
Dave Anderson
fe63125327 Fix for the "CURRENT" value displayed by the "timer -r" command.
Without the patch, if the target machine has been up for a long
enough time, an arithmetic overflow will occur and the time value
displayed will be incorrect.
(shane.seymour@hpe.com)
2017-02-07 15:06:59 -05:00
Dave Anderson
61f4e172fd Clarification in the display of CONFIG_SLUB object addresses that are displayed
by the "kmem" command when SLAB_RED_ZONE has been enabled in Linux 4.6 and later
kernels.  By default, CONFIG_SLUB object addresses that are displayed by the
"kmem" command will point to the SLAB_RED_ZONE padding inserted at the
beginning of the object.  As an alternative, a new "redzone" environment
variable has been addedd that can be toggled on or off.  If "set redzone off"
is entered, the object addresses will point to the address that gets returned
to the allocator.
(hirofumi@mail.parknet.co.jp, anderson@redhat.com)
2017-02-07 12:08:55 -05:00
Dave Anderson
9c49844316 Fix for the "trace.c" extension module. The kernel buffer referenced
by "max_tr_ring_buffer" is not available in all configurations of the
kernel so the unitialized max_tr_ring_buffer variable should not be
used.  A similar check existed previously before the recent rework of
the trace extension module to support multiple buffers.
(rabinv@axix.com)
2017-02-07 10:42:46 -05:00