qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Should I delete created coroutines manually?


From: Coiby Xu
Subject: Should I delete created coroutines manually?
Date: Mon, 17 Aug 2020 21:13:19 +0800

Hi,

I'm working on vhost-user block device backend [1]. When I tested my
patches on the latest version of QEMU (commit
d0ed6a69d399ae193959225cdeaa9382746c91cc) with --enable-sanitizer turned
on, the follow error will be thrown out,

    ==46631==ERROR: LeakSanitizer: detected memory leaks

    Direct leak of 312 byte(s) in 1 object(s) allocated from:
        #0 0x55d0a7813921 in calloc (qemu/qemu-storage-daemon+0x646921)
        #1 0x7f8bd6f7b591 in g_malloc0 (/usr/lib/libglib-2.0.so.0+0x4f591)
        #2 0x55d0a815f3fb in qemu_coroutine_create 
qemu/util/qemu-coroutine.c:75:14
        #3 0x55d0a817321e in vu_client_start 
qemu/util/vhost-user-server.c:225:23
        #4 0x55d0a816fcf3 in vu_accept qemu/util/vhost-user-server.c:341:5
        #5 0x55d0a7f1293f in qio_net_listener_channel_func 
qemu/io/net-listener.c:54:9
        #6 0x55d0a7efb0f3 in qio_channel_fd_source_dispatch 
qemu/io/channel-watch.c:84:12
        #7 0x7f8bd6f7e33f in g_main_context_dispatch 
(/usr/lib/libglib-2.0.so.0+0x5233f)

I have to call qemu_coroutine_delete to eliminate this kind of errors.

I noticed
    make docker-test-clang@ubuntu SHOW_ENV=1 J=12 TARGET_LIST=x86_64-softmmu 
EXTRA_CONFIGURE_OPTS=--enable-sanitizers"
won't give the above error while
    "make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=12" would.

And for older commits like commit eea8f5df4ecc607d64f091b8d916fcc11a697541,
this kind of error won't be shown either.

Is this kind of error true a false positve because "ASan doesn't fully
support makecontext/swapcontext functions and may produce false positives in some 
cases"?

I don't have sufficient knowledge on QEMU coroutine and ASan to reach a
conclusion. Could anyone enlighten me? Thank you!

[1] https://patchew.org/QEMU/20200614183907.514282-1-coiby.xu@gmail.com/

--
Best regards,
Coiby



reply via email to

[Prev in Thread] Current Thread [Next in Thread]