All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>
Subject: [Qemu-devel] [PATCH v2 13/13] tests: fix coroutine leak in /basic/entered
Date: Fri, 15 Dec 2017 16:06:59 +0100	[thread overview]
Message-ID: <20171215150659.1811-14-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20171215150659.1811-1-marcandre.lureau@redhat.com>

The coroutine is not finished by the time the test ends, resulting in
ASAN warning:

==7005==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 312 byte(s) in 1 object(s) allocated from:
    #0 0x7fd35290fa38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
    #1 0x7fd3506c5f75 in g_malloc0 ../glib/gmem.c:124
    #2 0x55994af03e47 in qemu_coroutine_new /home/elmarco/src/qemu/util/coroutine-ucontext.c:144
    #3 0x55994aefed99 in qemu_coroutine_create /home/elmarco/src/qemu/util/qemu-coroutine.c:76
    #4 0x55994ac1eb50 in verify_entered_step_1 /home/elmarco/src/qemu/tests/test-coroutine.c:80
    #5 0x55994af03c75 in coroutine_trampoline /home/elmarco/src/qemu/util/coroutine-ucontext.c:119
    #6 0x7fd34ec02bef  (/lib64/libc.so.6+0x50bef)

Do not yield() to let the coroutine terminate.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-coroutine.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c
index abd97c23c1..76c646107e 100644
--- a/tests/test-coroutine.c
+++ b/tests/test-coroutine.c
@@ -67,7 +67,6 @@ static void coroutine_fn verify_entered_step_2(void *opaque)
     /* Once more to check it still works after yielding */
     g_assert(qemu_coroutine_entered(caller));
     g_assert(qemu_coroutine_entered(qemu_coroutine_self()));
-    qemu_coroutine_yield();
 }
 
 static void coroutine_fn verify_entered_step_1(void *opaque)
-- 
2.15.1.355.g36791d7216

  parent reply	other threads:[~2017-12-15 15:08 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 15:06 [Qemu-devel] [PATCH v2 00/13] Various build-sys and ASAN related fixes Marc-André Lureau
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 01/13] build-sys: fix qemu-ga -pthread linking Marc-André Lureau
2017-12-15 18:21   ` Philippe Mathieu-Daudé
2017-12-15 18:31     ` Peter Maydell
2017-12-19 15:43     ` Marc-André Lureau
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 02/13] build-sys: silence make by default or V=0 Marc-André Lureau
2017-12-19 16:35   ` Eric Blake
2018-01-02 15:49     ` Marc-André Lureau
2018-01-02 17:33       ` Paolo Bonzini
2018-01-02 17:58         ` Marc-André Lureau
2018-01-02 18:02           ` Paolo Bonzini
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 03/13] build-sys: add a rule to print a variable Marc-André Lureau
2017-12-15 18:28   ` Eric Blake
2017-12-19 15:45     ` Marc-André Lureau
2017-12-19 16:31       ` Eric Blake
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 04/13] build-sys: add AddressSanitizer when --enable-debug if possible Marc-André Lureau
2017-12-19 15:48   ` Marc-André Lureau
2018-01-02 15:49     ` Marc-André Lureau
2018-01-02 17:31       ` Paolo Bonzini
2018-01-03 17:52         ` Peter Maydell
2018-01-03 18:02           ` Marc-André Lureau
2018-01-03 18:10             ` Paolo Bonzini
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 05/13] tests: fix check-qobject leak: Marc-André Lureau
2017-12-15 18:17   ` Philippe Mathieu-Daudé
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 06/13] vl: fix direct firmware directories leak Marc-André Lureau
2017-12-15 18:30   ` Eric Blake
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 07/13] readline: add a free function Marc-André Lureau
2017-12-15 18:16   ` Philippe Mathieu-Daudé
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 08/13] tests: fix migration-test leak Marc-André Lureau
2017-12-15 18:08   ` Philippe Mathieu-Daudé
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 09/13] crypto: fix stack-buffer-overflow error Marc-André Lureau
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 10/13] qemu-config: fix leak in query-command-line-options Marc-André Lureau
2017-12-15 18:35   ` Eric Blake
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 11/13] tests: fix qmp-test leak Marc-André Lureau
2017-12-15 18:11   ` Philippe Mathieu-Daudé
2017-12-15 15:06 ` [Qemu-devel] [PATCH v2 12/13] ucontext: annotate coroutine stack for ASAN Marc-André Lureau
2017-12-15 18:10   ` Philippe Mathieu-Daudé
2017-12-15 18:39   ` Eric Blake
2017-12-18 13:30   ` Stefan Hajnoczi
2017-12-15 15:06 ` Marc-André Lureau [this message]
2017-12-18 13:25   ` [Qemu-devel] [PATCH v2 13/13] tests: fix coroutine leak in /basic/entered Stefan Hajnoczi
2017-12-15 15:22 ` [Qemu-devel] [PATCH v2 00/13] Various build-sys and ASAN related fixes Marc-André Lureau

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=20171215150659.1811-14-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.