From patchwork Tue Jul 26 17:08:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 106895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D4523B6F7E for ; Wed, 27 Jul 2011 03:09:04 +1000 (EST) Received: (qmail 26248 invoked by alias); 26 Jul 2011 17:09:01 -0000 Received: (qmail 26239 invoked by uid 22791); 26 Jul 2011 17:09:00 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Jul 2011 17:08:45 +0000 Received: by qwh5 with SMTP id 5so368371qwh.20 for ; Tue, 26 Jul 2011 10:08:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.191.10 with SMTP id dk10mr4075787qab.170.1311700124673; Tue, 26 Jul 2011 10:08:44 -0700 (PDT) Received: by 10.229.98.193 with HTTP; Tue, 26 Jul 2011 10:08:44 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Jul 2011 10:08:44 -0700 Message-ID: Subject: Re: Patch committed: Fix demangler crash From: "H.J. Lu" To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, jason@redhat.com X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Tue, Jul 26, 2011 at 9:46 AM, H.J. Lu wrote: > On Tue, Jul 26, 2011 at 7:30 AM, Ian Lance Taylor wrote: >> binutils PR 13030 reports a demangler crash on the symbol >>    _ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ >> >> As far as I can tell, this symbol is invalid.  The final T0_ refers to >> template argument 1, but this zero-based index has no referent since the >> template only has one parameter.  This of course suggests a compiler >> bug.  CC'ing Jason because this involves template packs which I haven't >> looked into very much. >> >> I committed this patch to avoid the crash in the demangler. >> >> Ian >> >> >> 2011-07-26  Ian Lance Taylor   >> >>        * cp-demangle.c (d_print_init): Initialize pack_index field. >>        (d_print_comp): Check for NULL template argument. >>        * testsuite/demangle-expected: Add test case. >> >> >> > > I think it caused: > > FAIL at line 4023: unknown demangling style > _ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ > FAIL at line 4027: unknown demangling style yz.qrs > FAIL at line 4031: unknown demangling style oper."+" > FAIL at line 4035: unknown demangling style yz.qrs > FAIL at line 4039: unknown demangling style yz.qrs.tuv > FAIL at line 4042: unknown demangling style yz.qrs.tuv > FAIL at line 4045: unknown demangling style yz.qrs.tuv > FAIL at line 4049: unknown demangling style yz.qrs.tuv > FAIL at line 4053: unknown demangling style > FAIL at line 4056: unknown demangling style x.m1 > FAIL at line 4059: unknown demangling style x.m3 > FAIL at line 4062: unknown demangling style x.y.m2 > FAIL at line 4066: unknown demangling style x.y.z.r > FAIL at line 4070: unknown demangling style x.y.j > FAIL at line 4074: unknown demangling style x.m3 > FAIL at line 4078: unknown demangling style p'Elab_Body > FAIL at line 4082: unknown demangling style p'Elab_Spec > FAIL at line 4086: unknown demangling style p.taskobj > FAIL at line 4090: unknown demangling style p.taskobj.f1 > FAIL at line 4093: unknown demangling style prot.lock.get > FAIL at line 4096: unknown demangling style prot.lock.get > FAIL at line 4099: unknown demangling style prot.lock.get.sub > FAIL at line 4102: unknown demangling style prot.lock.set > FAIL at line 4106: unknown demangling style prot.lock.set > FAIL at line 4109: unknown demangling style prot.lock.update > FAIL at line 4113: unknown demangling style prot.lock.update > FAIL at line 4116: unknown demangling style > gnat.sockets.sockets_library_controller.Finalize > FAIL at line 4120: unknown demangling style > system.partition_interface.racw_stub_type.Adjust > FAIL at line 4123: unknown demangling style > gnat.wide_wide_string_split.slice_set'Read > FAIL at line 4126: unknown demangling style > ada.real_time.timing_events.events.list'Write > FAIL at line 4129: unknown demangling style > system.finalization_root.root_controlled'Input > FAIL at line 4133: unknown demangling style > ada.finalization.limited_controlled'Output > FAIL at line 4136: unknown demangling style ada.synchronous_task_control'Size > FAIL at line 4139: unknown demangling style > ada.real_time.timing_events.events'Alignment > FAIL at line 4144: unknown demangling style system.finalization_root.":=" > FAIL at line 4149: unknown demangling style DFA > FAIL at line 4152: unknown demangling style > Psi::VariantDetail::SelectVisitorResult const*)#2}&, VariantTest::TestVisit::test_method()::{lambda(char)#3}&, > VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&>::type > Psi::Variant const*>::visit VariantTest::TestVisit::test_method()::{lambda(char)#3}&, > VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&>((VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&)...) > > on Linux/ia32. > I checked in this as an obvious fix. diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 1ceb0ee..2c5b761 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2011-07-26 H.J. Lu + + * testsuite/demangle-expected: Remove an extra line. + 2011-07-26 Ian Lance Taylor * cp-demangle.c (d_print_init): Initialize pack_index field. diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index d3e7099..f9e8447 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4014,7 +4014,6 @@ K<1, &S::m>::f() --format=gnu-v3 _ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ _ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ -_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ # # Ada (GNAT) tests. #