[Crash-utility] crash-5.0: Segmentation fault with x86_64_get_active_set

Dave Anderson anderson at redhat.com
Thu Jan 14 14:08:41 UTC 2010


----- "ville mattila" <ville.mattila at stonesoft.com> wrote:

> Hello,
> 
> I get segementation fault from our 64-bit kernel crash
> This crash is caused by "echo c > /proc/sys-trigger".
> The reason seems to be that the x86_64_cpu_pda_init is
> not called at least gdb do not break there.
> 
> Here is a little patch that fixes it. Everyting seems to
> work correctly. I'll provide more info if needed.
> 
> 
> --- crash-5.0.0/x86_64.c 2010-01-06 21:38:27.000000000 +0200
> +++ crash-5.0.0-64bit/x86_64.c 2010-01-14 08:24:13.679603706 +0200
> @@ -6325,6 +6325,12 @@ x86_64_get_active_set(void)
> 
> ms = machdep->machspec;
> 
> + if (!ms->current) {
> + error(INFO, "%s: Cannot get active set, ms->current is NULL\n",
> + __func__);
> + return;
> + }
> +

That patch just masks the real problem.

What kernel version is it?

If it's 2.6.30 or later, then x86_64_per_cpu_init() should
be called, otherwise x86_64_cpu_pda_init() is called.  And
whichever one that gets called should allocate the array.
  
2.6.30 or later kernels should show:

   crash> struct x8664_pda
   struct: invalid data structure reference: x8664_pda
   crash>

and they will use x86_64_per_cpu_init().
  
Kernels prior to 2.6.30 should show:
  
  crash> struct x8664_pda
  struct x8664_pda {
      struct task_struct *pcurrent;
      long unsigned int data_offset;
      long unsigned int kernelstack;
      long unsigned int oldrsp;
      long unsigned int debugstack;
      int irqcount;
      int cpunumber;
      char *irqstackptr;
      int nodenumber;
      unsigned int __softirq_pending;
      unsigned int __nmi_count;
      int mmu_state;
      struct mm_struct *active_mm;
      unsigned int apic_timer_irqs;
  }
  SIZE: 128
  crash>

and they will use x86_64_cpu_pda_init().

If you're having trouble with gdb, can you put some fprintf(fp, ...)
calls in the relevant function and find out why it isn't doing
the calloc() call?

Either that, or if you can make the vmlinux/vmcore pair available
for me to download, I can look at it.

Dave
 




More information about the Crash-utility mailing list