public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PING: [PATCH] release the sorted FDE array when deregistering a frame [PR109685]
@ 2023-05-12 15:19 Thomas Neumann
  2023-05-19 17:26 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Neumann @ 2023-05-12 15:19 UTC (permalink / raw)
  To: gcc-patches

Summary: The old linear scan logic called free while searching the list 
of frames. The atomic fast path finds the frame quickly, but forgot the 
free call. This patches adds the missing free. Bugzilla #109685.

See:
https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617245.html

Best

Thomas

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

* Re: PING: [PATCH] release the sorted FDE array when deregistering a frame [PR109685]
  2023-05-12 15:19 PING: [PATCH] release the sorted FDE array when deregistering a frame [PR109685] Thomas Neumann
@ 2023-05-19 17:26 ` Jeff Law
  2023-05-19 18:50   ` [PATCH v2] " Thomas Neumann
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2023-05-19 17:26 UTC (permalink / raw)
  To: Thomas Neumann, gcc-patches



On 5/12/23 09:19, Thomas Neumann via Gcc-patches wrote:
> Summary: The old linear scan logic called free while searching the list 
> of frames. The atomic fast path finds the frame quickly, but forgot the 
> free call. This patches adds the missing free. Bugzilla #109685.
> 
> See:
> https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617245.html
I think this needs an update given the other changes in this space.

jeff

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

* [PATCH v2] release the sorted FDE array when deregistering a frame [PR109685]
  2023-05-19 17:26 ` Jeff Law
@ 2023-05-19 18:50   ` Thomas Neumann
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Neumann @ 2023-05-19 18:50 UTC (permalink / raw)
  To: Jeff Law, gcc-patches

Am 19.05.23 um 19:26 schrieb Jeff Law:
>> See:
>> https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617245.html
> I think this needs an update given the other changes in this space.
> 
> jeff

I have included the updated the patch below.



The atomic fastpath bypasses the code that releases the sort
array which was lazily allocated during unwinding. We now
check after deregistering if there is an array to free.

libgcc/ChangeLog:
	* unwind-dw2-fde.c: Free sort array in atomic fast path.
---
  libgcc/unwind-dw2-fde.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
index a5786bf729c..32b9e64a1c8 100644
--- a/libgcc/unwind-dw2-fde.c
+++ b/libgcc/unwind-dw2-fde.c
@@ -241,6 +241,12 @@ __deregister_frame_info_bases (const void *begin)
    // And remove
    ob = btree_remove (&registered_frames, range[0]);
    bool empty_table = (range[1] - range[0]) == 0;
+
+  // Deallocate the sort array if any.
+  if (ob && ob->s.b.sorted)
+    {
+      free (ob->u.sort);
+    }
  #else
    init_object_mutex_once ();
    __gthread_mutex_lock (&object_mutex);
-- 
2.39.2



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

end of thread, other threads:[~2023-05-19 18:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 15:19 PING: [PATCH] release the sorted FDE array when deregistering a frame [PR109685] Thomas Neumann
2023-05-19 17:26 ` Jeff Law
2023-05-19 18:50   ` [PATCH v2] " Thomas Neumann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).