diff --git a/.crash.metadata b/.crash.metadata index ddb089d..bfd3175 100644 --- a/.crash.metadata +++ b/.crash.metadata @@ -1 +1 @@ -4099fdbb0589ab12d0ba9b189615241cec4094a2 SOURCES/crash-7.1.2.tar.gz +dd6b6f9e6aed648bdac4550d9d81442896dc98fd SOURCES/crash-7.1.5.tar.gz diff --git a/.gitignore b/.gitignore index 34a85ba..92da2d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/crash-7.1.2.tar.gz +SOURCES/crash-7.1.5.tar.gz diff --git a/SOURCES/fix_ARM64_bt-f_SIGSEGV.patch b/SOURCES/fix_ARM64_bt-f_SIGSEGV.patch deleted file mode 100644 index 13f1dd3..0000000 --- a/SOURCES/fix_ARM64_bt-f_SIGSEGV.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 9c102f994856d1de5a62644822d07a99318073cb -Author: Dave Anderson -Date: Mon Aug 3 13:55:02 2015 -0400 - - Fix for a segmentation violation generated by the ARM64 "bt -[f|F]" - options when analyzing the active tasks in vmcores generated by the - kdump facility. This bug is a regression that was introduced in - crash-7.1.2 by commit 15a58e4070486efa2aa965bdd636626e62b65cc7, which - was an enhancement of the ARM64 backtrace capability for active tasks - in kdump vmcores. - (anderson@redhat.com) - -diff --git a/arm64.c b/arm64.c -index d9bef10..a4c3b51 100644 ---- a/arm64.c -+++ b/arm64.c -@@ -1144,6 +1144,7 @@ arm64_back_trace_cmd(struct bt_info *bt) - stackframe.fp = GET_STACK_ULONG(bt->bptr - 8); - stackframe.pc = GET_STACK_ULONG(bt->bptr); - stackframe.sp = bt->bptr + 8; -+ bt->frameptr = stackframe.sp; - } else if (bt->hp && bt->hp->esp) { - stackframe.fp = GET_STACK_ULONG(bt->hp->esp - 8); - stackframe.pc = bt->hp->eip ? - diff --git a/SOURCES/fix_sadump_read_failures.patch b/SOURCES/fix_sadump_read_failures.patch deleted file mode 100644 index fdce6c7..0000000 --- a/SOURCES/fix_sadump_read_failures.patch +++ /dev/null @@ -1,50 +0,0 @@ -commit 5e887f898c709f912686addde1e046dd1639c97b -Author: Dave Anderson -Date: Tue Oct 20 11:54:59 2015 -0400 - - Fix for the behavior of the --zero_excluded option when used with - SADUMP dumpfiles. Without the patch, the behavior of --zero_excluded - option is the opposite to what is expected: reads of filtered pages - return successfully with zero-filled memory, while reads of filtered - filtered pages fail when --zero_excluded option has been specified. - (d.hatayama@jp.fujitsu.com) - -diff --git a/sadump.c b/sadump.c -index 2806521..7cad15a 100644 ---- a/sadump.c -+++ b/sadump.c -@@ -790,7 +790,7 @@ int read_sadump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr) - if ((pfn >= sd->max_mapnr) || !page_is_ram(pfn)) - return SEEK_ERROR; - if (!page_is_dumpable(pfn)) { -- if (sd->flags & SADUMP_ZERO_EXCLUDED) -+ if (!(sd->flags & SADUMP_ZERO_EXCLUDED)) - return PAGE_EXCLUDED; - memset(bufptr, 0, cnt); - return cnt; - -commit ebca719c1906bd7bd7f8f6ab0e158be23437c6e2 -Author: Dave Anderson -Date: Tue Oct 20 11:48:05 2015 -0400 - - Fix for bitmap-handling in SADUMP dumpfiles, which associate each bit - in a bitmap with a physical page in the reverse order that is used - in kdump-compressed format. The bug had not been detected for a long - time because bitmaps in SADUMP formats consist mostly of 0x00 and - 0xff excluding a very limited amount of memory space for firmware. - (indou.takao@jp.fujitsu.com, d.hatayama@jp.fujitsu.com) - -diff --git a/sadump.c b/sadump.c -index bc67354..2806521 100644 ---- a/sadump.c -+++ b/sadump.c -@@ -715,7 +715,7 @@ is_set_bit(char *bitmap, uint64_t pfn) - ulong index, bit; - - index = pfn >> 3; -- bit = pfn & 7; -+ bit = 7 - (pfn & 7); - - return !!(bitmap[index] & (1UL << bit)); - } - diff --git a/SOURCES/lzo_snappy.patch b/SOURCES/lzo_snappy.patch index 73d2a4f..61af0cc 100644 --- a/SOURCES/lzo_snappy.patch +++ b/SOURCES/lzo_snappy.patch @@ -1,5 +1,5 @@ ---- crash-7.0.2/diskdump.c.orig -+++ crash-7.0.2/diskdump.c +--- crash-7.1.5/diskdump.c.orig ++++ crash-7.1.5/diskdump.c @@ -23,6 +23,8 @@ * GNU General Public License for more details. */ @@ -8,10 +8,10 @@ +#define SNAPPY #include "defs.h" #include "diskdump.h" - ---- crash-7.0.2/Makefile.orig -+++ crash-7.0.2/Makefile -@@ -223,7 +223,7 @@ all: make_configure + #include "xen_dom0.h" +--- crash-7.1.5/Makefile.orig ++++ crash-7.1.5/Makefile +@@ -228,7 +228,7 @@ all: make_configure gdb_merge: force @if [ ! -f ${GDB}/README ]; then \ make --no-print-directory gdb_unzip; fi diff --git a/SOURCES/module_symbol_order.patch b/SOURCES/module_symbol_order.patch new file mode 100644 index 0000000..41652a0 --- /dev/null +++ b/SOURCES/module_symbol_order.patch @@ -0,0 +1,96 @@ +--- crash-7.1.5/symbols.c.orig ++++ crash-7.1.5/symbols.c +@@ -1418,9 +1418,11 @@ store_module_symbols_v1(ulong total, int + for (i = first = last = 0; i < nsyms; i++) { + modsym = (struct module_symbol *) + (modsymbuf + (i * sizeof(struct module_symbol))); +- if (!first) ++ if (!first ++ || first > (ulong)modsym->name) + first = (ulong)modsym->name; +- last = (ulong)modsym->name; ++ if ((ulong)modsym->name > last) ++ last = (ulong)modsym->name; + } + + if (last > first) { +@@ -1441,15 +1443,11 @@ store_module_symbols_v1(ulong total, int + } else + strbuf = NULL; + +- for (i = first = last = 0; i < nsyms; i++) { ++ for (i = 0; i < nsyms; i++) { + + modsym = (struct module_symbol *) + (modsymbuf + (i * sizeof(struct module_symbol))); + +- if (!first) +- first = (ulong)modsym->name; +- last = (ulong)modsym->name; +- + BZERO(buf1, BUFSIZE); + + if (strbuf) +@@ -1722,9 +1720,11 @@ store_module_symbols_v2(ulong total, int + for (i = first = last = 0; i < nsyms; i++) { + modsym = (struct kernel_symbol *) + (modsymbuf + (i * sizeof(struct kernel_symbol))); +- if (!first) ++ if (!first ++ || first > (ulong)modsym->name) + first = (ulong)modsym->name; +- last = (ulong)modsym->name; ++ if ((ulong)modsym->name > last) ++ last = (ulong)modsym->name; + } + + if (last > first) { +@@ -1745,15 +1745,12 @@ store_module_symbols_v2(ulong total, int + } else + strbuf = NULL; + +- for (i = first = last = 0; i < nsyms; i++) { ++ ++ for (i = 0; i < nsyms; i++) { + + modsym = (struct kernel_symbol *) + (modsymbuf + (i * sizeof(struct kernel_symbol))); + +- if (!first) +- first = (ulong)modsym->name; +- last = (ulong)modsym->name; +- + BZERO(buf1, BUFSIZE); + + if (strbuf) +@@ -1797,9 +1794,11 @@ store_module_symbols_v2(ulong total, int + for (i = first = last = 0; i < ngplsyms; i++) { + modsym = (struct kernel_symbol *) + (modsymbuf + (i * sizeof(struct kernel_symbol))); +- if (!first) ++ if (!first ++ || first > (ulong)modsym->name) + first = (ulong)modsym->name; +- last = (ulong)modsym->name; ++ if ((ulong)modsym->name > last) ++ last = (ulong)modsym->name; + } + + if (last > first) { +@@ -1820,15 +1819,11 @@ store_module_symbols_v2(ulong total, int + } else + strbuf = NULL; + +- for (i = first = last = 0; i < ngplsyms; i++) { ++ for (i = 0; i < ngplsyms; i++) { + + modsym = (struct kernel_symbol *) + (modsymbuf + (i * sizeof(struct kernel_symbol))); + +- if (!first) +- first = (ulong)modsym->name; +- last = (ulong)modsym->name; +- + BZERO(buf1, BUFSIZE); + + if (strbuf) diff --git a/SOURCES/recognize_multiple_page_slab_cache.patch b/SOURCES/recognize_multiple_page_slab_cache.patch deleted file mode 100644 index 65ee183..0000000 --- a/SOURCES/recognize_multiple_page_slab_cache.patch +++ /dev/null @@ -1,42 +0,0 @@ -commit 2e3b89ed93dfd266d4061445bb04b20574461539 -Author: Dave Anderson -Date: Fri Jul 17 10:41:32 2015 -0400 - - Fix for the "kmem -s
", "bt -F[F]", and "rd -S[S]" - options in kernels configured with CONFIG_SLUB. Without the patch, - if a referenced slab object address comes from a slab cache that - utilizes a multiple-page slab, and the object is located within - a tail page of that slab cache, it will not be recognized as a slab - object. The "bt -F[F]" and "rd -S[S]" options will just show the - object address, and the "kmem -s
" object will indicate - "kmem: address is not allocated in slab subsystem:
". - This bug is a regression that was introduced in crash-7.1.0 by commit - 8b2cb365d7fb139e77cedd80d4061332099ed382, which addressed a bug where - stale slab object addresses were incorrectly being recognized as - valid slab objects. - (anderson@redhat.com) - -diff --git a/memory.c b/memory.c -index fa2970c..a7988fd 100644 ---- a/memory.c -+++ b/memory.c -@@ -9103,8 +9103,16 @@ vaddr_to_kmem_cache(ulong vaddr, char *buf, int verbose) - readmem(page+OFFSET(page_flags), KVADDR, - &page_flags, sizeof(ulong), "page.flags", - FAULT_ON_ERROR); -- if (!(page_flags & (1 << vt->PG_slab))) -- return NULL; -+ if (!(page_flags & (1 << vt->PG_slab))) { -+ if (vt->flags & KMALLOC_SLUB) { -+ readmem(compound_head(page)+OFFSET(page_flags), KVADDR, -+ &page_flags, sizeof(ulong), "page.flags", -+ FAULT_ON_ERROR); -+ if (!(page_flags & (1 << vt->PG_slab))) -+ return NULL; -+ } else -+ return NULL; -+ } - } - - if ((vt->flags & KMALLOC_SLUB) || - diff --git a/SOURCES/sadump_read_excluded_pages.patch b/SOURCES/sadump_read_excluded_pages.patch deleted file mode 100644 index 7d4f2b4..0000000 --- a/SOURCES/sadump_read_excluded_pages.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- crash-7.1.0/sadump.c.orig -+++ crash-7.1.0/sadump.c -@@ -394,7 +394,13 @@ restart: - } - - sd->filename = file; -- sd->flags = flags; -+ -+ /* -+ * Switch to zero excluded mode by default on sadump-related -+ * formats because some Fujitsu troubleshooting software -+ * assumes the behavior. -+ */ -+ sd->flags = flags | SADUMP_ZERO_EXCLUDED; - - if (machine_type("X86")) - sd->machine_type = EM_386; ---- crash-7.1.0/tools.c.orig -+++ crash-7.1.0/tools.c -@@ -2479,7 +2479,9 @@ show_options(void) - fprintf(fp, " namelist: %s\n", pc->namelist); - fprintf(fp, " dumpfile: %s\n", pc->dumpfile); - fprintf(fp, " unwind: %s\n", kt->flags & DWARF_UNWIND ? "on" : "off"); -- fprintf(fp, " zero_excluded: %s\n", *diskdump_flags & ZERO_EXCLUDED ? "on" : "off"); -+ fprintf(fp, " zero_excluded: %s\n", -+ (*diskdump_flags & ZERO_EXCLUDED) || sadump_is_zero_excluded() ? -+ "on" : "off"); - fprintf(fp, " null-stop: %s\n", *gdb_stop_print_at_null ? "on" : "off"); - fprintf(fp, " gdb: %s\n", pc->flags2 & GDB_CMD_MODE ? "on" : "off"); - fprintf(fp, " scope: %lx ", pc->scope); diff --git a/SPECS/crash.spec b/SPECS/crash.spec index b16eec1..71649b2 100644 --- a/SPECS/crash.spec +++ b/SPECS/crash.spec @@ -3,8 +3,8 @@ # Summary: Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles Name: crash -Version: 7.1.2 -Release: 3%{?dist}.1 +Version: 7.1.5 +Release: 2%{?dist} License: GPLv3 Group: Development/Debuggers Source: http://people.redhat.com/anderson/crash-%{version}.tar.gz @@ -15,10 +15,7 @@ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot-%(%{__id_u} -n) BuildRequires: ncurses-devel zlib-devel lzo-devel bison snappy-devel Requires: binutils Patch0: lzo_snappy.patch -Patch1: recognize_multiple_page_slab_cache.patch -Patch2: fix_ARM64_bt-f_SIGSEGV.patch -Patch3: fix_sadump_read_failures.patch -Patch4: sadump_read_excluded_pages.patch +Patch1: module_symbol_order.patch %description The core analysis suite is a self-contained tool that can be used to @@ -40,10 +37,7 @@ offered by Mission Critical Linux, or the LKCD kernel patch. %prep %setup -n %{name}-%{version} -q %patch0 -p1 -b lzo_snappy.patch -%patch1 -p1 -b recognize_multiple_page_slab_cache.patch -%patch2 -p1 -b fix_ARM64_bt-f_SIGSEGV.patch -%patch3 -p1 -b fix_sadump_read_failures.patch -%patch4 -p1 -b sadump_read_excluded_pages.patch +%patch1 -p1 -b module_symbol_order.patch %build make RPMPKG="%{version}-%{release}" CFLAGS="%{optflags}" @@ -72,9 +66,25 @@ rm -rf %{buildroot} %{_includedir}/* %changelog -* Tue Apr 5 2017 Dave Anderson - 7.1.2-3.el7_2.1 -- crash: fails to read excluded pages by default on sadump-related formats - Resolves: rhbz#1324115 +* Wed Sep 14 2016 Dave Anderson - 7.1.5-2 +- Fix for kernel module symbol gathering when the ordering of module + symbol name strings does not match the order of the kernel_symbol + structures. +- Resolves: rhbz#1375130 + +* Thu Apr 28 2016 Dave Anderson - 7.1.5-1 +- Rebase to upstream version 7.1.5 + Resolves: rhbz#1292566 +- Decode clflushopt instruction + Resolves: rhbz#1262479 +- Support AArch64 QEMU generated dumps + Resolves: rhbz#1299873 +- crash: zero-size memory allocation (aarch64) + Resolves: rhbz#1312738 + +* Tue Apr 5 2016 Dave Anderson - 7.1.2-4 +- crash: fails to read excluded pages by default on sadump-related format + Resolves: rhbz#1304260 * Mon Nov 23 2015 Dave Anderson - 7.1.2-3 - crash fails to read or wrongly reads some parts of memory in sadump vmcore format