Message ID | CAB=4xhoR0=ZaDot6rEaVhhEAxYeoBjP89AHhxgD52ANKKrDYJg@mail.gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 104730 invoked by alias); 29 May 2015 00:21:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 104719 invoked by uid 89); 29 May 2015 00:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ig0-f180.google.com Received: from mail-ig0-f180.google.com (HELO mail-ig0-f180.google.com) (209.85.213.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 29 May 2015 00:21:55 +0000 Received: by igbpi8 with SMTP id pi8so2201656igb.1 for <gdb-patches@sourceware.org>; Thu, 28 May 2015 17:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=3WgvQi+LLRRyOvY7UZ957G9bZV1rD9pyANgdlT4is4c=; b=KkUsDphQMT+MysSXoERqrSAFgIHxN0v5GRiz4EIjEN6jV1eIRyDcy9DKI7pHAQHyww iXX801p0ZIfD7zo71fvvTpm9MFR9147oS+NtY1tyweHFfF4Msr6gFtj7QPSWhKjjHCQn m1AesD4Ru7jdYoaOhv421QQ7dueSEkGxQb/OKVKHv841MJ7O2U7UHfyGk9u928wTsFmn CXbLsMG4lQeXM+bMGXWwzZ3ihWmuUUtOYU1WYLABWwiAjxhSW9bV/7NFh0oZy0U2rhuU Pj6609uzq+3DdmL0bHoXMbCRVZexyIRV/uKeV46iJQiNZVnOAL2Kb3RNgzPM1dbMrv+y yt9w== X-Gm-Message-State: ALoCoQloonGl0hgcd3nNHfMpazitaSMifkmdFwtz2x+Pf2kPPmYuHy26XS7cTdLHgdCBUqGUvxyu X-Received: by 10.42.110.66 with SMTP id o2mr12655709icp.54.1432858912963; Thu, 28 May 2015 17:21:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.105.197 with HTTP; Thu, 28 May 2015 17:21:32 -0700 (PDT) From: Roland McGrath <mcgrathr@google.com> Date: Thu, 28 May 2015 17:21:32 -0700 Message-ID: <CAB=4xhoR0=ZaDot6rEaVhhEAxYeoBjP89AHhxgD52ANKKrDYJg@mail.gmail.com> Subject: [PATCH users/roland/osabi-assert] Do not crash on unrecognized GNU .note.ABI-tag values To: GDB <gdb-patches@sourceware.org> Content-Type: text/plain; charset=UTF-8 |
Commit Message
Roland McGrath
May 29, 2015, 12:21 a.m. UTC
Diagnosis of unexpected input (in this case, in an executable file) should not crash as if it were a bug in GDB. This one is especially harmless, since the "osabi" has so little effect on anything. OK for trunk and 7.9 branch? Thanks, Roland gdb/ 2015-05-28 Roland McGrath <mcgrathr@google.com> * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning rather than internal_error for an unrecognized value. }
Comments
On 05/29/2015 01:21 AM, Roland McGrath wrote: > Diagnosis of unexpected input (in this case, in an executable file) > should not crash as if it were a bug in GDB. Indeed. > This one is especially > harmless, since the "osabi" has so little effect on anything. It's used to pick the right gdbarch for the inferior. > > OK for trunk and 7.9 branch? In order to get this into a release branch, the protocol is to file a PR and then once fixed, list the fix in the release page in the wiki: https://sourceware.org/gdb/wiki/GDB_7.9_Release That helps the release manager build the release notes. > gdb/ > 2015-05-28 Roland McGrath <mcgrathr@google.com> > > * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Use warning > rather than internal_error for an unrecognized value. > > diff --git a/gdb/osabi.c b/gdb/osabi.c > index 9d90c55..abf4bd4 100644 > --- a/gdb/osabi.c > +++ b/gdb/osabi.c > @@ -493,10 +493,9 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd > *abfd, asection *sect, void *obj) > break; > > default: > - internal_error (__FILE__, __LINE__, > - _("generic_elf_osabi_sniff_abi_tag_sections: " > - "unknown OS number %d"), > - abi_tag); > + warning ("GNU ABI tag value %u unrecognized.\n", abi_tag); Wrap string in _(). Indentation looks odd. tabs vs spaces? (We use tabs in gdb.) > + *osabi = GDB_OSABI_UNKNOWN; This line is not necessary. It if were, we'd need to do the same in the other two paths that don't match anything in this function too. OK with those fixed. > + break; > } > return; > } Thanks, Pedro Alves
On Fri, May 29, 2015 at 3:07 AM, Pedro Alves <palves@redhat.com> wrote: > On 05/29/2015 01:21 AM, Roland McGrath wrote: >> Diagnosis of unexpected input (in this case, in an executable file) >> should not crash as if it were a bug in GDB. >>... >> + warning ("GNU ABI tag value %u unrecognized.\n", abi_tag); > > Wrap string in _(). No trailing \n too, right?
On 05/29/2015 05:26 PM, Doug Evans wrote: > On Fri, May 29, 2015 at 3:07 AM, Pedro Alves <palves@redhat.com> wrote: >> On 05/29/2015 01:21 AM, Roland McGrath wrote: >>> Diagnosis of unexpected input (in this case, in an executable file) >>> should not crash as if it were a bug in GDB. >>> ... >>> + warning ("GNU ABI tag value %u unrecognized.\n", abi_tag); >> >> Wrap string in _(). > > No trailing \n too, right? Right. Thanks, Pedro Alves
diff --git a/gdb/osabi.c b/gdb/osabi.c index 9d90c55..abf4bd4 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -493,10 +493,9 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) break; default: - internal_error (__FILE__, __LINE__, - _("generic_elf_osabi_sniff_abi_tag_sections: " - "unknown OS number %d"), - abi_tag); + warning ("GNU ABI tag value %u unrecognized.\n", abi_tag); + *osabi = GDB_OSABI_UNKNOWN; + break; } return;