Date: Thu, 23 Jun 2005 17:45:14 -0700 From: Marcel Moolenaar <marcel@xcllnt.net> To: Howard <howardsue@gmail.com> Cc: freebsd-arch@freebsd.org Subject: Re: How to get stack from every thread when doing crash dump? Message-ID: <947299be8f3206c1a165c67af5c44d16@xcllnt.net> In-Reply-To: <1e89cd5105062317397399075e@mail.gmail.com> References: <20050623102024.GA89874@frontfree.net> <b7c2cad4fe3d363722ecaed9f1e502e7@xcllnt.net> <1e89cd5105062317397399075e@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 23, 2005, at 5:39 PM, Howard wrote: > 2005/6/24, Marcel Moolenaar <marcel@xcllnt.net>: On Jun 23, 2005, at=20= > 3:20 AM, Xin LI wrote: >> >> > One problem with the mini-dump is that, since the mini-dump=20 >> utilizes: >> >=A0=A0=A0=A0=A0=A0 dump_write((char *)curthread->td_kstack,=20 >> curthread->td_kstack_pages * >> > PAGE_SIZE); >> > >> > To write out the stack, and at the point before exception.S,=20 >> curthread >> > has >> > been changed, we can only obtain the stack from the current thread, >> > which >> > may not be enough for analyzing the backtrace.=A0=A0What can we do = to >> > improve >> > this situation? >> >> You can iterate over all the threads. Take a look at >> =A0=A0=A0=A0=A0=A0 src/sys/kern/subr_kdb.c >> or >> =A0=A0=A0=A0=A0=A0 src/gnu/usr.bin/gdb/kgdb/kthr.c >> >> In particular: >> Use the list of all processes (allproc) to iterate over the >> processeses and for each process walk the list of threads >> and for each thread dump the stack, registers and other data.=A0 > However is dumping the td_kstack_pages enough to get one thread's=20 > stack? We found the stack is not completed. What do you mean with "not completed"? --=20 Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?947299be8f3206c1a165c67af5c44d16>