Re: Questions about ptrace on a dying process

From: Tim Bird
Date: Thu Mar 01 2012 - 13:18:38 EST


On 02/29/2012 11:12 PM, Denys Vlasenko wrote:
> On Wednesday 29 February 2012 21:45, Tim Bird wrote:
>> This is on embedded systems, where the dump is not saved. The dump
>> is available via stdin to the core pipe handler, but it would be
>> kind of a pain to wrapper that for random access, which is needed
>> for stuff like stack unwinding.
>
> Stack unwinding only requires the stack data and knowledge
> of the mapped binary and library files. You can parse coredump's ELF header,
> and skip all sizable data segments which you won't need anyway.
>
> I estimate that usually you will need to save only ~150k of data
> in order to produce a stacktrace, and even then,
> only because Linux pre-allocates ridiculously large
> stack for every new process - 132k. It can easily be reduced
> to something saner with one-line patch.

My budget for each crash report is about 8k. I have to do
the unwind at the time of the crash (on target) (and without
symbols - these are added later on a host). Given the other
stuff I want to save, saving the whole stack is usually not
an option, and saving a coredump is out of the question.
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation
Senior Staff Engineer, Sony Network Entertainment
=============================

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/