[minicoredumper] gdb corrupt stack

John Ogness john.ogness at linutronix.de
Thu Jul 13 09:08:30 CEST 2017


Hi Marco,

On 2017-07-12, Marco.Felsch at preh.de <Marco.Felsch at preh.de> wrote:
> So the last option to obtain the information is the core file. After
> some searching I found the location where the sp is written to the
> core file:
>
> binfmt_elf:
> static int fill_thread_core_info(struct elf_thread_core_info *t,
> 				 const struct user_regset_view *view,
> 				 long signr, size_t *total)
> {
> 	...
>
> 	fill_prstatus(&t->prstatus, t->task, signr);
> 	(void) view->regsets[0].get(t->task, &view->regsets[0], 0,
> 				    regset_size, &t->prstatus.pr_reg,
> 				    NULL);
>
> 	fill_note(&t->notes[0], "CORE", NT_PRSTATUS,
> 		  PRSTATUS_SIZE(t->prstatus, regset_size),
> 		  &t->prstatus);
>
> 	*total += notesize(&t->notes[0]);
> 	do_thread_regset_writeback(t->task, &view->regsets[0]);
>
> 	...
> }
>
> Now we have to extract this from the core-file. Are you agree with me?

I am currently traveling and won't be able to seriously look at this
until next week. But from a quick glance it looks good. minicoredumper
already does some parsing of the core file. Look for uses of
do_elf_ph_parse() to see some examples of how it is done.

John



More information about the minicoredumper mailing list