Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jun 2005 18:15:43 -0700
From:      Peter Wemm <peter@wemm.org>
To:        freebsd-arch@freebsd.org
Cc:        howardsue@gmail.com
Subject:   Re: How to get stack from every thread when doing crash dump?
Message-ID:  <200506231815.44052.peter@wemm.org>
In-Reply-To: <20050623102024.GA89874@frontfree.net>
References:  <20050623102024.GA89874@frontfree.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 23 June 2005 03:20 am, Xin LI wrote:
> Dear folks,
>
> Recently I was working with a friend to figure out whether we can do
> more on our crashdump mechanism, as dumping the whole core memory is
> a painful process when you have some gigabytes of RAM.  Finally, we
> have implemented an experimental mini-dump on our local development
> tree, and adopted some IA64 MD dump code to provide a MI interface to
> handle dumping.  A proof-of- concept patchset is included (see
> below).  As a side note,
>
> One problem with the mini-dump is that, since the mini-dump utilizes:
> 	dump_write((char *)curthread->td_kstack, curthread->td_kstack_pages
> * PAGE_SIZE);
>
> To write out the stack, and at the point before exception.S,
> curthread has been changed, we can only obtain the stack from the
> current thread, which may not be enough for analyzing the backtrace. 
> What can we do to improve this situation?

As Marcel suggested, this really needs all the kernel stacks from all 
threads to be truely useful.

But I wonder if what you're running into is possibly a result of gdb not 
parsing the stack frames from exception.s?  We do not emit any dwarf2 
call frame information for any assembler code, and gdb6 is dwarf2 
based.   And since it is dwarf2 based, during the last cleanups the gdb 
developers did, they removed (or moved) the places that we used to 
insert stack frame sniffers to cope with crossing the nonstandard 
assembler stack frames.  As a result, we don't generally show traces 
that cross exceptions any more.

If that is the problem you're seeing, then the fix is that somebody 
needs to annotate the *.s and *.S files with .cfa_* pseudo-ops so that 
dwarf2 frame descriptors are emitted for a -g kernel.  This is 
non-trivial though.

> Thanks in advance!
>
> ---------------------------------------------------------------------
>----- BTW:  A proof-of-concept patchset is in the attachment, which
> implements mini-dump, and adopted the MD code from IA64 dump by
> turning them to MI interfaces.  At this time, the idea that peter@
> has commented this morning has not implemented (yet), and we need to
> do more style cleanups on the code.

Yes, there is lots of work still to do there. :-)

-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506231815.44052.peter>