mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-04 20:45:34 +00:00
A few dispose/finalize implementations were not chaining up to their parent classes, causing memory leaks. This fixes leaks like the following: ==16240== Memcheck, a memory error detector ==16240== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==16240== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info ==16240== Command: ./test-leaks ==16240== ==16240== ==16240== HEAP SUMMARY: ==16240== in use at exit: 245,490 bytes in 3,638 blocks ==16240== total heap usage: 5,418 allocs, 1,780 frees, 17,676,968 bytes allocated ==16240== ==16240== 16 bytes in 1 blocks are definitely lost in loss record 203 of 771 ==16240== at 0x4C2DADE: malloc (vg_replace_malloc.c:298) ==16240== by 0x4C2FC91: realloc (vg_replace_malloc.c:785) ==16240== by 0x52864E: dispatcher_register_handler (dispatcher.c:374) ==16240== by 0x5293E0: main_dispatcher_constructed (main-dispatcher.c:315) ==16240== by 0x7F873DB: g_object_new_internal (gobject.c:1823) ==16240== by 0x7F87EE4: g_object_new_valist (gobject.c:2042) ==16240== by 0x7F86E90: g_object_new (gobject.c:1626) ==16240== by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295) ==16240== by 0x429A0A: do_spice_init (reds.c:3416) ==16240== by 0x42A3F5: spice_server_init (reds.c:3663) ==16240== by 0x4095B1: server_leaks (test-leaks.c:45) ==16240== by 0x844C60A: test_case_run (gtestutils.c:2161) ==16240== by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244) ==16240== by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256) ==16240== by 0x844CC8A: g_test_run_suite (gtestutils.c:2332) ==16240== by 0x844B92C: g_test_run (gtestutils.c:1599) ==16240== by 0x409A0B: main (test-leaks.c:126) ==16240== ==16240== 16 bytes in 1 blocks are definitely lost in loss record 204 of 771 ==16240== at 0x4C2DADE: malloc (vg_replace_malloc.c:298) ==16240== by 0x4C2FC91: realloc (vg_replace_malloc.c:785) ==16240== by 0x52864E: dispatcher_register_handler (dispatcher.c:374) ==16240== by 0x5293E0: main_dispatcher_constructed (main-dispatcher.c:315) ==16240== by 0x7F873DB: g_object_new_internal (gobject.c:1823) ==16240== by 0x7F87EE4: g_object_new_valist (gobject.c:2042) ==16240== by 0x7F86E90: g_object_new (gobject.c:1626) ==16240== by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295) ==16240== by 0x429A0A: do_spice_init (reds.c:3416) ==16240== by 0x42A3F5: spice_server_init (reds.c:3663) ==16240== by 0x40BFD4: test_new (test-display-base.c:902) ==16240== by 0x40979D: vmc_leaks (test-leaks.c:92) ==16240== by 0x844C60A: test_case_run (gtestutils.c:2161) ==16240== by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244) ==16240== by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256) ==16240== by 0x844CC8A: g_test_run_suite (gtestutils.c:2332) ==16240== by 0x844B92C: g_test_run (gtestutils.c:1599) ==16240== by 0x409A0B: main (test-leaks.c:126) ==16240== ==16240== 96 bytes in 1 blocks are definitely lost in loss record 638 of 771 ==16240== at 0x4C2FA50: calloc (vg_replace_malloc.c:711) ==16240== by 0x8427D3C: g_malloc0 (gmem.c:124) ==16240== by 0x842801F: g_malloc0_n (gmem.c:355) ==16240== by 0x527B44: dispatcher_constructed (dispatcher.c:141) ==16240== by 0x529321: main_dispatcher_constructed (main-dispatcher.c:307) ==16240== by 0x7F873DB: g_object_new_internal (gobject.c:1823) ==16240== by 0x7F87EE4: g_object_new_valist (gobject.c:2042) ==16240== by 0x7F86E90: g_object_new (gobject.c:1626) ==16240== by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295) ==16240== by 0x429A0A: do_spice_init (reds.c:3416) ==16240== by 0x42A3F5: spice_server_init (reds.c:3663) ==16240== by 0x4095B1: server_leaks (test-leaks.c:45) ==16240== by 0x844C60A: test_case_run (gtestutils.c:2161) ==16240== by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244) ==16240== by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256) ==16240== by 0x844CC8A: g_test_run_suite (gtestutils.c:2332) ==16240== by 0x844B92C: g_test_run (gtestutils.c:1599) ==16240== by 0x409A0B: main (test-leaks.c:126) ==16240== ==16240== 96 bytes in 1 blocks are definitely lost in loss record 639 of 771 ==16240== at 0x4C2FA50: calloc (vg_replace_malloc.c:711) ==16240== by 0x8427D3C: g_malloc0 (gmem.c:124) ==16240== by 0x842801F: g_malloc0_n (gmem.c:355) ==16240== by 0x527B44: dispatcher_constructed (dispatcher.c:141) ==16240== by 0x529321: main_dispatcher_constructed (main-dispatcher.c:307) ==16240== by 0x7F873DB: g_object_new_internal (gobject.c:1823) ==16240== by 0x7F87EE4: g_object_new_valist (gobject.c:2042) ==16240== by 0x7F86E90: g_object_new (gobject.c:1626) ==16240== by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295) ==16240== by 0x429A0A: do_spice_init (reds.c:3416) ==16240== by 0x42A3F5: spice_server_init (reds.c:3663) ==16240== by 0x40BFD4: test_new (test-display-base.c:902) ==16240== by 0x40979D: vmc_leaks (test-leaks.c:92) ==16240== by 0x844C60A: test_case_run (gtestutils.c:2161) ==16240== by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244) ==16240== by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256) ==16240== by 0x844CC8A: g_test_run_suite (gtestutils.c:2332) ==16240== by 0x844B92C: g_test_run (gtestutils.c:1599) ==16240== by 0x409A0B: main (test-leaks.c:126) ==16240== ==16240== LEAK SUMMARY: ==16240== definitely lost: 224 bytes in 4 blocks ==16240== indirectly lost: 0 bytes in 0 blocks ==16240== possibly lost: 0 bytes in 0 blocks ==16240== still reachable: 207,718 bytes in 3,312 blocks ==16240== of which reachable via heuristic: ==16240== newarray : 1,536 bytes in 16 blocks ==16240== suppressed: 34,548 bytes in 302 blocks ==16240== Reachable blocks (those to which a pointer was found) are not shown. ==16240== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==16240== ==16240== For counts of detected and suppressed errors, rerun with: -v ==16240== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 20 from 20) FAIL test-leaks (exit status: 1) Acked-by: Frediano Ziglio <fziglio@redhat.com> |
||
|---|---|---|
| .. | ||
| tests | ||
| .gitignore | ||
| agent-msg-filter.c | ||
| agent-msg-filter.h | ||
| cache-item.h | ||
| cache-item.tmpl.c | ||
| char-device.c | ||
| char-device.h | ||
| common-graphics-channel.c | ||
| common-graphics-channel.h | ||
| cursor-channel-client.c | ||
| cursor-channel-client.h | ||
| cursor-channel.c | ||
| cursor-channel.h | ||
| dcc-private.h | ||
| dcc-send.c | ||
| dcc.c | ||
| dcc.h | ||
| demarshallers.h | ||
| dispatcher.c | ||
| dispatcher.h | ||
| display-channel-private.h | ||
| display-channel.c | ||
| display-channel.h | ||
| display-limits.h | ||
| event-loop.c | ||
| glib-compat.h | ||
| glz-encode-match.tmpl.c | ||
| glz-encode.tmpl.c | ||
| glz-encoder-dict.c | ||
| glz-encoder-dict.h | ||
| glz-encoder-priv.h | ||
| glz-encoder.c | ||
| glz-encoder.h | ||
| gstreamer-encoder.c | ||
| image-cache.c | ||
| image-cache.h | ||
| image-encoders.c | ||
| image-encoders.h | ||
| inputs-channel-client.c | ||
| inputs-channel-client.h | ||
| inputs-channel.c | ||
| inputs-channel.h | ||
| jpeg-encoder.c | ||
| jpeg-encoder.h | ||
| lz4-encoder.c | ||
| lz4-encoder.h | ||
| main-channel-client.c | ||
| main-channel-client.h | ||
| main-channel.c | ||
| main-channel.h | ||
| main-dispatcher.c | ||
| main-dispatcher.h | ||
| Makefile.am | ||
| memslot.c | ||
| memslot.h | ||
| migration-protocol.h | ||
| mjpeg-encoder.c | ||
| pixmap-cache.c | ||
| pixmap-cache.h | ||
| red-channel-capabilities.c | ||
| red-channel-capabilities.h | ||
| red-channel-client.c | ||
| red-channel-client.h | ||
| red-channel.c | ||
| red-channel.h | ||
| red-client.c | ||
| red-client.h | ||
| red-common.h | ||
| red-parse-qxl.c | ||
| red-parse-qxl.h | ||
| red-pipe-item.c | ||
| red-pipe-item.h | ||
| red-qxl.c | ||
| red-qxl.h | ||
| red-record-qxl.c | ||
| red-record-qxl.h | ||
| red-replay-qxl.c | ||
| red-worker.c | ||
| red-worker.h | ||
| reds-private.h | ||
| reds-stream.c | ||
| reds-stream.h | ||
| reds.c | ||
| reds.h | ||
| smartcard-channel-client.c | ||
| smartcard-channel-client.h | ||
| smartcard.c | ||
| smartcard.h | ||
| sound.c | ||
| sound.h | ||
| spice-audio.h | ||
| spice-bitmap-utils.c | ||
| spice-bitmap-utils.h | ||
| spice-bitmap-utils.tmpl.c | ||
| spice-char.h | ||
| spice-core.h | ||
| spice-experimental.h | ||
| spice-input.h | ||
| spice-migration.h | ||
| spice-qxl.h | ||
| spice-replay.h | ||
| spice-server-enums.tmpl.c | ||
| spice-server-enums.tmpl.h | ||
| spice-server.h | ||
| spice-server.syms | ||
| spice-version.h.in | ||
| spice.h | ||
| spicevmc.c | ||
| stat-file.c | ||
| stat-file.h | ||
| stat.h | ||
| stream.c | ||
| stream.h | ||
| sw-canvas.c | ||
| tree.c | ||
| tree.h | ||
| utils.c | ||
| utils.h | ||
| video-encoder.h | ||
| zlib-encoder.c | ||
| zlib-encoder.h | ||