Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 3/3] windows_clear_solib memory leak
  2019-12-24 12:25 ` [PATCH 1/3] pe_bfd_read_buildid memory leak Hannes Domani via gdb-patches
  2019-12-24 12:25   ` [PATCH 2/3] solib_target_free_so " Hannes Domani via gdb-patches
@ 2019-12-24 12:25   ` Hannes Domani via gdb-patches
  2020-01-03 16:44     ` Tom Tromey
  2019-12-25 13:47   ` [PATCH 1/3] pe_bfd_read_buildid " Andrew Burgess
  2 siblings, 1 reply; 10+ messages in thread
From: Hannes Domani via gdb-patches @ 2019-12-24 12:25 UTC (permalink / raw)
  To: gdb-patches

gdb/ChangeLog:

2019-12-24  Hannes Domani  <ssbssa@yahoo.de>

	* windows-nat.c (windows_clear_solib): Free so_list linked list.
---
 gdb/windows-nat.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 10d5c95d09..02c4269d5a 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -940,7 +940,14 @@ catch_errors (void (*func) ())
 static void
 windows_clear_solib (void)
 {
-  solib_start.next = NULL;
+  struct so_list *so;
+
+  for (so = solib_start.next; so; so = solib_start.next)
+    {
+      solib_start.next = so->next;
+      windows_free_so (so);
+    }
+
   solib_end = &solib_start;
 }
 
-- 
2.24.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/3] solib_target_free_so memory leak
  2019-12-24 12:25 ` [PATCH 1/3] pe_bfd_read_buildid memory leak Hannes Domani via gdb-patches
@ 2019-12-24 12:25   ` Hannes Domani via gdb-patches
  2019-12-26 22:55     ` Christian Biesinger via gdb-patches
  2019-12-24 12:25   ` [PATCH 3/3] windows_clear_solib " Hannes Domani via gdb-patches
  2019-12-25 13:47   ` [PATCH 1/3] pe_bfd_read_buildid " Andrew Burgess
  2 siblings, 1 reply; 10+ messages in thread
From: Hannes Domani via gdb-patches @ 2019-12-24 12:25 UTC (permalink / raw)
  To: gdb-patches

gdb/ChangeLog:

2019-12-24  Hannes Domani  <ssbssa@yahoo.de>

	* solib-target.c (solib_target_free_so): Free li->offsets.
---
 gdb/solib-target.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/solib-target.c b/gdb/solib-target.c
index 2b473d6066..52e2a6068b 100644
--- a/gdb/solib-target.c
+++ b/gdb/solib-target.c
@@ -293,6 +293,7 @@ solib_target_free_so (struct so_list *so)
 
   gdb_assert (li->name.empty ());
 
+  xfree (li->offsets);
   delete li;
 }
 
-- 
2.24.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] pe_bfd_read_buildid memory leak
       [not found] <20191224122452.1668-1-ssbssa.ref@yahoo.de>
@ 2019-12-24 12:25 ` Hannes Domani via gdb-patches
  2019-12-24 12:25   ` [PATCH 2/3] solib_target_free_so " Hannes Domani via gdb-patches
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hannes Domani via gdb-patches @ 2019-12-24 12:25 UTC (permalink / raw)
  To: gdb-patches

bfd/ChangeLog:

2019-12-24  Hannes Domani  <ssbssa@yahoo.de>

	* peicode.h (pe_bfd_read_buildid): Free data.
---
 bfd/peicode.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bfd/peicode.h b/bfd/peicode.h
index e9d205a01a..00ccfa0a44 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -1396,6 +1396,8 @@ pe_bfd_read_buildid (bfd *abfd)
 	  break;
 	}
     }
+
+  free (data);
 }
 
 static const bfd_target *
-- 
2.24.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] pe_bfd_read_buildid memory leak
  2019-12-24 12:25 ` [PATCH 1/3] pe_bfd_read_buildid memory leak Hannes Domani via gdb-patches
  2019-12-24 12:25   ` [PATCH 2/3] solib_target_free_so " Hannes Domani via gdb-patches
  2019-12-24 12:25   ` [PATCH 3/3] windows_clear_solib " Hannes Domani via gdb-patches
@ 2019-12-25 13:47   ` Andrew Burgess
  2019-12-25 14:14     ` Hannes Domani via gdb-patches
  2 siblings, 1 reply; 10+ messages in thread
From: Andrew Burgess @ 2019-12-25 13:47 UTC (permalink / raw)
  To: Hannes Domani; +Cc: gdb-patches

* Hannes Domani via gdb-patches <gdb-patches@sourceware.org> [2019-12-24 13:24:50 +0100]:

> bfd/ChangeLog:
> 
> 2019-12-24  Hannes Domani  <ssbssa@yahoo.de>
> 
> 	* peicode.h (pe_bfd_read_buildid): Free data.
> ---
>  bfd/peicode.h | 2 ++
>  1 file changed, 2 insertions(+)

Patches for binutils-gdb/bfd/* should be posted to the binutils list
(binutils@sourceware.org) for review.

Thanks,
Andrew


> 
> diff --git a/bfd/peicode.h b/bfd/peicode.h
> index e9d205a01a..00ccfa0a44 100644
> --- a/bfd/peicode.h
> +++ b/bfd/peicode.h
> @@ -1396,6 +1396,8 @@ pe_bfd_read_buildid (bfd *abfd)
>  	  break;
>  	}
>      }
> +
> +  free (data);
>  }
>  
>  static const bfd_target *
> -- 
> 2.24.1
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] pe_bfd_read_buildid memory leak
  2019-12-25 13:47   ` [PATCH 1/3] pe_bfd_read_buildid " Andrew Burgess
@ 2019-12-25 14:14     ` Hannes Domani via gdb-patches
  2019-12-27 16:46       ` Andrew Burgess
  0 siblings, 1 reply; 10+ messages in thread
From: Hannes Domani via gdb-patches @ 2019-12-25 14:14 UTC (permalink / raw)
  To: Gdb-patches

 Am Mittwoch, 25. Dezember 2019, 14:47:11 MEZ hat Andrew Burgess <andrew.burgess@embecosm.com> Folgendes geschrieben:

> * Hannes Domani via gdb-patches <gdb-patches@sourceware.org> [2019-12-24 13:24:50 +0100]:
>
> > bfd/ChangeLog:
> >
> > 2019-12-24  Hannes Domani  <ssbssa@yahoo.de>
> >
> >     * peicode.h (pe_bfd_read_buildid): Free data.
> > ---
> >  bfd/peicode.h | 2 ++
> >  1 file changed, 2 insertions(+)
>
> Patches for binutils-gdb/bfd/* should be posted to the binutils list
> (binutils@sourceware.org) for review.

Done.
But what about patches that change both bfd/* and gdb/*?
Send to both mailing lists?

> Thanks,
> Andrew
>
>
>
> >
> > diff --git a/bfd/peicode.h b/bfd/peicode.h
> > index e9d205a01a..00ccfa0a44 100644
> > --- a/bfd/peicode.h
> > +++ b/bfd/peicode.h
> > @@ -1396,6 +1396,8 @@ pe_bfd_read_buildid (bfd *abfd)
> >        break;
> >      }
> >      }
> > +
> > +  free (data);
> >  }
> >
> >  static const bfd_target *
> > --
> > 2.24.1
> >


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] solib_target_free_so memory leak
  2019-12-24 12:25   ` [PATCH 2/3] solib_target_free_so " Hannes Domani via gdb-patches
@ 2019-12-26 22:55     ` Christian Biesinger via gdb-patches
  2020-01-03 16:41       ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Biesinger via gdb-patches @ 2019-12-26 22:55 UTC (permalink / raw)
  To: Hannes Domani; +Cc: gdb-patches

On Tue, Dec 24, 2019 at 1:25 PM Hannes Domani via gdb-patches
<gdb-patches@sourceware.org> wrote:
>
> gdb/ChangeLog:
>
> 2019-12-24  Hannes Domani  <ssbssa@yahoo.de>
>
>         * solib-target.c (solib_target_free_so): Free li->offsets.
> ---
>  gdb/solib-target.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gdb/solib-target.c b/gdb/solib-target.c
> index 2b473d6066..52e2a6068b 100644
> --- a/gdb/solib-target.c
> +++ b/gdb/solib-target.c
> @@ -293,6 +293,7 @@ solib_target_free_so (struct so_list *so)
>
>    gdb_assert (li->name.empty ());
>
> +  xfree (li->offsets);
>    delete li;

Maybe a better fix would be to change offsets to be a unique_xmalloc_ptr?

Christian


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] pe_bfd_read_buildid memory leak
  2019-12-25 14:14     ` Hannes Domani via gdb-patches
@ 2019-12-27 16:46       ` Andrew Burgess
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Burgess @ 2019-12-27 16:46 UTC (permalink / raw)
  To: Hannes Domani; +Cc: Gdb-patches

* Hannes Domani via gdb-patches <gdb-patches@sourceware.org> [2019-12-25 14:13:59 +0000]:

>  Am Mittwoch, 25. Dezember 2019, 14:47:11 MEZ hat Andrew Burgess <andrew.burgess@embecosm.com> Folgendes geschrieben:
> 
> > * Hannes Domani via gdb-patches <gdb-patches@sourceware.org> [2019-12-24 13:24:50 +0100]:
> >
> > > bfd/ChangeLog:
> > >
> > > 2019-12-24  Hannes Domani  <ssbssa@yahoo.de>
> > >
> > >     * peicode.h (pe_bfd_read_buildid): Free data.
> > > ---
> > >  bfd/peicode.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> >
> > Patches for binutils-gdb/bfd/* should be posted to the binutils list
> > (binutils@sourceware.org) for review.
> 
> Done.
> But what about patches that change both bfd/* and gdb/*?
> Send to both mailing lists?

Absolutely, if they really can't be split into two parts then just
post to both lists.

Thanks,
Andrew


> 
> > Thanks,
> > Andrew
> >
> >
> >
> > >
> > > diff --git a/bfd/peicode.h b/bfd/peicode.h
> > > index e9d205a01a..00ccfa0a44 100644
> > > --- a/bfd/peicode.h
> > > +++ b/bfd/peicode.h
> > > @@ -1396,6 +1396,8 @@ pe_bfd_read_buildid (bfd *abfd)
> > >        break;
> > >      }
> > >      }
> > > +
> > > +  free (data);
> > >  }
> > >
> > >  static const bfd_target *
> > > --
> > > 2.24.1
> > >
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] solib_target_free_so memory leak
  2019-12-26 22:55     ` Christian Biesinger via gdb-patches
@ 2020-01-03 16:41       ` Tom Tromey
  2020-01-03 16:47         ` Hannes Domani via gdb-patches
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2020-01-03 16:41 UTC (permalink / raw)
  To: Christian Biesinger via gdb-patches; +Cc: Hannes Domani, Christian Biesinger

>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:

>> +  xfree (li->offsets);
>> delete li;

Christian> Maybe a better fix would be to change offsets to be a
Christian> unique_xmalloc_ptr?

Makes sense to me.

thanks,
Tom


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] windows_clear_solib memory leak
  2019-12-24 12:25   ` [PATCH 3/3] windows_clear_solib " Hannes Domani via gdb-patches
@ 2020-01-03 16:44     ` Tom Tromey
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2020-01-03 16:44 UTC (permalink / raw)
  To: Hannes Domani via gdb-patches; +Cc: Hannes Domani

>>>>> "Hannes" == Hannes Domani via gdb-patches <gdb-patches@sourceware.org> writes:

Hannes> gdb/ChangeLog:
Hannes> 2019-12-24  Hannes Domani  <ssbssa@yahoo.de>

Hannes> 	* windows-nat.c (windows_clear_solib): Free so_list linked list.

Thanks, this is ok.

Tom


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] solib_target_free_so memory leak
  2020-01-03 16:41       ` Tom Tromey
@ 2020-01-03 16:47         ` Hannes Domani via gdb-patches
  0 siblings, 0 replies; 10+ messages in thread
From: Hannes Domani via gdb-patches @ 2020-01-03 16:47 UTC (permalink / raw)
  To: Gdb-patches

 Am Freitag, 3. Januar 2020, 17:41:21 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:

> >>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:
>
>
> >> +  xfree (li->offsets);
> >> delete li;
>
>
> Christian> Maybe a better fix would be to change offsets to be a
> Christian> unique_xmalloc_ptr?
>
> Makes sense to me.

I've sent a v2 for this here:
https://sourceware.org/ml/gdb-patches/2019-12/msg01034.html


Regards
Hannes Domani


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-03 16:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191224122452.1668-1-ssbssa.ref@yahoo.de>
2019-12-24 12:25 ` [PATCH 1/3] pe_bfd_read_buildid memory leak Hannes Domani via gdb-patches
2019-12-24 12:25   ` [PATCH 2/3] solib_target_free_so " Hannes Domani via gdb-patches
2019-12-26 22:55     ` Christian Biesinger via gdb-patches
2020-01-03 16:41       ` Tom Tromey
2020-01-03 16:47         ` Hannes Domani via gdb-patches
2019-12-24 12:25   ` [PATCH 3/3] windows_clear_solib " Hannes Domani via gdb-patches
2020-01-03 16:44     ` Tom Tromey
2019-12-25 13:47   ` [PATCH 1/3] pe_bfd_read_buildid " Andrew Burgess
2019-12-25 14:14     ` Hannes Domani via gdb-patches
2019-12-27 16:46       ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox