Commit Graph

713 Commits

Author SHA1 Message Date
Dave Anderson
24f4801f8c crash-7.2.7 -> crash-7.2.8 2020-01-30 14:01:55 -05:00
Dave Anderson
6c1c8ac6b3 Fix for a gcc-10 compilation error. Without the patch, the build of
the crash library fails with a stream of error messages indicating
"multiple definition of 'diskdump_flags'"
(anderson@redhat.com)
2020-01-29 11:10:26 -05:00
Dave Anderson
c6b1971549 Rework the previous patch for support of S390X standalone dumpfiles
and LKCD dumpfiles that were taken from S390X KASLR kernels to avoid
calling an s390x-specific function from generic code.
(zaslonko@linux.ibm.com)
2020-01-17 13:34:53 -05:00
Dave Anderson
6e033fe099 Fix for support of S390X standalone dumpfiles and LKCD dumpfiles that
were taken from S390X KASLR kernels.
(zaslonko@linux.ibm.com)
2020-01-16 11:46:10 -05:00
Dave Anderson
7c2d41e1b2 Fix for support of ELF format kdump vmcores from S390X KASLR kernels.
Without the patch, the crash session fails during initialization with
the error message "crash: vmlinux and vmcore do not match!".
(anderson@redhat.com)
2020-01-08 14:28:39 -05:00
Dave Anderson
08b0183464 Fix for ARM64 when running against Linux 5.5-rc1 and later kernels
that contain commit b6e43c0e3129ffe87e65c85f20fcbdf0eb86fba0, titled
"arm64: remove __exception annotations".  Without the patch, the
ARM64 crash session fails during initialization with the error
message "crash: cannot resolve __exception_text_start".
(anderson@redhat.com)
2020-01-07 11:07:12 -05:00
Dave Anderson
0ab7ac3bea Update copyright to 2020 in crash version output. 2020-01-07 09:34:38 -05:00
Dave Anderson
5e975dd8c8 When determining the ARM64 kernel's "vabits_actual" value by reading
the new TCR_EL1.T1SZ vmcoreinfo entry, display its value during
session initialization only when invoking crash with "-d1" or larger
-d debug value.
(anderson@redhat.com)
2019-12-24 08:43:52 -05:00
Dave Anderson
af7f78dc50 Fix for the "log -a" option. The kernel's sk_buff.len field is a
32-bit unsigned int, but crash was reading its 32-bit value into a
64-bit unsigned long stack variable.  All extra bits that pre-existed
in the upper 32-bits of the stack variable were passed along as part
of a buffer size request; if the upper 32-bit bits were non-zero,
then the command would fail with a dump of the internal buffer
allocation stats followed by the message "log: cannot allocate any
more memory!".
(anderson@redhat.com)
2019-12-20 14:33:11 -05:00
Dave Anderson
63df9c067d When accessing the 32-bit ARM kernel's "crash_notes" array, continue
to read the per-cpu NT_PRSTATUS note contents if an invalid note is
encountered.  Without the patch, if an invalid note is found, all
other notes were ignored, and subsequent "bt" attempts on the active
tasks would fail.
(chenqiwu@xiaomi.com, anderson@redhat.com)
2019-12-16 11:28:46 -05:00
Dave Anderson
c408862daf When accessing the ARM64 kernel's "crash_notes" array, continue to
read the per-cpu NT_PRSTATUS note contents if an invalid note is
encountered.  Without the patch, if an invalid note is found, all
other notes were ignored, and subsequent "bt" attempts on the active
tasks would fail.
(chenqiwu@xiaomi.com, anderson@redhat.com)
2019-12-15 12:24:13 -05:00
Dave Anderson
4e4e585973 Fix for newer Xen hypervisors, which fail during initialization with
the error message "crash: cannot resolve init_tss".  This is caused
by a change in the Xen hypervisor with commit 78884406256, from
4.12.0-rc5-763-g7888440625.  In that patch the tss_struct structure
was renamed to tss64 and the tss_page structure was introduced,
which contains a single tss64.  Now tss information is accessible
via the symbol "per_cpu__tss_page".
(dietmar.hahn@ts.fujitsu.com)
2019-12-12 12:08:11 -05:00
Dave Anderson
da4a22029a Fix for the "dis -s" option when running against kernels that have
been configured with CONFIG_RANDOMIZE_BASE=y (KASLR).  Without the
patch, the command option indicates that the FILE and LINE numbers
are "(unknown)", and that "source code is not available".
(anderson@redhat.com)
2019-12-03 11:41:19 -05:00
Dave Anderson
e13b51a596 Fix for segmentation violation if the gdb_readmem_callback() function
gets called from other than a crash command, such as from an epython
command from the mypkdump.so extension module.
(anderson@redhat.com)
2019-12-01 14:18:41 -05:00
Dave Anderson
b265bad21c Fix for a crash-7.2.7 regression that determined the value of the
ARM64 kernel SECTION_SIZE_BITS by reading the in-kernel configuration
data if there is no VMCOREINFO data available.  In that case, without
the patch, a double-free exception may occur.
(anderson@redhat.com)
2019-12-01 14:06:59 -05:00
Dave Anderson
6664cb3f4e If an S390X kernel crashes before vmcoreinfo initialization, there is
no way to extract the KASLR offset for such early dumps.  In a new
S390X kernel patch, the KASLR offset will be stored in the lowcore
memory during early boot and then overwritten after vmcoreinfo is
initialized.  This patch allows crash to identify the KASLR offset
that is stored in the lowcore memory.
(zaslonko@linux.ibm.com)
2019-11-26 12:18:02 -05:00
Dave Anderson
5171ef5a7e Similar to ARM64, the X86_64, PPC64 and S390x architectures will use
the exported value of MAX_PHYSMEM_BITS from the vmcoreinfo data as
the preferred method if it is available.
(anderson@redhat.com)
2019-11-22 13:39:40 -05:00
Dave Anderson
b259940b22 Fix two typos in the examples section of the "help bt" display, which
mistakenly show "bf -f" and "bf -FF" instead of "bt -f" and "bt -FF".
(austindh.kim@gmail.com)
2019-11-21 09:27:52 -05:00
Dave Anderson
f1c71de4ef Fix to determine the ARM64 kernel's "vabits_actual" value from the
ELF header of a dumpfile created with the "snap.so" extension module.
(anderson@redhat.com)
2019-11-20 11:59:00 -05:00
Dave Anderson
bfd9a651f9 Determine the ARM64 kernel's "vabits_actual" value by reading the
new TCR_EL1.T1SZ vmcoreinfo entry.
(bhsharma@redhat.com)
2019-11-19 10:19:55 -05:00
Dave Anderson
babd7ae62d Fix for the determination of the ARM64 page size on Linux 4.4 and
earlier kernels that do not have vmcoreinfo data.  Without the patch,
the crash session fails during initialization with the error message
"crash: "cannot determine page size".
(chenqiwu@xiaomi.com)
2019-11-15 09:55:34 -05:00
Dave Anderson
5cbb2fd8c2 Add support for handling openSUSE vmlinux files which will be shipped
in .xz compressed format.  Without the patch, only gzip and bzip2
formats are supported.
(jirislaby@gmail.com)
2019-11-13 11:29:14 -05:00
Dave Anderson
b5c2359f9f Fix for a "warning: large integer implicitly truncated to unsigned
type [-Woverflow]" compiler message generated on 32-bit architectures
as a result of the "Additional fix for the kmem -n option" patch
above.
(anderson@redhat.com)
2019-11-08 14:32:53 -05:00
Dave Anderson
c0bbd8fae4 Add support for extended numbering support in ELF dumpfiles to handle
more than PN_XNUM (0xffff) program headers.  If the real number of
program header table entries is equal to or greater than PN_XNUM, the
e_phnum field of the ELF header is set to PN_XNUM, and the actual
number is set in the sh_info field of the section header at index 0.
(k-hagio@ab.jp.nec.com)
2019-11-08 14:00:56 -05:00
Dave Anderson
6a466f8afb Adjust a crash-7.1.8 patch for support of /proc/kcore as the live
memory source in Linux 4.8 and later x86_64 kernels configured with
CONFIG_RANDOMIZE_BASE, which randomizes the unity-mapping PAGE_OFFSET
value.  Since the problem only arises before the determination of the
randomized PAGE_OFFSET value, restrict the patch such that it only
takes effect during session initialization.
(anderson@redhat.com)
2019-11-04 11:56:28 -05:00
Dave Anderson
869f3b24fc In the unlikely event that the panic task in a dumpfile cannot be
determined by the normal means, scan the kernel log buffer for panic
keywords, and if found, generate the panic task from the CPU number
that is specified following the panic message.
(chenqiwu@xiaomi.com)
2019-10-22 16:42:57 -04:00
Dave Anderson
1d2bc0c657 Additional fix for the "kmem -n" option on Linux-5.4-rc1 and later
kernels that contain commit b6c88d3b9d38f9448e0fcf44847a075ea81d5ca2,
titled "drivers/base/memory.c: don't store end_section_nr in memory
blocks".  The initial fix only addressed the x86_64 architecture;
this incremental patch addresses the other architectures.
(msys.mizuma@gmail.com)
2019-10-21 11:46:01 -04:00
Dave Anderson
1f9e0ac5d0 Fix for Linux 4.19.5 and later 4.19-based x86_64 kernels which
are NOT configured with CONFIG_RANDOMIZE_BASE and have backported
kernel commit d52888aa2753e3063a9d3a0c9f72f94aa9809c15, titled
"x86/mm: Move LDT remap out of KASLR region on 5-level paging",
which modified the 4-level and 5-level paging PAGE_OFFSET values.
Without this patch, the crash session fails during initialization
with the error message "crash: seek error: kernel virtual address:
<address> type: "tss_struct ist array".
(anderson@redhat.com)
2019-10-19 16:43:16 -04:00
Dave Anderson
9937878cce Fix for the "kmem -n" option on Linux-5.4-rc1 and later kernels that
contain commit b6c88d3b9d38f9448e0fcf44847a075ea81d5ca2, titled
"drivers/base/memory.c: don't store end_section_nr in memory blocks".
Without the patch, the command option fails with the error message
"kmem: invalid structure member offset: memory_block_end_section_nr".
(msys.mizuma@gmail.com)
2019-10-17 12:00:23 -04:00
Dave Anderson
e13fe8ba5a Fix for a "[-Wstringop-truncation]" compiler warning emitted when
symbols.c is built in a Fedora Rawhide environment with gcc-9.0.1
or later.
(anderson@redhat.com)
2019-10-15 16:29:30 -04:00
Dave Anderson
c1ac656508 Fix for the "timer -r" option on Linux 5.4-rc1 and later kernels
that contain commit 511885d7061eda3eb1faf3f57dcc936ff75863f1, titled
"lib/timerqueue: Rely on rbtree semantics for next timer".  Without
the patch, the option fails with the following error "timer: invalid
structure member offset: timerqueue_head_next".
(k-hagio@ab.jp.nec.com)
2019-10-15 11:21:55 -04:00
Dave Anderson
82ce13bceb Fix for Linux 5.4-rc1 and later kernels that contain commit/merge
e0703556644a531e50b5dc61b9f6ea83af5f6604, titled "Merge tag 'modules-
for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
which introduces symbol namespaces.  Without the patch, and depending
upon the architecture:
 (1) the kernel module symbol list will contain garbage entries
 (2) the session fails during session initialization with a dump of
     the internal buffer allocation stats followed by the message
     "crash: cannot allocate any more memory!"
 (3) the session fails during session initialization with a
     segmentation violation.
(anderson@redhat.com)
2019-10-11 11:14:28 -04:00
Dave Anderson
105a3e1316 Fix for Linux 5.4-rc1 and later kernels that contain commit
688fcbfc06e4fdfbb7e1d5a942a1460fe6379d2d, titled "mm/vmalloc:
modify struct vmap_area to reduce its size".  Without the
patch "kmem -v" will display nothing; other architectures
that utilize the vmap_area_list to determine the base of
mapped/vmalloc address space will fail.
(anderson@redhat.com)
2019-10-10 14:07:22 -04:00
Dave Anderson
da9fb637e3 Mark start of 7.2.8 development phase with version 7.2.7++ 2019-10-10 11:40:05 -04:00
Dave Anderson
5b0e3777cc crash-7.2.6 -> crash-7.2.7 2019-09-20 10:39:16 -04:00
Dave Anderson
a566cb75cc Determine the ARM64 SECTION_SIZE_BITS value using the following
order of precedence:
 (1) from the VMCOREINFO data if it exists
 (2) from the in-kernel configuration data if it exists
 (3) the default value
(chenqiwu@xiaomi.com)
2019-09-19 15:29:27 -04:00
Dave Anderson
70e794c10f Fix to prevent a potential segmentation violation when accessing
the compressed configuration data contained in kernels that are
configured with CONFIG_IKCONFIG.
(chenqiwu@xiaomi.com)
2019-09-18 11:17:12 -04:00
Dave Anderson
5d43b10b6e Fix for the internal caching of the kernel's mem_map array of page
structures.  Without the patch, in rare circumstances, commands such
as "kmem -p" may erroneously receive zero-filled page structures.
(k-hagio@ab.jp.nec.com)
2019-09-17 16:26:48 -04:00
Dave Anderson
a788b15fc3 Create the specified installation directory if it does not exist.
Without the patch, the Makefile's "make install" target will fail
if the INSTALLDIR and/or DESTDIR macros resolve to a non-existent
directory.
(pmenzel@molgen.mpg.de)
2019-08-15 10:08:10 -04:00
Dave Anderson
69cd19866a crash-7.2.4 commit 6596f1121b added a "list -B" option to allow more
efficient enumeration of longer lists.  There is a small bug with
this option where it may incorrectly flag a loop length of "0" on
list of length 1, indicating "list: loop detected, loop length: 0".
Since it is impossible to have a loop of length 0, the erroneous
message can be prevented by ensuring the list count is non-zero.
(dwysocha@redhat.com)
2019-08-05 14:38:24 -04:00
Dave Anderson
a812e59a17 Fix for the "timer" command in RHEL7.6 and later RHEL7 kernels.
Without the patch, the command emits extra faulty timer entries
because the tvec_root.vec[] and tvec.vec[] arrays are tracked using
hlist_head structures where list_head structures should be used.
(k-hagio@ab.jp.nec.com)
2019-08-02 12:03:40 -04:00
Dave Anderson
e1df72964f Fix for the "kmem -n" option on Linux 5.3-rc1 and later kernels
that contain commit 326e1b8f83a4318b09033ef754f40c785aed5e68,
titled "mm/sparsemem: introduce a SECTION_IS_EARLY flag".  Without
the patch, mem_map addresses containing the flag in bit 3 incorrectly
show it as part of the virtual address; with the patch, the option
displays the new "E" state flag.
(k-hagio@ab.jp.nec.com)
2019-07-26 14:31:33 -04:00
Dave Anderson
e6d8f0d8c7 Implemented a new "error" environment variable that sets the
destination of error messages.  It can be set to either:
  "default": error messages are always displayed on the
     console; if the output of a command is piped to an
     external command or redirected to a file, the error
     messages are also sent to the pipe or file.
  "redirect": if the output of a command is piped to an
     external command or redirected to a file, error messages
     are only sent to the pipe or file; otherwise they are
     displayed on the console.
  "filename": error messages are only sent to the specified
     filename; they are not displayed on the console and
     are not sent to a pipe or file.
(dkwon@redhat.com)
2019-07-15 15:06:37 -04:00
Dave Anderson
9b967a9040 Fix a memory leak in the previous "dis" commit.
(anderson@redhat.com)
2019-07-10 08:49:37 -04:00
Dave Anderson
6c891b667f Add support for the "count" argument to be used in conjunction with
the "dis -r" and "dis -f" reverse/forward modes of operation.  In
reverse mode, the specified "count" number of instructions leading
up to and including the target address will be displayed.  In forward
mode, the display will be limited to "count" instructions.  Without
the patch, using a count argument in either mode generates a "count
argument ignored" message, and the command proceeds as if it had
not been entered.
(anderson@redhat.com, atomlin@redhat.com)
2019-07-09 15:08:16 -04:00
Dave Anderson
72654f8c62 Introduction of a new "rd -R" option, which will display memory in
reverse order.  Memory will be displayed up to and including the
address argument, which requires that the count argument be greater
than 1 in order to display memory before the specified address.
(anderson@redhat.com)
2019-07-02 15:41:58 -04:00
Dave Anderson
fee99ccfd2 Fix to the x86_64 "--machdep phys_base=<value>" command line option
to allow the use of a negative decimal number as the value.  Without
the patch, only the hexadecimal representation of the value would be
accepted.
(v-santy@microsoft.com, anderson@redhat.com)
2019-06-28 14:03:35 -04:00
Dave Anderson
9bee8ecbbe Fix for a "warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]" compiler message generated by the previous
"timer" patch when compiling kernel.c on 32-bit architectures.
(anderson@redhat.com)
2019-06-26 15:45:31 -04:00
Dave Anderson
496d503e84 Extend the "timer" command with a new "TTE" column that displays the
remaining time in jiffies until the expiration of a timer entry, and
where a negative value displays the number of jiffies that have
elapsed since a timer has expired.
(oleksandr@redhat.com)
2019-06-26 14:57:49 -04:00
Dave Anderson
56912662b1 As an addendum to the previous patch for updating the gdb-7.6.patch
in an existing pre-built source tree, when rebuilding for the ppc64
architecture, do not restore the selected gdb files.  This is because
the gdb-7.6-ppc64le-support.patch will have modified the selected
files during the initial build.
(anderson@redhat.com)
2019-06-21 14:57:09 -04:00