cplus-demangler, free resource after a failed call to gnu_special.

Message ID 87a9aavxdr.fsf@kepler.schwinge.homeip.net
State Committed
Headers

Commit Message

Thomas Schwinge May 22, 2014, 11:57 a.m. UTC
  Hi!

On Wed, 14 May 2014 15:20:16 +0100, Gary Benson <gbenson@redhat.com> wrote:
> Andrew Burgess wrote:
> > On 14/05/2014 10:01 AM, Gary Benson wrote:
> > > Ian Lance Taylor wrote:
> > > > Andrew Burgess <aburgess@broadcom.com> wrote:
> > > > > On 09/05/2014 9:53 PM, Ian Lance Taylor wrote:
> > > > > > Andrew Burgess <aburgess@broadcom.com> wrote:
> > > > > > >        if ((AUTO_DEMANGLING || GNU_DEMANGLING))
> > > > > > >         {
> > > > > > >           success = gnu_special (work, &mangled, &decl);
> > > > > > > +          if (!success)
> > > > > > > +            {
> > > > > > > +              delete_work_stuff (work);
> > > > > > > +              string_delete (&decl);
> > > > > > > +            }
> > > > > >
> > > >
> > > > This patch is OK.
> > > 
> > > Andrew, would you like me to commit this?
> > 
> > Yes please.
> 
> Done:
> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=210425

In GCC, I'm consistenly seeing the following new failure:

    ./test-demangle < ../../../source/libiberty/testsuite/demangle-expected
    FAIL at line 4350, options --format=auto --no-params:
    in:  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
    out: (null)
    exp: 
    ./test-demangle: 895 tests, 1 failures
    make[2]: *** [check-cplus-dem] Error 1

The patch was committed incompletely; I added the missing last line in
r210803:

commit 8207b6a22d5955c41109399cb09f0af661a593ea
Author:     tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
AuthorDate: Thu May 22 11:56:45 2014 +0000
Commit:     tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
CommitDate: Thu May 22 11:56:45 2014 +0000

    Fix test in libiberty/testsuite/demangle-expected.
    
    	libiberty/
    	* testsuite/demangle-expected: Fix last commit.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210803 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libiberty/ChangeLog                   | 4 ++++
 libiberty/testsuite/demangle-expected | 1 +
 2 files changed, 5 insertions(+)



Grüße,
 Thomas
  

Comments

Gary Benson May 22, 2014, 4:02 p.m. UTC | #1
Hi Thomas,

Thomas Schwinge wrote:
> In GCC, I'm consistenly seeing the following new failure:
> 
>     ./test-demangle < ../../../source/libiberty/testsuite/demangle-expected
>     FAIL at line 4350, options --format=auto --no-params:
>     in:  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
>     out: (null)
>     exp: 
>     ./test-demangle: 895 tests, 1 failures
>     make[2]: *** [check-cplus-dem] Error 1
> 
> The patch was committed incompletely; I added the missing last line in
> r210803:
[snip]
> @@ -4347,3 +4347,4 @@ void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std
>  --format=auto --no-params
>  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
>  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> +_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z

I thought that extra line was a mistake; I thought each test was
precisely three lines:

  # options
  # input to be demangled
  # expected output

What is the extra line here?

Thanks,
Gary
  
Thomas Schwinge May 22, 2014, 4:12 p.m. UTC | #2
Hi Gary!

On Thu, 22 May 2014 17:02:08 +0100, Gary Benson <gbenson@redhat.com> wrote:
> Thomas Schwinge wrote:
> > In GCC, I'm consistenly seeing the following new failure:
> > 
> >     ./test-demangle < ../../../source/libiberty/testsuite/demangle-expected
> >     FAIL at line 4350, options --format=auto --no-params:
> >     in:  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> >     out: (null)
> >     exp: 
> >     ./test-demangle: 895 tests, 1 failures
> >     make[2]: *** [check-cplus-dem] Error 1
> > 
> > The patch was committed incompletely; I added the missing last line in
> > r210803:
> [snip]
> > @@ -4347,3 +4347,4 @@ void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std
> >  --format=auto --no-params
> >  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> >  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> > +_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> 
> I thought that extra line was a mistake; I thought each test was
> precisely three lines:
> 
>   # options
>   # input to be demangled
>   # expected output
> 
> What is the extra line here?

I too had to look it up -- see the explanation at the beginning of the
file:

    #    --no-params         There are two lines of expected output; the first
    #                        is with DMGL_PARAMS, the second is without it.


Grüße,
 Thomas
  
Gary Benson May 22, 2014, 7:34 p.m. UTC | #3
Thomas Schwinge wrote:
> On Thu, 22 May 2014 17:02:08 +0100, Gary Benson <gbenson@redhat.com> wrote:
> > Thomas Schwinge wrote:
> > > In GCC, I'm consistenly seeing the following new failure:
> > > 
> > >     ./test-demangle < ../../../source/libiberty/testsuite/demangle-expected
> > >     FAIL at line 4350, options --format=auto --no-params:
> > >     in:  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> > >     out: (null)
> > >     exp: 
> > >     ./test-demangle: 895 tests, 1 failures
> > >     make[2]: *** [check-cplus-dem] Error 1
> > > 
> > > The patch was committed incompletely; I added the missing last line in
> > > r210803:
> > [snip]
> > > @@ -4347,3 +4347,4 @@ void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std
> > >  --format=auto --no-params
> > >  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> > >  _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> > > +_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
> > 
> > I thought that extra line was a mistake; I thought each test was
> > precisely three lines:
> > 
> >   # options
> >   # input to be demangled
> >   # expected output
> > 
> > What is the extra line here?
> 
> I too had to look it up -- see the explanation at the beginning of
> the file:
> 
>     #    --no-params         There are two lines of expected output; the first
>     #                        is with DMGL_PARAMS, the second is without it.

Ah, I missed that.  Thank you for fixing this!

Gary

--
http://gbenson.net/
  
Pedro Alves May 28, 2014, 10:16 p.m. UTC | #4
On 05/22/2014 12:57 PM, Thomas Schwinge wrote:
> On Wed, 14 May 2014 15:20:16 +0100, Gary Benson <gbenson@redhat.com> wrote:
>> Andrew Burgess wrote:
>>> On 14/05/2014 10:01 AM, Gary Benson wrote:
>>>> Ian Lance Taylor wrote:
>>>>> This patch is OK.
>>>>
>>>> Andrew, would you like me to commit this?
>>>
>>> Yes please.
>>
>> Done:
>> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=210425
> 
...

>     Fix test in libiberty/testsuite/demangle-expected.
>     
>     	libiberty/
>     	* testsuite/demangle-expected: Fix last commit.

Thanks.

I've merged this and Andrew's patch to the binutils-gdb git repo.
  

Patch

diff --git libiberty/ChangeLog libiberty/ChangeLog
index 7156be7..7b25c7e 100644
--- libiberty/ChangeLog
+++ libiberty/ChangeLog
@@ -1,3 +1,7 @@ 
+2014-05-22  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* testsuite/demangle-expected: Fix last commit.
+
 2014-05-14  Andrew Burgess  <aburgess@broadcom.com>
 
 	* cplus-dmem.c (internal_cplus_demangle): Free any resources
diff --git libiberty/testsuite/demangle-expected libiberty/testsuite/demangle-expected
index 823a1c4..864ee7e 100644
--- libiberty/testsuite/demangle-expected
+++ libiberty/testsuite/demangle-expected
@@ -4347,3 +4347,4 @@  void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std
 --format=auto --no-params
 _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
 _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z