Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Pedro Alves <palves@redhat.com>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>,
	<gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix crash when loading a core with unexpected register section size
Date: Thu, 26 Jan 2017 15:27:00 -0000	[thread overview]
Message-ID: <wwok60l17sfw.fsf@ericsson.com> (raw)
In-Reply-To: <379390ed-98c6-fb7b-b217-b768e435bf5e@redhat.com>


Pedro Alves writes:

> On 01/26/2017 02:59 PM, Antoine Tremblay wrote:
>> 
>
>>>> Ho yes, see v2, I added "For example arch-arm." Like you suggested.
>>>
>>> Eh, "arch-" in "arch-foo" was just meant to show I was talking
>>> about an arch.  I didn't mean for you to keep the "arch-" part.  :-)
>> 
>> hehe I figured but wasn't sure. I'll just say arm.
>
> The right name is uppercase "ARM".  ;-)
>

Right right :)

>>> So basically, we could have a testcase that dumps a file, and then
>>> loads with back with no executable loaded?  Do we really not
>>> have such a testcase yet?
>>>
>> 
>> Not exactly if it was that simple it would have been catched by
>> gdb.base/corefile.exp
>> 
>> The problem is that this triggers only if the core file register section
>> is larger than expected. And if you just create a core and read it the
>> register section is ok.
>> 
>> However crafting a core with this problem is non-trivial at least to my
>> current knowledge.
>
> This is all information that would have been very handy to have
> in the submission upfront.  Please put it in the commit log.
> OK with that change.

OK

>
> One piece of info missing is why didn't GDB figure out this is
> a Linux core anyway, assuming it's a Linux core dump.
>
> I think the answer is that there's no ".note.ABI-tag"/NT_GNU_ABI_TAG
> section/note in core dumps.   I think we could teach 
> generic_elf_osabi_sniff_abi_tag_sections about detecting
> presence of ".note.linuxcore" sections:
>
>  $ objdump -h ./testsuite/core.7452  
>  [...]
>    3 .note.linuxcore.siginfo/7452 00000080  0000000000000000  0000000000000000  0000075c  2**2
>  [...]
>
> And then we'd end up with a gdbarch that has
> arm_linux_iterate_over_regset_sections installed, and thus no
> crash.
>

Quite interesting, I'll investigate that and see if we can submit an
improvement along those lines. Thanks!



  reply	other threads:[~2017-01-26 15:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 13:17 Antoine Tremblay
2017-01-26 13:40 ` Pedro Alves
2017-01-26 13:56   ` Antoine Tremblay
2017-01-26 13:59     ` [PATCH v2] " Antoine Tremblay
2017-01-26 14:25     ` [PATCH] " Pedro Alves
2017-01-26 14:31       ` Antoine Tremblay
2017-01-26 14:35         ` Pedro Alves
2017-01-26 14:59           ` Antoine Tremblay
2017-01-26 15:20             ` Pedro Alves
2017-01-26 15:27               ` Antoine Tremblay [this message]
2017-01-26 15:53               ` [pushed][PATCH v2] " Antoine Tremblay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wwok60l17sfw.fsf@ericsson.com \
    --to=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox