diff --git a/.crash.metadata b/.crash.metadata index c69b121..ddb089d 100644 --- a/.crash.metadata +++ b/.crash.metadata @@ -1 +1 @@ -1d3647e807c59189746cbccdf6a5be6e15e6f397 SOURCES/crash-7.0.9.tar.gz +4099fdbb0589ab12d0ba9b189615241cec4094a2 SOURCES/crash-7.1.2.tar.gz diff --git a/.gitignore b/.gitignore index 13f7396..34a85ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/crash-7.0.9.tar.gz +SOURCES/crash-7.1.2.tar.gz diff --git a/SOURCES/bt-mislabeling.patch b/SOURCES/bt-mislabeling.patch deleted file mode 100644 index 203f0e4..0000000 --- a/SOURCES/bt-mislabeling.patch +++ /dev/null @@ -1,257 +0,0 @@ ---- crash-7.0.9/defs.h.orig -+++ crash-7.0.9/defs.h -@@ -5180,14 +5180,15 @@ struct x86_64_pt_regs_offsets { - }; - - #define MAX_EXCEPTION_STACKS 7 --#define NMI_STACK 2 /* ebase[] index to NMI exception stack */ --#define DEBUG_STACK 3 /* ebase[] index to DEBUG exception stack */ -+#define NMI_STACK (machdep->machspec->stkinfo.NMI_stack_index) - - struct x86_64_stkinfo { - ulong ebase[NR_CPUS][MAX_EXCEPTION_STACKS]; - int esize[MAX_EXCEPTION_STACKS]; - ulong ibase[NR_CPUS]; - int isize; -+ int NMI_stack_index; -+ char *exception_stacks[MAX_EXCEPTION_STACKS]; - }; - - struct machine_specific { ---- crash-7.0.9/x86_64.c.orig -+++ crash-7.0.9/x86_64.c -@@ -114,6 +114,7 @@ static void x86_64_get_active_set(void); - static int x86_64_get_kvaddr_ranges(struct vaddr_range *); - static int x86_64_verify_paddr(uint64_t); - static void GART_init(void); -+static void x86_64_exception_stacks_init(void); - - struct machine_specific x86_64_machine_specific = { 0 }; - -@@ -798,6 +799,14 @@ x86_64_dump_machdep_table(ulong arg) - ms->stkinfo.esize[5], - ms->stkinfo.esize[6], - machdep->flags & NO_TSS ? " (NO TSS) " : " "); -+ -+ fprintf(fp, " NMI_stack_index: %d\n", -+ ms->stkinfo.NMI_stack_index); -+ fprintf(fp, " exception_stacks:\n"); -+ for (i = 0; i < MAX_EXCEPTION_STACKS; i++) -+ fprintf(fp, " [%d]: %s\n", i, -+ ms->stkinfo.exception_stacks[i]); -+ - fprintf(fp, " ebase[%s][%d]:", - arg ? "NR_CPUS" : "cpus", MAX_EXCEPTION_STACKS); - cpus = arg ? NR_CPUS : kt->cpus; -@@ -1059,17 +1068,6 @@ x86_64_per_cpu_init(void) - verify_spinlock(); - } - --static char * --x86_64_exception_stacks[MAX_EXCEPTION_STACKS] = { -- "STACKFAULT", -- "DOUBLEFAULT", -- "NMI", -- "DEBUG", -- "MCE", -- "(unknown)", -- "(unknown)" --}; -- - /* - * Gather the ist addresses for each CPU. - */ -@@ -1086,6 +1084,8 @@ x86_64_ist_init(void) - tss_sp = per_cpu_symbol_search("per_cpu__init_tss"); - ist_sp = per_cpu_symbol_search("per_cpu__orig_ist"); - -+ x86_64_exception_stacks_init(); -+ - if (!tss_sp && symbol_exists("init_tss")) { - init_tss = symbol_value("init_tss"); - -@@ -1135,7 +1135,7 @@ x86_64_ist_init(void) - if (ms->stkinfo.ebase[c][i] != estacks[i]) - error(WARNING, - "cpu %d %s stack: init_tss: %lx orig_ist: %lx\n", c, -- x86_64_exception_stacks[i], -+ ms->stkinfo.exception_stacks[i], - ms->stkinfo.ebase[c][i], estacks[i]); - ms->stkinfo.ebase[c][i] = estacks[i]; - } -@@ -1165,22 +1165,12 @@ x86_64_ist_init(void) - break; - cnt++; - if ((THIS_KERNEL_VERSION >= LINUX(2,6,18)) && -- (i == DEBUG_STACK)) -+ STREQ(ms->stkinfo.exception_stacks[i], "DEBUG")) - ms->stkinfo.esize[i] = esize*2; - else - ms->stkinfo.esize[i] = esize; - ms->stkinfo.ebase[c][i] -= ms->stkinfo.esize[i]; - } -- /* -- * RT kernel only uses 3 exception stacks for the 5 types. -- */ -- if ((c == 0) && (cnt == 3)) { -- x86_64_exception_stacks[0] = "RT"; -- x86_64_exception_stacks[1] = "RT"; -- x86_64_exception_stacks[2] = "RT"; -- x86_64_exception_stacks[3] = "(unknown)"; -- x86_64_exception_stacks[4] = "(unknown)"; -- } - } - - /* -@@ -2351,7 +2341,7 @@ x86_64_eframe_search(struct bt_info *bt) - break; - bt->hp->esp = ms->stkinfo.ebase[c][i]; - fprintf(fp, "CPU %d %s EXCEPTION STACK:", -- c, x86_64_exception_stacks[i]); -+ c, ms->stkinfo.exception_stacks[i]); - - if (hide_offline_cpu(c)) { - fprintf(fp, " [OFFLINE]\n\n"); -@@ -3084,7 +3074,7 @@ in_exception_stack: - - if (!BT_REFERENCE_CHECK(bt)) - fprintf(fp, "--- <%s exception stack> ---\n", -- x86_64_exception_stacks[estack_index]); -+ ms->stkinfo.exception_stacks[estack_index]); - - /* - * Find the CPU-saved, or handler-saved registers -@@ -3133,7 +3123,7 @@ in_exception_stack: - fprintf(ofp, - " [ %s exception stack recursion: " - "prior stack location overwritten ]\n", -- x86_64_exception_stacks[estack_index]); -+ ms->stkinfo.exception_stacks[estack_index]); - return; - } - -@@ -4540,12 +4530,12 @@ skip_stage: - bt->stacktop = ms->stkinfo.ebase[bt->tc->processor][estack] + - ms->stkinfo.esize[estack]; - console("x86_64_get_dumpfile_stack_frame: searching %s estack at %lx\n", -- x86_64_exception_stacks[estack], bt->stackbase); -+ ms->stkinfo.exception_stacks[estack], bt->stackbase); - if (!(bt->stackbase)) - goto skip_stage; - bt->stackbuf = ms->irqstack; - alter_stackbuf(bt); -- in_nmi_stack = STREQ(x86_64_exception_stacks[estack], "NMI"); -+ in_nmi_stack = STREQ(ms->stkinfo.exception_stacks[estack], "NMI"); - goto next_stack; - - } -@@ -4772,6 +4762,69 @@ x86_64_display_idt_table(void) - FREEBUF(idt_table_buf); - } - -+static void -+x86_64_exception_stacks_init(void) -+{ -+ char *idt_table_buf; -+ char buf[BUFSIZE]; -+ int i; -+ ulong *ip, ist; -+ long size; -+ struct machine_specific *ms; -+ -+ ms = machdep->machspec; -+ -+ ms->stkinfo.NMI_stack_index = -1; -+ for (i = 0; i < MAX_EXCEPTION_STACKS; i++) -+ ms->stkinfo.exception_stacks[i] = "(unknown)"; -+ -+ if (!kernel_symbol_exists("idt_table")) -+ return; -+ -+ if (INVALID_SIZE(gate_struct)) -+ size = 16; -+ else -+ size = SIZE(gate_struct); -+ -+ idt_table_buf = GETBUF(size * 256); -+ readmem(symbol_value("idt_table"), KVADDR, idt_table_buf, -+ size * 256, "idt_table", FAULT_ON_ERROR); -+ ip = (ulong *)idt_table_buf; -+ -+ if (CRASHDEBUG(1)) -+ fprintf(fp, "exception IST:\n"); -+ -+ for (i = 0; i < 256; i++, ip += 2) { -+ ist = ((*ip) >> 32) & 0x7; -+ if (ist) { -+ x86_64_extract_idt_function(ip, buf, NULL); -+ if (CRASHDEBUG(1)) -+ fprintf(fp, " %ld: %s\n", ist, buf); -+ if (strstr(buf, "nmi")) { -+ ms->stkinfo.NMI_stack_index = ist-1; -+ ms->stkinfo.exception_stacks[ist-1] = "NMI"; -+ } -+ if (strstr(buf, "debug")) -+ ms->stkinfo.exception_stacks[ist-1] = "DEBUG"; -+ if (strstr(buf, "stack")) -+ ms->stkinfo.exception_stacks[ist-1] = "STACKFAULT"; -+ if (strstr(buf, "double")) -+ ms->stkinfo.exception_stacks[ist-1] = "DOUBLEFAULT"; -+ if (strstr(buf, "machine")) -+ ms->stkinfo.exception_stacks[ist-1] = "MCE"; -+ } -+ } -+ -+ if (CRASHDEBUG(1)) { -+ fprintf(fp, "exception stacks:\n"); -+ for (i = 0; i < MAX_EXCEPTION_STACKS; i++) -+ fprintf(fp, " [%d]: %s\n", i, ms->stkinfo.exception_stacks[i]); -+ } -+ -+ FREEBUF(idt_table_buf); -+} -+ -+ - /* - * Extract the function name out of the IDT entry. - */ -@@ -5103,9 +5156,9 @@ x86_64_display_machine_stats(void) - if (machdep->machspec->stkinfo.ebase[0][i] == 0) - break; - fprintf(fp, "%11s STACK SIZE: %d\n", -- x86_64_exception_stacks[i], -+ machdep->machspec->stkinfo.exception_stacks[i], - machdep->machspec->stkinfo.esize[i]); -- sprintf(buf, "%s STACKS:\n", x86_64_exception_stacks[i]); -+ sprintf(buf, "%s STACKS:\n", machdep->machspec->stkinfo.exception_stacks[i]); - fprintf(fp, "%24s", buf); - for (c = 0; c < kt->cpus; c++) { - if (machdep->machspec->stkinfo.ebase[c][i] == 0) - ---- crash-7.0.9/memory.c.orig -+++ crash-7.0.9/memory.c -@@ -8632,8 +8632,7 @@ static char * - vaddr_to_kmem_cache(ulong vaddr, char *buf, int verbose) - { - physaddr_t paddr; -- ulong page; -- ulong cache; -+ ulong page, cache, page_flags; - - if (!kvtop(NULL, vaddr, &paddr, 0)) { - if (verbose) -@@ -8651,6 +8650,14 @@ vaddr_to_kmem_cache(ulong vaddr, char *b - return NULL; - } - -+ if (vt->PG_slab) { -+ 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 ((vt->flags & KMALLOC_SLUB) || - ((vt->flags & KMALLOC_COMMON) && - VALID_MEMBER(page_slab) && VALID_MEMBER(page_first_page))) { diff --git a/SOURCES/fix_ARM64_bt-f_SIGSEGV.patch b/SOURCES/fix_ARM64_bt-f_SIGSEGV.patch new file mode 100644 index 0000000..13f1dd3 --- /dev/null +++ b/SOURCES/fix_ARM64_bt-f_SIGSEGV.patch @@ -0,0 +1,25 @@ +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/ppc64_bt_active_task.patch b/SOURCES/ppc64_bt_active_task.patch deleted file mode 100644 index 5193844..0000000 --- a/SOURCES/ppc64_bt_active_task.patch +++ /dev/null @@ -1,95 +0,0 @@ ---- crash-7.0.9/ppc64.c.orig -+++ crash-7.0.9/ppc64.c -@@ -1,7 +1,7 @@ - /* ppc64.c -- core analysis suite - * -- * Copyright (C) 2004-2014 David Anderson -- * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved. -+ * Copyright (C) 2004-2015 David Anderson -+ * Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved. - * Copyright (C) 2004, 2006 Haren Myneni, IBM Corporation - * - * This program is free software; you can redistribute it and/or modify -@@ -414,7 +414,7 @@ ppc64_init(int when) - break; - - case LOG_ONLY: -- machdep->kvbase = kt->vmcoreinfo._stext_SYMBOL; -+ machdep->identity_map_base = kt->vmcoreinfo._stext_SYMBOL; - break; - } - } -@@ -1898,8 +1898,8 @@ ppc64_print_regs(struct ppc64_pt_regs *r - int i; - - /* print out the gprs... */ -- for(i=0; i<32; i++) { -- if(!(i % 3)) -+ for (i=0; i<32; i++) { -+ if (i && !(i % 3)) - fprintf(fp, "\n"); - - fprintf(fp, " R%d:%s %016lx ", i, -@@ -1940,9 +1940,8 @@ ppc64_print_eframe(char *efrm_str, struc - if (BT_REFERENCE_CHECK(bt)) - return; - -- fprintf(fp, " %s [%lx] exception frame:", efrm_str, regs->trap); -+ fprintf(fp, " %s [%lx] exception frame:\n", efrm_str, regs->trap); - ppc64_print_regs(regs); -- fprintf(fp, "\n"); - } - - /* -@@ -1996,8 +1995,6 @@ ppc64_kdump_stack_frame(struct bt_info * - fprintf(fp, " LR [%016lx] %s\n", pt_regs->link, - closest_symbol(pt_regs->link)); - -- fprintf(fp, "\n"); -- - return TRUE; - } - -@@ -2008,7 +2005,7 @@ static int - ppc64_get_dumpfile_stack_frame(struct bt_info *bt_in, ulong *nip, ulong *ksp) - { - int panic_task; -- int i, panic; -+ int i; - char *sym; - ulong *up; - struct bt_info bt_local, *bt; -@@ -2092,10 +2089,8 @@ ppc64_get_dumpfile_stack_frame(struct bt - fprintf(fp, "Could not find SP for task %0lx\n", - bt->task); - } -- return TRUE; - } - -- panic = FALSE; - /* - * Check the process stack first. We are scanning stack for only - * panic task. Even though we have dumping CPU's regs, we will be -@@ -2112,8 +2107,12 @@ retry: - if (STREQ(sym, ".netconsole_netdump") || - STREQ(sym, ".netpoll_start_netdump") || - STREQ(sym, ".start_disk_dump") || -+ STREQ(sym, "crash_kexec") || -+ STREQ(sym, "crash_fadump") || -+ STREQ(sym, "crash_ipi_callback") || - STREQ(sym, ".crash_kexec") || - STREQ(sym, ".crash_fadump") || -+ STREQ(sym, ".crash_ipi_callback") || - STREQ(sym, ".disk_dump")) { - *nip = *up; - *ksp = bt->stackbase + -@@ -2122,9 +2121,6 @@ retry: - } - } - -- if (panic) -- return TRUE; -- - bt->flags &= ~(BT_HARDIRQ|BT_SOFTIRQ); - - if (check_hardirq && diff --git a/SOURCES/recognize_multiple_page_slab_cache.patch b/SOURCES/recognize_multiple_page_slab_cache.patch new file mode 100644 index 0000000..65ee183 --- /dev/null +++ b/SOURCES/recognize_multiple_page_slab_cache.patch @@ -0,0 +1,42 @@ +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_16TB.patch b/SOURCES/sadump_16TB.patch deleted file mode 100644 index 57a6db4..0000000 --- a/SOURCES/sadump_16TB.patch +++ /dev/null @@ -1,108 +0,0 @@ - Add support for more than 16TB of physical memory space in the SADUMP - dumpfile format. Without the patch, there is a limitation caused - by several 32-bit members of dump_header structure, in particular - the max_mapnr member, which overflows if the dumpfile contains more - than 16TB of physical memory space. The header_version member of - the dump_header structure has been increased from 0 to 1 in this - extended new format, and the new 64-bit members will be used. - (d.hatayama@jp.fujitsu.com) - -diff --git a/sadump.c b/sadump.c -index d7c6701..bc67354 100644 ---- a/sadump.c -+++ b/sadump.c -@@ -20,6 +20,7 @@ - #include "sadump.h" - #include /* htonl, htons */ - #include -+#include - - enum { - failed = -1 -@@ -325,6 +326,20 @@ restart: - - flags |= SADUMP_LOCAL; - -+ switch (sh->header_version) { -+ case 0: -+ sd->max_mapnr = (uint64_t)sh->max_mapnr; -+ break; -+ default: -+ error(WARNING, -+ "sadump: unsupported header version: %u\n" -+ "sadump: assuming header version: 1\n", -+ sh->header_version); -+ case 1: -+ sd->max_mapnr = sh->max_mapnr_64; -+ break; -+ } -+ - if (sh->sub_hdr_size > 0) { - if (!read_device(&smram_cpu_state_size, sizeof(uint32_t), - &offset)) { -@@ -772,7 +787,7 @@ int read_sadump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr) - curpaddr = paddr & ~((physaddr_t)(sd->block_size-1)); - page_offset = paddr & ((physaddr_t)(sd->block_size-1)); - -- if ((pfn >= sd->dump_header->max_mapnr) || !page_is_ram(pfn)) -+ if ((pfn >= sd->max_mapnr) || !page_is_ram(pfn)) - return SEEK_ERROR; - if (!page_is_dumpable(pfn)) { - if (sd->flags & SADUMP_ZERO_EXCLUDED) -@@ -979,6 +994,17 @@ int sadump_memory_dump(FILE *fp) - fprintf(fp, " written_blocks: %u\n", sh->written_blocks); - fprintf(fp, " current_cpu: %u\n", sh->current_cpu); - fprintf(fp, " nr_cpus: %u\n", sh->nr_cpus); -+ if (sh->header_version >= 1) { -+ fprintf(fp, -+ " max_mapnr_64: %" PRIu64 "\n" -+ " total_ram_blocks_64: %" PRIu64 "\n" -+ " device_blocks_64: %" PRIu64 "\n" -+ " written_blocks_64: %" PRIu64 "\n", -+ sh->max_mapnr_64, -+ sh->total_ram_blocks_64, -+ sh->device_blocks_64, -+ sh->written_blocks_64); -+ } - - fprintf(fp, "\n dump sub heaer: "); - if (sh->sub_hdr_size > 0) { -@@ -1556,7 +1582,7 @@ static int block_table_init(void) - { - uint64_t pfn, section, max_section, *block_table; - -- max_section = divideup(sd->dump_header->max_mapnr, SADUMP_PF_SECTION_NUM); -+ max_section = divideup(sd->max_mapnr, SADUMP_PF_SECTION_NUM); - - block_table = calloc(sizeof(uint64_t), max_section); - if (!block_table) { -diff --git a/sadump.h b/sadump.h -index 09e313e..7f8e384 100644 ---- a/sadump.h -+++ b/sadump.h -@@ -103,6 +103,14 @@ struct sadump_header { - uint32_t written_blocks; /* Number of written blocks */ - uint32_t current_cpu; /* CPU# which handles dump */ - uint32_t nr_cpus; /* Number of CPUs */ -+ /* -+ * The members from below are supported in header version 1 -+ * and later. -+ */ -+ uint64_t max_mapnr_64; -+ uint64_t total_ram_blocks_64; -+ uint64_t device_blocks_64; -+ uint64_t written_blocks_64; - }; - - struct sadump_apic_state { -@@ -209,6 +217,8 @@ struct sadump_data { - ulonglong backup_src_start; - ulong backup_src_size; - ulonglong backup_offset; -+ -+ uint64_t max_mapnr; - }; - - struct sadump_data *sadump_get_sadump_data(void); - - diff --git a/SOURCES/use_QEMU_registers_for_active_task_backtraces.patch b/SOURCES/use_QEMU_registers_for_active_task_backtraces.patch deleted file mode 100644 index 327ee92..0000000 --- a/SOURCES/use_QEMU_registers_for_active_task_backtraces.patch +++ /dev/null @@ -1,213 +0,0 @@ -commit b4af1d9b48998186aef8cd9abc47c6d59e36114e -Author: Dave Anderson -Date: Tue Dec 2 17:26:40 2014 -0500 - - Fix for finding the starting stack and instruction pointer hooks for - the active tasks in x86_64 ELF or compressed dumpfiles created by the - KVM "virsh dump --memory-only" facility. Without the patch, the - backtraces of active tasks may show an invalid starting frame that - indicates "__schedule". The fix displays the exception RIP and dumps - the register contents that are stored in the dumpfile header. If the - active task was operating in the kernel, the backtrace continues from - there; if the task was operating in user-space, the backtrace is - complete at that point. - (anderson@redhat.com) - -diff --git a/defs.h b/defs.h -index 2e52bc4..dc2d65a 100644 ---- a/defs.h -+++ b/defs.h -@@ -5547,6 +5547,7 @@ int write_proc_kcore(int, void *, int, ulong, physaddr_t); - int kcore_memory_dump(FILE *); - void dump_registers_for_qemu_mem_dump(void); - void kdump_backup_region_init(void); -+void display_regs_from_elf_notes(int, FILE *); - - /* - * ramdump.c -diff --git a/diskdump.c b/diskdump.c -index 3d33fdc..6b2aab5 100644 ---- a/diskdump.c -+++ b/diskdump.c -@@ -102,6 +102,9 @@ map_cpus_to_prstatus_kdump_cmprs(void) - int online, i, j, nrcpus; - size_t size; - -+ if (pc->flags2 & QEMU_MEM_DUMP_COMPRESSED) /* notes exist for all cpus */ -+ return; -+ - if (!(online = get_cpus_online()) || (online == kt->cpus)) - return; - -diff --git a/netdump.c b/netdump.c -index 903faa0..6029a54 100644 ---- a/netdump.c -+++ b/netdump.c -@@ -72,6 +72,9 @@ map_cpus_to_prstatus(void) - int online, i, j, nrcpus; - size_t size; - -+ if (pc->flags2 & QEMU_MEM_DUMP_ELF) /* notes exist for all cpus */ -+ return; -+ - if (!(online = get_cpus_online()) || (online == kt->cpus)) - return; - -@@ -2398,8 +2401,8 @@ get_regs_from_note(char *note, ulong *ip, ulong *sp) - return user_regs; - } - --static void --display_regs_from_elf_notes(int cpu) -+void -+display_regs_from_elf_notes(int cpu, FILE *ofp) - { - Elf32_Nhdr *note32; - Elf64_Nhdr *note64; -@@ -2408,13 +2411,16 @@ display_regs_from_elf_notes(int cpu) - int c, skipped_count; - - /* -- * NT_PRSTATUS notes are only related to online cpus, offline cpus -- * should be skipped. -+ * Kdump NT_PRSTATUS notes are only related to online cpus, -+ * so offline cpus should be skipped. - */ -- skipped_count = 0; -- for (c = 0; c < cpu; c++) { -- if (check_offline_cpu(c)) -- skipped_count++; -+ if (pc->flags2 & QEMU_MEM_DUMP_ELF) -+ skipped_count = 0; -+ else { -+ for (c = skipped_count = 0; c < cpu; c++) { -+ if (check_offline_cpu(c)) -+ skipped_count++; -+ } - } - - if ((cpu - skipped_count) >= nd->num_prstatus_notes) { -@@ -2433,7 +2439,7 @@ display_regs_from_elf_notes(int cpu) - len = roundup(len + note64->n_descsz, 4); - user_regs = ((char *)note64) + len - SIZE(user_regs_struct) - sizeof(long); - -- fprintf(fp, -+ fprintf(ofp, - " RIP: %016llx RSP: %016llx RFLAGS: %08llx\n" - " RAX: %016llx RBX: %016llx RCX: %016llx\n" - " RDX: %016llx RSI: %016llx RDI: %016llx\n" -@@ -2473,7 +2479,7 @@ display_regs_from_elf_notes(int cpu) - len = roundup(len + note32->n_descsz, 4); - user_regs = ((char *)note32) + len - SIZE(user_regs_struct) - sizeof(long); - -- fprintf(fp, -+ fprintf(ofp, - " EAX: %08x EBX: %08x ECX: %08x EDX: %08x\n" - " ESP: %08x EIP: %08x ESI: %08x EDI: %08x\n" - " CS: %04x DS: %04x ES: %04x FS: %04x\n" -@@ -2506,7 +2512,7 @@ display_regs_from_elf_notes(int cpu) - len = roundup(len + note64->n_namesz, 4); - len = roundup(len + note64->n_descsz, 4); - // user_regs = ((char *)note64) + len - SIZE(user_regs_struct) - sizeof(long); -- fprintf(fp, "display_regs_from_elf_notes: ARM64 register dump TBD\n"); -+ fprintf(ofp, "display_regs_from_elf_notes: ARM64 register dump TBD\n"); - } - } - -@@ -2519,7 +2525,7 @@ dump_registers_for_elf_dumpfiles(void) - error(FATAL, "-r option not supported for this dumpfile\n"); - - if (NETDUMP_DUMPFILE()) { -- display_regs_from_elf_notes(0); -+ display_regs_from_elf_notes(0, fp); - return; - } - -@@ -2530,7 +2536,7 @@ dump_registers_for_elf_dumpfiles(void) - } - - fprintf(fp, "%sCPU %d:\n", c ? "\n" : "", c); -- display_regs_from_elf_notes(c); -+ display_regs_from_elf_notes(c, fp); - } - } - -@@ -2556,7 +2562,8 @@ get_netdump_regs_x86_64(struct bt_info *bt, ulong *ripp, ulong *rspp) - bt->flags |= BT_DUMPFILE_SEARCH; - - if (((NETDUMP_DUMPFILE() || KDUMP_DUMPFILE()) && -- VALID_STRUCT(user_regs_struct) && (bt->task == tt->panic_task)) || -+ VALID_STRUCT(user_regs_struct) && -+ ((bt->task == tt->panic_task) || (pc->flags2 & QEMU_MEM_DUMP_ELF))) || - (KDUMP_DUMPFILE() && (kt->flags & DWARF_UNWIND) && - (bt->flags & BT_DUMPFILE_SEARCH))) { - if (nd->num_prstatus_notes > 1) -diff --git a/task.c b/task.c -index f5bbe64..147ff5c 100644 ---- a/task.c -+++ b/task.c -@@ -483,7 +483,7 @@ task_init(void) - tt->this_task = pid_to_task(active_pid); - } - else { -- if (KDUMP_DUMPFILE() && !(pc->flags2 & QEMU_MEM_DUMP_ELF)) -+ if (KDUMP_DUMPFILE()) - map_cpus_to_prstatus(); - else if (ELF_NOTES_VALID() && DISKDUMP_DUMPFILE()) - map_cpus_to_prstatus_kdump_cmprs(); -diff --git a/x86_64.c b/x86_64.c -index bbf1326..df6c561 100644 ---- a/x86_64.c -+++ b/x86_64.c -@@ -2963,11 +2963,13 @@ x86_64_low_budget_back_trace_cmd(struct bt_info *bt_in) - diskdump_display_regs(bt->tc->processor, ofp); - else if (SADUMP_DUMPFILE()) - sadump_display_regs(bt->tc->processor, ofp); -+ else if (pc->flags2 & QEMU_MEM_DUMP_ELF) -+ display_regs_from_elf_notes(bt->tc->processor, ofp); - return; - } else if ((bt->flags & BT_KERNEL_SPACE) && - (KVMDUMP_DUMPFILE() || - (ELF_NOTES_VALID() && DISKDUMP_DUMPFILE()) || -- SADUMP_DUMPFILE())) { -+ SADUMP_DUMPFILE() || (pc->flags2 & QEMU_MEM_DUMP_ELF))) { - fprintf(ofp, " [exception RIP: "); - if ((sp = value_search(bt->instptr, &offset))) { - fprintf(ofp, "%s", sp->name); -@@ -2983,6 +2985,9 @@ x86_64_low_budget_back_trace_cmd(struct bt_info *bt_in) - diskdump_display_regs(bt->tc->processor, ofp); - else if (SADUMP_DUMPFILE()) - sadump_display_regs(bt->tc->processor, ofp); -+ else if (pc->flags2 & QEMU_MEM_DUMP_ELF) -+ display_regs_from_elf_notes(bt->tc->processor, ofp); -+ - } else if (bt->flags & BT_START) { - x86_64_print_stack_entry(bt, ofp, level, - 0, bt->instptr); -@@ -4565,7 +4570,7 @@ skip_stage: - *rip = ur_rip; - *rsp = ur_rsp; - if (is_kernel_text(ur_rip) && -- (INSTACK(ur_rsp, bt) || -+ (INSTACK(ur_rsp, bt_in) || - in_alternate_stack(bt->tc->processor, ur_rsp))) - bt_in->flags |= BT_KERNEL_SPACE; - if (!is_kernel_text(ur_rip) && in_user_stack(bt->tc->task, ur_rsp)) -@@ -4596,14 +4601,14 @@ skip_stage: - ur_rip = ULONG(user_regs + OFFSET(user_regs_struct_rip)); - ur_rsp = ULONG(user_regs + OFFSET(user_regs_struct_rsp)); - if (!in_alternate_stack(bt->tc->processor, ur_rsp) && -- !stkptr_to_task(bt->task)) { -+ !stkptr_to_task(ur_rsp)) { - if (CRASHDEBUG(1)) - error(INFO, - "x86_64_get_dumpfile_stack_frame: " - "ELF mismatch: RSP: %lx task: %lx\n", - ur_rsp, bt->task); - } else { -- if (is_kernel_text(ur_rip) && (INSTACK(ur_rsp, bt) || -+ if (is_kernel_text(ur_rip) && (INSTACK(ur_rsp, bt_in) || - in_alternate_stack(bt->tc->processor, ur_rsp))) - bt_in->flags |= BT_KERNEL_SPACE; - if (!is_kernel_text(ur_rip) && in_user_stack(bt->tc->task, ur_rsp)) - diff --git a/SPECS/crash.spec b/SPECS/crash.spec index 9b07f40..e5b12fe 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.0.9 -Release: 5%{?dist} +Version: 7.1.2 +Release: 2%{?dist} License: GPLv3 Group: Development/Debuggers Source: http://people.redhat.com/anderson/crash-%{version}.tar.gz @@ -15,10 +15,8 @@ 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: use_QEMU_registers_for_active_task_backtraces.patch -Patch2: bt-mislabeling.patch -Patch3: ppc64_bt_active_task.patch -Patch4: sadump_16TB.patch +Patch1: recognize_multiple_page_slab_cache.patch +Patch2: fix_ARM64_bt-f_SIGSEGV.patch %description The core analysis suite is a self-contained tool that can be used to @@ -40,10 +38,8 @@ 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 use_QEMU_registers_for_active_task_backtraces.patch -%patch2 -p1 -b bt-mislabeling.patch -%patch3 -p1 -b ppc64_bt_active_task.patch -%patch4 -p1 -b sadump_16TB.patch +%patch1 -p1 -b recognize_multiple_page_slab_cache.patch +%patch2 -p1 -b fix_ARM64_bt-f_SIGSEGV.patch %build make RPMPKG="%{version}-%{release}" CFLAGS="%{optflags}" @@ -72,6 +68,37 @@ rm -rf %{buildroot} %{_includedir}/* %changelog +* Tue Aug 4 2015 Dave Anderson - 7.1.2-2 +- Fix "kmem -s
", "bt -F[F]", and "rd -S[S]" options in kernels + configured with CONFIG_SLUB having multiple-page slabs. + Resolves: rhbz#1244003 +- Fix for SIGSEGV generated by "bt -[f|F]" in ARM64 kernels. + Resolves: rhbz#1248859 + +* Mon Jul 13 2015 Dave Anderson - 7.1.2-1 +- Rebase to upstream version 7.1.2 + Resolves: rhbz#1207696 +- Fix several ppc64 backtrace issues + Resolves: rhbz#1235447 + +* Fri Jun 05 2015 Dave Anderson - 7.1.1-2 +- ARM64 backtrace enhancements + Resolves: rhbz#1227508 + +* Thu May 28 2015 Dave Anderson - 7.1.1-1 +- Rebase to upstream version 7.1.1 + Resolves: rhbz#1207696 +- Display s390x vector registers from a kernel dump. + Resolves: rhbz#1182161 +- Fix date displayed on initial system banner and by the "sys" command on ARM64. + Resolves: rhbz#1223044 +- Fix ARM64 page size calculation on 4.1 and later kernels. + Resolves: rhbz#1222645 + +* Tue Apr 21 2015 Dave Anderson - 7.0.9-6 +- Calculate ARM64 virtual memory layout based upon struct page size + Resolves: rhbz#1204941 + * Tue Apr 7 2015 Dave Anderson - 7.0.9-5 - Support new sadump format that can represent more than 16 TB physical memory space Resolves: rhbz#1182383