All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] native: Avoid double release on queue/heap auto-cleanup
Date: Thu, 22 Oct 2009 12:30:14 +0200	[thread overview]
Message-ID: <4AE03436.8020809@domain.hid> (raw)
In-Reply-To: <20091020113726.9069.91437.stgit@domain.hid>

Jan Kiszka wrote:
> We are currently leaking user space heap/queue objects when the owner
> terminates without deleting them before. Fix it by releasing the objects
> in the corresponding cleanup callbacks which are also called on owner
> termination.

Just realized that we need this patch in addition:

------------>

Commit 3a7330b164 also requires this patch to avoid that the queue and
heap objects are released twice on automatic cleanup (via the xnheap
release handler and via the ppd object queue flush).

Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---

 include/native/heap.h  |    2 +-
 include/native/queue.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/native/heap.h b/include/native/heap.h
index 5444a43..0c2a7a2 100644
--- a/include/native/heap.h
+++ b/include/native/heap.h
@@ -117,7 +117,7 @@ void __native_heap_pkg_cleanup(void);
 
 static inline void __native_heap_flush_rq(xnqueue_t *rq)
 {
-	xeno_flush_rq(RT_HEAP, rq, heap);
+	xeno_flush_rq_norelease(RT_HEAP, rq, heap);
 }
 
 int rt_heap_delete_inner(RT_HEAP *heap,
diff --git a/include/native/queue.h b/include/native/queue.h
index 77925c2..2951c42 100644
--- a/include/native/queue.h
+++ b/include/native/queue.h
@@ -129,7 +129,7 @@ void __native_queue_pkg_cleanup(void);
 
 static inline void __native_queue_flush_rq(xnqueue_t *rq)
 {
-	xeno_flush_rq(RT_QUEUE, rq, queue);
+	xeno_flush_rq_norelease(RT_QUEUE, rq, queue);
 }
 
 ssize_t rt_queue_receive_inner(RT_QUEUE *q, void **bufp,


      reply	other threads:[~2009-10-22 10:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 11:37 [Xenomai-core] [PATCH v3 0/9] heap setup/cleanup fixes, refactorings & more Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 3/9] nucleus: Fix race window in heap mapping procedure Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 4/9] nucleus: xnheap_destroy does not fail Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 2/9] nucleus: Use Linux spin lock for heap list management Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 1/9] native: Release fastlock to the proper heap Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 5/9] nucleus: Avoid returning errors from xnheap_destroy_mapped Jan Kiszka
2009-10-24 17:22   ` Philippe Gerum
2009-11-02 16:04     ` Philippe Gerum
2009-11-02 16:41       ` Jan Kiszka
2009-11-02 16:51         ` Philippe Gerum
2009-11-02 16:57           ` Jan Kiszka
2009-11-02 18:01             ` Jan Kiszka
2009-11-02 18:19               ` [Xenomai-help] Xenomai on ARMadeus Pierre Ficheux
2009-11-02 18:22                 ` Gilles Chanteperdrix
2009-11-02 18:38                 ` Gilles Chanteperdrix
2009-11-02 19:19                   ` gwenhael.goavec
2009-11-02 22:29                     ` Gilles Chanteperdrix
2009-11-03  7:36                       ` gwenhael.goavec
     [not found]                       ` <20091103082204.248eed59@domain.hid>
2009-11-04 13:14                         ` Gilles Chanteperdrix
     [not found]                           ` <fbc4f538a6f4d84cfe514aba0985a525.squirrel@domain.hid>
2009-11-12 14:59                             ` Gilles Chanteperdrix
2009-11-02 18:26               ` [Xenomai-core] [PATCH v3 5/9] nucleus: Avoid returning errors from xnheap_destroy_mapped Philippe Gerum
2009-11-03  8:26                 ` Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 6/9] rtai: Try to fix _shm_free Jan Kiszka
2009-10-24 17:25   ` Philippe Gerum
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 7/9] native: Do not requeue on auto-cleanup errors Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 9/9] nucleus: Include all heaps in statistics Jan Kiszka
2009-10-20 23:41   ` Philippe Gerum
2009-10-22 10:52     ` Jan Kiszka
2009-11-11 12:59       ` Jan Kiszka
2009-11-15 17:38         ` Philippe Gerum
2009-11-16 12:38           ` Jan Kiszka
2009-10-20 11:37 ` [Xenomai-core] [PATCH v3 8/9] native: Fix memory leak on heap/queue auto-deletion Jan Kiszka
2009-10-22 10:30   ` Jan Kiszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AE03436.8020809@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.