Some memory leak fixes
cover Some memory leak fixes
Hi,
Another bunch of fixes spotted by ASAN when running check-qtest-x86_64.
Marc-André Lureau (3):
virtio-input: fix memory leak on unrealize
qtest: fix qtest_qmp_device_add leak
cpu-plug-test: fix leaks
hw/input/virtio-input.c | 3 +++ tests/cpu-plug-test.c | 2 ++ tests/libqtest.c | 1 + 3 files changed, 6 insertions(+)
Signature · 1 line
2.24.0.rc0.20.gd81542e6f3
PATCH 1/3 virtio-input: fix memory leak on unrealize
Spotted by ASAN + minor stylistic change.
--- hw/input/virtio-input.c | 3 +++ 1 file changed, 3 insertions(+)
hw/input/virtio-input.c +3 -0
@@ -275,6 +275,7 @@ static void virtio_input_finalize(Object *obj)g_free (vinput->queue); } +static void virtio_input_device_unrealize (DeviceState *dev,Error **errp) {VirtIOInputClass *vic =VIRTIO_INPUT_GET_CLASS (dev);
@@ -288,6 +289,8 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp)return ; } } +virtio_del_queue (vdev,0 ); +virtio_del_queue (vdev,1 );virtio_cleanup (vdev); }
Signature · 1 line
2.24.0.rc0.20.gd81542e6f3
Re: [PATCH 1/3] virtio-input: fix memory leak on unrealize
Quoted 3 lines · Marc-André Lureau
Spotted by ASAN + minor stylistic change.
Signed-off-by Marc-André Lureau <[email protected]>
Quoted 27 lines
--- hw/input/virtio-input.c | 3 +++ 1 file changed, 3 insertions(+)hw/input/virtio-input.c +3
-0@@ -275,6 +275,7 @@ static void virtio_input_finalize(Object *obj)g_free (vinput->queue); } +static void virtio_input_device_unrealize (DeviceState *dev,Error **errp) {VirtIOInputClass *vic =VIRTIO_INPUT_GET_CLASS (dev);@@ -288,6 +289,8 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp)return ; } } +virtio_del_queue (vdev,0 ); +virtio_del_queue (vdev,1 );virtio_cleanup (vdev); }Signature · 1 line
2.24.0.rc0.20.gd81542e6f3
PATCH 2/3 qtest: fix qtest_qmp_device_add leak
In reply to Marc-André LureauSpotted by ASAN.
--- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+)
tests/libqtest.c +1 -0
@@ -1274,6 +1274,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,qdict_put_str (args,"id" , id);qtest_qmp_device_add_qdict (qts, driver, args); +qobject_unref (args); }static void device_deleted_cb (void *opaque,const char *name,QDict *data)
Signature · 1 line
2.24.0.rc0.20.gd81542e6f3
Re: [PATCH 2/3] qtest: fix qtest_qmp_device_add leak
Quoted 13 lines · Marc-André Lureau
Spotted by ASAN.
Signed-off-by Marc-André Lureau <[email protected]>--- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+)tests/libqtest.c +0
-0
tests/libqtest.c void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id, · line 1280
Quoted 7 lines
tests/libqtest.c +1
-0@@ -1274,6 +1274,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,qdict_put_str (args,"id" , id);qtest_qmp_device_add_qdict (qts, driver, args); +qobject_unref (args); }static void device_deleted_cb (void *opaque,const char *name,QDict *data)
Stupid question: where is the qobject_ref()?
Thanks,
Laurent
Re: [PATCH 2/3] qtest: fix qtest_qmp_device_add leak
Hi
Quoted 16 lines · Laurent Vivier
Quoted 14 lines · Marc-André Lureau
Spotted by ASAN.
Signed-off-by Marc-André Lureau <[email protected]>--- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+)tests/libqtest.c +0
-0@@ -1274,6 +1274,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,qdict_put_str (args,"id" , id);
Quoted 8 lines
tests/libqtest.c void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id, · line 1280
Quoted 6 lines
tests/libqtest.c +1
-0qtest_qmp_device_add_qdict (qts, driver, args); +qobject_unref (args); }static void device_deleted_cb (void *opaque,const char *name,QDict *data)Stupid question: where is the
qobject_ref()?
The initial ref is from qobject_from_vjsonf_nofail() constructor
Signature · 1 line
Marc-André Lureau
Re: [PATCH 2/3] qtest: fix qtest_qmp_device_add leak
In reply to Marc-André LureauQuoted 13 lines · Marc-André Lureau
Spotted by ASAN.
Signed-off-by Marc-André Lureau <[email protected]>--- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+)tests/libqtest.c +0
-0
tests/libqtest.c void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id, · line 1280
Quoted 7 lines
tests/libqtest.c +1
-0@@ -1274,6 +1274,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,qdict_put_str (args,"id" , id);qtest_qmp_device_add_qdict (qts, driver, args); +qobject_unref (args); }static void device_deleted_cb (void *opaque,const char *name,QDict *data)
I can queue this via the qtest tree if nobody else wants to take it.
PATCH 3/3 cpu-plug-test: fix leaks
In reply to Marc-André LureauSpotted by ASAN.
--- tests/cpu-plug-test.c | 2 ++ 1 file changed, 2 insertions(+)
tests/cpu-plug-test.c +2 -0
@@ -99,6 +99,7 @@ static void test_plug_with_device_add(gconstpointer data) cpu =qobject_to (QDict, e);if (qdict_haskey (cpu,"qom-path" )) { +qobject_unref (e);continue ; }
@@ -107,6 +108,7 @@ static void test_plug_with_device_add(gconstpointer data)qtest_qmp_device_add_qdict (qts, td->device_model, props); hotplugged++; +qobject_unref (e); }/* make sure that there were hotplugged CPUs */
Signature · 1 line
2.24.0.rc0.20.gd81542e6f3
Re: [PATCH 3/3] cpu-plug-test: fix leaks
Quoted 21 lines · Marc-André Lureau
Spotted by ASAN.
Signed-off-by Marc-André Lureau <[email protected]>--- tests/cpu-plug-test.c | 2 ++ 1 file changed, 2 insertions(+)tests/cpu-plug-test.c +1
-0@@ -99,6 +99,7 @@ static void test_plug_with_device_add(gconstpointer data) cpu =qobject_to (QDict, e);if (qdict_haskey (cpu,"qom-path" )) { +qobject_unref (e);continue ; }
tests/cpu-plug-test.c static void test_plug_with_device_add(gconstpointer data) · line 114
Quoted 7 lines
tests/cpu-plug-test.c +1
-0@@ -107,6 +108,7 @@ static void test_plug_with_device_add(gconstpointer data)qtest_qmp_device_add_qdict (qts, td->device_model, props); hotplugged++; +qobject_unref (e); }/* make sure that there were hotplugged CPUs */
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
TEST check-unit: tests/test-thread-pool
TEST check-unit: tests/test-hbitmap
**
ERROR:/tmp/qemu-test/src/tests/migration-test.c:903:wait_for_migration_fail: assertion failed: (!strcmp(status, "setup") || !strcmp(status, "failed") || (allow_active && !strcmp(status, "active")))
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/migration-test.c:903:wait_for_migration_fail: assertion failed: (!strcmp(status, "setup") || !strcmp(status, "failed") || (allow_active && !strcmp(status, "active")))
make: *** [check-qtest-aarch64] Error 1
make: *** Waiting for unfinished jobs....
TEST iotest-qcow2: 013
TEST check-unit: tests/test-bdrv-drain
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=7099ba6365db4fc0b071e2fac87b5c55', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-softdboz/src/docker-src.2019-11-07-16.44.12.4395:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=7099ba6365db4fc0b071e2fac87b5c55
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-softdboz/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 13m27.012s
user 0m8.295s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 14 lines · On 07/11/2019 22.57, [email protected] wrote:
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
Quoted 5 lines
TEST check-unit: tests/test-thread-pool
TEST check-unit: tests/test-hbitmap
**
ERROR:/tmp/qemu-test/src/tests/migration-test.c:903:wait_for_migration_fail: assertion failed: (!strcmp(status, "setup") || !strcmp(status, "failed") || (allow_active&& !strcmp(status, "active"))) ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/migration-test.c:903:wait_for_migration_fail: assertion failed: (!strcmp(status, "setup") || !strcmp(status, "failed") || (allow_active&& !strcmp(status, "active")))
I assume this is unrelated to your patches and a generic Patchew problem instead?
Thomas
Quoted 30 lines · Thomas Huth
Quoted 18 lines · On 07/11/2019 22.57, [email protected] wrote:
Patchew URL:
https://patchew.org/QEMU/[email protected]/Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===Quoted 10 lines
TEST check-unit: tests/test-thread-pool
TEST check-unit: tests/test-hbitmap
** ERROR:/tmp/qemu-test/src/tests/migration-test.c:903:wait_for_migration_fail:
assertion failed: (!strcmp(status, "setup") || !strcmp(status, "failed") || (allow_active&& !strcmp(status, "active")))
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/migration-test.c:903:wait_for_migration_fail:
assertion failed: (!strcmp(status, "setup") || !strcmp(status, "failed") || (allow_active&& !strcmp(status, "active")))
Quoted 2 lines
I assume this is unrelated to your patches and a generic Patchew problem instead?
Unrelated to patchew too, but the problem has already been reported. I think dgilbert is looking at this.
Thanks,
Quoted 3 lines · Marc-André Lureau
Hi,
Another bunch of fixes spotted by ASAN when running check-qtest-x86_64.
So who's merging this?
Quoted 12 lines
Marc-André Lureau (3):
virtio-input: fix memory leak on unrealize
qtest: fixqtest_qmp_device_addleak
cpu-plug-test: fix leakshw/input/virtio-input.c | 3 +++ tests/cpu-plug-test.c | 2 ++ tests/libqtest.c | 1 + 3 files changed, 6 insertions(+)Signature · 1 line
2.24.0.rc0.20.gd81542e6f3
Hi
Quoted 10 lines · Michael S. Tsirkin
Quoted 3 lines · Marc-André Lureau
Hi,
Another bunch of fixes spotted by ASAN when running check-qtest-x86_64.
So who's merging this?
Quoted 2 lines
Marc-André Lureau (3):
virtio-input: fix memory leak on unrealize
This one is still pending. Michael, could you take it?
Quoted 11 lines
Quoted 10 lines
qtest: fix
qtest_qmp_device_addleak
cpu-plug-test: fix leakshw/input/virtio-input.c | 3 +++ tests/cpu-plug-test.c | 2 ++ tests/libqtest.c | 1 + 3 files changed, 6 insertions(+)--
2.24.0.rc0.20.gd81542e6f3
Signature · 1 line
Marc-André Lureau
Quoted 7 lines · Marc-André Lureau
Hi
Quoted 4 lines · Michael S. Tsirkin
Quoted 2 lines · Marc-André Lureau
Hi,
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Another bunch of fixes spotted by ASAN when running check-qtest-x86_64.
So who's merging this?
Quoted 2 lines
Marc-André Lureau (3):
virtio-input: fix memory leak on unrealizeThis one is still pending. Michael, could you take it?
Expected gerd to do that but ok. Pls re-post a separate patch though, I don't cherry-pick things out of series.
Quoted 15 lines
Quoted 11 lines
Quoted 10 lines
qtest: fix
qtest_qmp_device_addleak
cpu-plug-test: fix leakshw/input/virtio-input.c | 3 +++ tests/cpu-plug-test.c | 2 ++ tests/libqtest.c | 1 + 3 files changed, 6 insertions(+)--
2.24.0.rc0.20.gd81542e6f3Signature · 1 line
Marc-André Lureau