Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak #258

Closed
eqv opened this issue Nov 11, 2015 · 8 comments
Closed

Memory Leak #258

eqv opened this issue Nov 11, 2015 · 8 comments

Comments

@eqv
Copy link
Contributor

eqv commented Nov 11, 2015

There is only some memory leak :

valgrind --leak-check=yes ./mem_double_unmap

==6083== Memcheck, a memory error detector
==6083== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==6083== Command: ./mem_double_unmap
==6083== 
==6083== Warning: set address range perms: large range [0xf01000, 0x14f01000) (defined)
Tests OK
==6083== 
==6083== HEAP SUMMARY:
==6083==     in use at exit: 9,089 bytes in 164 blocks
==6083==   total heap usage: 596 allocs, 432 frees, 32,907,031 bytes allocated
==6083== 
==6083== 7 bytes in 1 blocks are definitely lost in loss record 37 of 146
==6083==    at 0x15B2BB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D86610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x15D9DB0E: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x42DB14: memory_region_init_x86_64 (memory.c:928)
==6083==    by 0x42E790: memory_region_init_ram_x86_64 (memory.c:1183)
==6083==    by 0x429F89: memory_map_x86_64 (memory.c:38)
==6083==    by 0x404703: uc_mem_map (uc.c:594)
==6083==    by 0x4033E7: main (in /.../golang/src/github.com/unicorn-engine/unicorn/tests/regress/mem_double_unmap)
==6083== 
==6083== 8 bytes in 1 blocks are definitely lost in loss record 39 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x5A44C2: qemu_tcg_init_vcpu_x86_64 (cpus.c:182)
==6083==    by 0x5A42FB: qemu_init_vcpu_x86_64 (cpus.c:116)
==6083==    by 0x5A8BD1: x86_cpu_realizefn (cpu.c:2292)
==6083==    by 0x4433C1: device_set_realized (qdev.c:184)
==6083==    by 0x4421B8: property_set_bool (object.c:1504)
==6083==    by 0x44057D: object_property_set (object.c:829)
==6083==    by 0x442BAC: object_property_set_qobject (qom-qobject.c:24)
==6083==    by 0x4408E3: object_property_set_bool (object.c:897)
==6083==    by 0x59F01F: pc_new_cpu (pc.c:107)
==6083==    by 0x59F0D7: pc_cpus_init (pc.c:132)
==6083== 
==6083== 144 bytes in 1 blocks are definitely lost in loss record 132 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x433929: tcg_cpu_address_space_init_x86_64 (exec.c:405)
==6083==    by 0x5A44A7: qemu_tcg_init_vcpu_x86_64 (cpus.c:178)
==6083==    by 0x5A42FB: qemu_init_vcpu_x86_64 (cpus.c:116)
==6083==    by 0x5A8BD1: x86_cpu_realizefn (cpu.c:2292)
==6083==    by 0x4433C1: device_set_realized (qdev.c:184)
==6083==    by 0x4421B8: property_set_bool (object.c:1504)
==6083==    by 0x44057D: object_property_set (object.c:829)
==6083==    by 0x442BAC: object_property_set_qobject (qom-qobject.c:24)
==6083==    by 0x4408E3: object_property_set_bool (object.c:897)
==6083==    by 0x59F01F: pc_new_cpu (pc.c:107)
==6083== 
==6083== 272 bytes in 1 blocks are possibly lost in loss record 134 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x14F13E54: _dl_allocate_tls (dl-tls.c:296)
==6083==    by 0x16048DA0: pthread_create@@GLIBC_2.2.5 (allocatestack.c:589)
==6083==    by 0x43C17A: qemu_thread_create (qemu-thread-posix.c:420)
==6083==    by 0x5A4560: qemu_tcg_init_vcpu_x86_64 (cpus.c:188)
==6083==    by 0x5A42FB: qemu_init_vcpu_x86_64 (cpus.c:116)
==6083==    by 0x5A8BD1: x86_cpu_realizefn (cpu.c:2292)
==6083==    by 0x4433C1: device_set_realized (qdev.c:184)
==6083==    by 0x4421B8: property_set_bool (object.c:1504)
==6083==    by 0x44057D: object_property_set (object.c:829)
==6083==    by 0x442BAC: object_property_set_qobject (qom-qobject.c:24)
==6083==    by 0x4408E3: object_property_set_bool (object.c:897)
==6083== 
==6083== 360 (96 direct, 264 indirect) bytes in 1 blocks are definitely lost in loss record 137 of 146
==6083==    at 0x15B2BB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D86610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x43F694: object_new_with_type (object.c:425)
==6083==    by 0x43F72B: object_new (object.c:436)
==6083==    by 0x43D033: machine_initialize (vl.c:119)
==6083==    by 0x403A89: uc_open (uc.c:238)
==6083==    by 0x4033A5: main (in /.../golang/src/github.com/unicorn-engine/unicorn/tests/regress/mem_double_unmap)
==6083== 
==6083== 616 (80 direct, 536 indirect) bytes in 1 blocks are definitely lost in loss record 138 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x4401AB: object_property_add (object.c:755)
==6083==    by 0x442068: object_property_add_str (object.c:1464)
==6083==    by 0x442ACF: object_instance_init (object.c:1699)
==6083==    by 0x43EFC7: object_init_with_type (object.c:310)
==6083==    by 0x43EF9D: object_init_with_type (object.c:306)
==6083==    by 0x43F1DF: object_initialize_with_type (object.c:340)
==6083==    by 0x43F262: object_initialize (object.c:348)
==6083==    by 0x42DAC9: memory_region_init_x86_64 (memory.c:922)
==6083==    by 0x436D92: memory_map_init_x86_64 (exec.c:1575)
==6083==    by 0x436E0A: cpu_exec_init_all_x86_64 (exec.c:1583)
==6083== 
==6083== 616 (80 direct, 536 indirect) bytes in 1 blocks are definitely lost in loss record 139 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x4401AB: object_property_add (object.c:755)
==6083==    by 0x442068: object_property_add_str (object.c:1464)
==6083==    by 0x442ACF: object_instance_init (object.c:1699)
==6083==    by 0x43EFC7: object_init_with_type (object.c:310)
==6083==    by 0x43EF9D: object_init_with_type (object.c:306)
==6083==    by 0x43F1DF: object_initialize_with_type (object.c:340)
==6083==    by 0x43F262: object_initialize (object.c:348)
==6083==    by 0x42DAC9: memory_region_init_x86_64 (memory.c:922)
==6083==    by 0x42E6F5: memory_region_init_io_x86_64 (memory.c:1169)
==6083==    by 0x436604: io_mem_init (exec.c:1423)
==6083== 
==6083== 616 (80 direct, 536 indirect) bytes in 1 blocks are definitely lost in loss record 140 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x4401AB: object_property_add (object.c:755)
==6083==    by 0x442068: object_property_add_str (object.c:1464)
==6083==    by 0x442ACF: object_instance_init (object.c:1699)
==6083==    by 0x43EFC7: object_init_with_type (object.c:310)
==6083==    by 0x43EF9D: object_init_with_type (object.c:306)
==6083==    by 0x43F1DF: object_initialize_with_type (object.c:340)
==6083==    by 0x43F262: object_initialize (object.c:348)
==6083==    by 0x42DAC9: memory_region_init_x86_64 (memory.c:922)
==6083==    by 0x42E6F5: memory_region_init_io_x86_64 (memory.c:1169)
==6083==    by 0x43663E: io_mem_init (exec.c:1424)
==6083== 
==6083== 616 (80 direct, 536 indirect) bytes in 1 blocks are definitely lost in loss record 141 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x4401AB: object_property_add (object.c:755)
==6083==    by 0x442068: object_property_add_str (object.c:1464)
==6083==    by 0x442ACF: object_instance_init (object.c:1699)
==6083==    by 0x43EFC7: object_init_with_type (object.c:310)
==6083==    by 0x43EF9D: object_init_with_type (object.c:306)
==6083==    by 0x43F1DF: object_initialize_with_type (object.c:340)
==6083==    by 0x43F262: object_initialize (object.c:348)
==6083==    by 0x42DAC9: memory_region_init_x86_64 (memory.c:922)
==6083==    by 0x42E6F5: memory_region_init_io_x86_64 (memory.c:1169)
==6083==    by 0x436675: io_mem_init (exec.c:1426)
==6083== 
==6083== 616 (80 direct, 536 indirect) bytes in 1 blocks are definitely lost in loss record 142 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x4401AB: object_property_add (object.c:755)
==6083==    by 0x442068: object_property_add_str (object.c:1464)
==6083==    by 0x442ACF: object_instance_init (object.c:1699)
==6083==    by 0x43EFC7: object_init_with_type (object.c:310)
==6083==    by 0x43EF9D: object_init_with_type (object.c:306)
==6083==    by 0x43F1DF: object_initialize_with_type (object.c:340)
==6083==    by 0x43F262: object_initialize (object.c:348)
==6083==    by 0x42DAC9: memory_region_init_x86_64 (memory.c:922)
==6083==    by 0x42E790: memory_region_init_ram_x86_64 (memory.c:1183)
==6083==    by 0x429F89: memory_map_x86_64 (memory.c:38)
==6083== 
==6083== 640 (320 direct, 320 indirect) bytes in 1 blocks are definitely lost in loss record 143 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x43584D: qemu_ram_alloc_from_ptr_x86_64 (exec.c:1094)
==6083==    by 0x43594B: qemu_ram_alloc_x86_64 (exec.c:1113)
==6083==    by 0x42E7EE: memory_region_init_ram_x86_64 (memory.c:1191)
==6083==    by 0x429F89: memory_map_x86_64 (memory.c:38)
==6083==    by 0x404703: uc_mem_map (uc.c:594)
==6083==    by 0x4033E7: main (in /.../golang/src/github.com/unicorn-engine/unicorn/tests/regress/mem_double_unmap)
==6083== 
==6083== 1,612 (80 direct, 1,532 indirect) bytes in 1 blocks are definitely lost in loss record 145 of 146
==6083==    at 0x15B2F9D8: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6083==    by 0x15D872B8: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==6083==    by 0x4401AB: object_property_add (object.c:755)
==6083==    by 0x442068: object_property_add_str (object.c:1464)
==6083==    by 0x442ACF: object_instance_init (object.c:1699)
==6083==    by 0x43EFC7: object_init_with_type (object.c:310)
==6083==    by 0x43EF9D: object_init_with_type (object.c:306)
==6083==    by 0x43F1DF: object_initialize_with_type (object.c:340)
==6083==    by 0x43F6B4: object_new_with_type (object.c:426)
==6083==    by 0x43F72B: object_new (object.c:436)
==6083==    by 0x440F47: object_get_root (object.c:1041)
==6083==    by 0x4437A9: qdev_get_machine (qdev.c:278)
==6083== 
==6083== LEAK SUMMARY:
==6083==    definitely lost: 1,055 bytes in 11 blocks
==6083==    indirectly lost: 4,796 bytes in 147 blocks
==6083==      possibly lost: 272 bytes in 1 blocks
==6083==    still reachable: 2,966 bytes in 5 blocks
==6083==         suppressed: 0 bytes in 0 blocks
==6083== Reachable blocks (those to which a pointer was found) are not shown.
==6083== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==6083== 
==6083== For counts of detected and suppressed errors, rerun with: -v
==6083== ERROR SUMMARY: 12 errors from 12 contexts (suppressed: 0 from 0)
@farmdve
Copy link
Contributor

farmdve commented Nov 11, 2015

Yes there is, one is in a strdup operation that is never freed on exit.

Here is some more, but on Windows.

Error # 1: UNINITIALIZED READ: reading register eax
==# 0 disas_insn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:4753]
==# 1 gen_intermediate_code_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8424]
==# 2 gen_intermediate_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8474]
==# 3 cpu_x86_gen_code [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:179]
==# 4 tb_gen_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:1092]
==# 5 tb_find_slow_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:360]
==# 6 tb_find_fast_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:388]
==# 7 cpu_x86_exec [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:201]
==# 8 tcg_cpu_exec_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:205]
==# 9 tcg_exec_all_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:225]
==# 10 qemu_tcg_cpu_thread_fn_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:154]
==# 11 win32_start_routine@4 [util/qemu-thread-win32.c:282]
==# 12 msvcrt.dll!itow_s +0x4b (0x756d1287 <msvcrt.dll+0x11287>)
==# 13 msvcrt.dll!endthreadex +0x6b (0x756d1328 <msvcrt.dll+0x11328>)
==# 14 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x75bc337a <KERNEL32.dll+0x1337a>)
Note: @0:00:00.731 in thread 340
Note: instruction: test %eax %eax

Error # 2: UNINITIALIZED READ: reading register ax
==# 0 tb_gen_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:1098]
==# 1 tb_find_slow_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:360]
==# 2 tb_find_fast_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:388]
==# 3 cpu_x86_exec [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:201]
==# 4 tcg_cpu_exec_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:205]
==# 5 tcg_exec_all_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:225]
==# 6 qemu_tcg_cpu_thread_fn_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:154]
==# 7 win32_start_routine@4 [util/qemu-thread-win32.c:282]
==# 8 msvcrt.dll!itow_s +0x4b (0x756d1287 <msvcrt.dll+0x11287>)
==# 9 msvcrt.dll!endthreadex +0x6b (0x756d1328 <msvcrt.dll+0x11328>)
==# 10 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x75bc337a <KERNEL32.dll+0x1337a>)
Note: @0:00:00.918 in thread 340
Note: instruction: data16 test %ax %ax

Error # 3: UNINITIALIZED READ: reading 0x0889fafc-0x0889fafd 1 byte(s) within 0x0889fafc-0x0889fb00
==# 0 memory_mapping [C:\MinGW\msys64\projects\unicorn\qemu/../uc.c:825]
==# 1 helper_ret_ldb_cmmu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/softmmu_template.h:183]
==# 2 helper_ldb_cmmu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/softmmu_template.h:550]
==# 3 cpu_ldub_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/include/exec/cpu_ldst_template.h:79]
==# 4 get_page_addr_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cputlb.c:302]
==# 5 tb_gen_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:1101]
==# 6 tb_find_slow_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:360]
==# 7 tb_find_fast_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:388]
==# 8 cpu_x86_exec [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:201]
==# 9 tcg_cpu_exec_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:205]
==# 10 tcg_exec_all_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:225]
==# 11 qemu_tcg_cpu_thread_fn_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:154]
==# 12 win32_start_routine@4 [util/qemu-thread-win32.c:282]
==# 13 msvcrt.dll!itow_s +0x4b (0x756d1287 <msvcrt.dll+0x11287>)
==# 14 msvcrt.dll!endthreadex +0x6b (0x756d1328 <msvcrt.dll+0x11328>)
#15 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x75bc337a <KERNEL32.dll+0x1337a>)
Note: @0:00:00.921 in thread 340
Note: instruction: cmp %edx 0xffffffe4(%ebp)

Error # 4: POSSIBLE LEAK 220 direct bytes 0x0a6d00f8-0x0a6d01d4 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strcpy_s +0x5e (0x756cf5d3 <msvcrt.dll+0xf5d3>)
==# 2 msvcrt.dll!clearerr_s +0x337 (0x756d9eed <msvcrt.dll+0x19eed>)
==# 3 msvcrt.dll!clearerr_s +0x27e (0x756d9e34 <msvcrt.dll+0x19e34>)
==# 4 pre_cpp_init [C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:162]
==# 5 __tmainCRTStartup [C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:270]
==# 6 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x75bc337a <KERNEL32.dll+0x1337a>)

Error # 5: POSSIBLE LEAK 56 direct bytes 0x0a6d8198-0x0a6d81d0 + 144 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f864b <libglib-2.0-0.dll+0x3864b>)
==# 2 object_new_with_type [qom/object.c:425]
==# 3 object_new [qom/object.c:436]
==# 4 machine_initialize [C:\MinGW\msys64\projects\unicorn\qemu/vl.c:119]
==# 5 uc_open [C:\MinGW\msys64\projects\unicorn\qemu/../uc.c:238]
==# 6 VM_exec [C:\MinGW\msys64\projects/eflags_noset.c:49]
==# 7 main [C:\MinGW\msys64\projects/eflags_noset.c:99]

Error # 6: POSSIBLE LEAK 40 direct bytes 0x0a6d83e0-0x0a6d8408 + 285 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 object_property_add [qom/object.c:755]
==# 3 object_property_add_str [qom/object.c:1464]
==# 4 object_instance_init [qom/object.c:1699]
==# 5 object_init_with_type [qom/object.c:310]
==# 6 object_init_with_type [qom/object.c:306]
==# 7 object_initialize_with_type [qom/object.c:340]
==# 8 object_new_with_type [qom/object.c:426]
==# 9 object_new [qom/object.c:436]
==# 10 object_get_root [qom/object.c:1041]
==# 11 qdev_get_machine [hw/core/qdev.c:278]

Error # 7: POSSIBLE LEAK 40 direct bytes 0x0a6d8828-0x0a6d8850 + 320 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 object_property_add [qom/object.c:755]
==# 3 object_property_add_str [qom/object.c:1464]
==# 4 object_instance_init [qom/object.c:1699]
==# 5 object_init_with_type [qom/object.c:310]
==# 6 object_init_with_type [qom/object.c:306]
==# 7 object_initialize_with_type [qom/object.c:340]
==# 8 object_initialize [qom/object.c:348]
==# 9 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:922]
==# 10 memory_map_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1575]
==# 11 cpu_exec_init_all_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1583]

Error # 8: POSSIBLE LEAK 40 direct bytes 0x0a6d9710-0x0a6d9738 + 320 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 object_property_add [qom/object.c:755]
==# 3 object_property_add_str [qom/object.c:1464]
==# 4 object_instance_init [qom/object.c:1699]
==# 5 object_init_with_type [qom/object.c:310]
==# 6 object_init_with_type [qom/object.c:306]
==# 7 object_initialize_with_type [qom/object.c:340]
==# 8 object_initialize [qom/object.c:348]
==# 9 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:922]
==# 10 memory_region_init_io_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1169]
==# 11 io_mem_init [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1423]

Error # 9: POSSIBLE LEAK 40 direct bytes 0x0a6d9ba0-0x0a6d9bc8 + 320 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 object_property_add [qom/object.c:755]
==# 3 object_property_add_str [qom/object.c:1464]
==# 4 object_instance_init [qom/object.c:1699]
==# 5 object_init_with_type [qom/object.c:310]
==# 6 object_init_with_type [qom/object.c:306]
==# 7 object_initialize_with_type [qom/object.c:340]
==# 8 object_initialize [qom/object.c:348]
==# 9 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:922]
==# 10 memory_region_init_io_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1169]
==# 11 io_mem_init [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1424]

Error ==# 10: POSSIBLE LEAK 40 direct bytes 0x0a6da030-0x0a6da058 + 320 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 object_property_add [qom/object.c:755]
==# 3 object_property_add_str [qom/object.c:1464]
==# 4 object_instance_init [qom/object.c:1699]
==# 5 object_init_with_type [qom/object.c:310]
==# 6 object_init_with_type [qom/object.c:306]
==# 7 object_initialize_with_type [qom/object.c:340]
==# 8 object_initialize [qom/object.c:348]
==# 9 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:922]
==# 10 memory_region_init_io_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1169]
==# 11 io_mem_init [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1426]

Error ==# 11: LEAK 9 direct bytes 0x0a705060-0x0a705069 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:494]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8243]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error ==# 12: LEAK 9 direct bytes 0x0a705090-0x0a705099 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:509]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8243]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error ==# 13: LEAK 9 direct bytes 0x0a7050e8-0x0a7050f1 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:494]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8247]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error ==# 14: LEAK 9 direct bytes 0x0a705118-0x0a705121 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:509]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8247]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error # 15: LEAK 10 direct bytes 0x0a705170-0x0a70517a + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:494]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8251]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error # 16: LEAK 10 direct bytes 0x0a7051a0-0x0a7051aa + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:509]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8251]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error # 17: LEAK 6 direct bytes 0x0a7051f8-0x0a7051fe + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:494]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8256]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error # 18: LEAK 6 direct bytes 0x0a705220-0x0a705226 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 msvcrt.dll!strdup +0x29 (0x756e47d7 <msvcrt.dll+0x247d7>)
==# 2 tcg_global_mem_new_internal_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:509]
==# 3 tcg_global_mem_new_i64_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/tcg/tcg.c:537]
==# 4 optimize_flags_init [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/translate.c:8256]
==# 5 x86_cpu_initfn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2391]
==# 6 object_init_with_type [qom/object.c:310]
==# 7 object_init_with_type [qom/object.c:306]
==# 8 object_initialize_with_type [qom/object.c:340]
==# 9 object_new_with_type [qom/object.c:426]
==# 10 object_new [qom/object.c:436]
==# 11 cpu_x86_create [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:1680]

Error # 19: LEAK 72 direct bytes 0x0a70bad0-0x0a70bb18 + 0 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 tcg_cpu_address_space_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:405]
==# 3 qemu_tcg_init_vcpu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:178]
==# 4 qemu_init_vcpu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:116]
==# 5 x86_cpu_realizefn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2292]
==# 6 device_set_realized [hw/core/qdev.c:184]
==# 7 property_set_bool [qom/object.c:1504]
==# 8 object_property_set [qom/object.c:829]
==# 9 object_property_set_qobject [qom/qom-qobject.c:24]
==# 10 object_property_set_bool [qom/object.c:897]
==# 11 pc_new_cpu [C:/MinGW/msys64/projects/unicorn/qemu/hw/i386/pc.c:107]

Error # 20: LEAK 8 direct bytes 0x0a70bb38-0x0a70bb40 + 0 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 qemu_tcg_init_vcpu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:182]
==# 3 qemu_init_vcpu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:116]
==# 4 x86_cpu_realizefn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2292]
==# 5 device_set_realized [hw/core/qdev.c:184]
==# 6 property_set_bool [qom/object.c:1504]
==# 7 object_property_set [qom/object.c:829]
==# 8 object_property_set_qobject [qom/qom-qobject.c:24]
==# 9 object_property_set_bool [qom/object.c:897]
==# 10 pc_new_cpu [C:/MinGW/msys64/projects/unicorn/qemu/hw/i386/pc.c:107]
==# 11 pc_cpus_init [C:/MinGW/msys64/projects/unicorn/qemu/hw/i386/pc.c:132]

Error # 21: LEAK 16 direct bytes 0x0a70bb60-0x0a70bb70 + 0 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 qemu_tcg_init_vcpu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:183]
==# 3 qemu_init_vcpu_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:116]
==# 4 x86_cpu_realizefn [C:/MinGW/msys64/projects/unicorn/qemu/target-i386/cpu.c:2292]
==# 5 device_set_realized [hw/core/qdev.c:184]
==# 6 property_set_bool [qom/object.c:1504]
==# 7 object_property_set [qom/object.c:829]
==# 8 object_property_set_qobject [qom/qom-qobject.c:24]
==# 9 object_property_set_bool [qom/object.c:897]
==# 10 pc_new_cpu [C:/MinGW/msys64/projects/unicorn/qemu/hw/i386/pc.c:107]
==# 11 pc_cpus_init [C:/MinGW/msys64/projects/unicorn/qemu/hw/i386/pc.c:132]

Error # 22: POSSIBLE LEAK 40 direct bytes 0x0a70c688-0x0a70c6b0 + 320 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 object_property_add [qom/object.c:755]
==# 3 object_property_add_str [qom/object.c:1464]
==# 4 object_instance_init [qom/object.c:1699]
==# 5 object_init_with_type [qom/object.c:310]
==# 6 object_init_with_type [qom/object.c:306]
==# 7 object_initialize_with_type [qom/object.c:340]
==# 8 object_initialize [qom/object.c:348]
==# 9 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:922]
==# 10 memory_region_init_ram_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1183]
==# 11 memory_map_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:38]

Error # 23: LEAK 7 direct bytes 0x0a70ca70-0x0a70ca77 + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f864b <libglib-2.0-0.dll+0x3864b>)
==# 2 libglib-2.0-0.dll!? +0x0 (0x68811541 <libglib-2.0-0.dll+0x51541>)
==# 3 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:928]
==# 4 memory_region_init_ram_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1183]
==# 5 memory_map_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:38]
==# 6 uc_mem_map [C:\MinGW\msys64\projects\unicorn\qemu/../uc.c:596]
==# 7 VM_exec [C:\MinGW\msys64\projects/eflags_noset.c:56]
==# 8 main [C:\MinGW\msys64\projects/eflags_noset.c:99]

Error # 24: LEAK 10 direct bytes 0x0a70d070-0x0a70d07a + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f864b <libglib-2.0-0.dll+0x3864b>)
==# 2 libglib-2.0-0.dll!? +0x0 (0x68811541 <libglib-2.0-0.dll+0x51541>)
==# 3 object_property_add [qom/object.c:757]
==# 4 object_property_add [qom/object.c:735]
==# 5 object_property_add_child [qom/object.c:1089]
==# 6 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:933]
==# 7 memory_region_init_ram_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1183]
==# 8 memory_map_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:38]
==# 9 uc_mem_map [C:\MinGW\msys64\projects\unicorn\qemu/../uc.c:596]
==# 10 VM_exec [C:\MinGW\msys64\projects/eflags_noset.c:56]
==# 11 main [C:\MinGW\msys64\projects/eflags_noset.c:99]

Error # 25: LEAK 26 direct bytes 0x0a70d0a0-0x0a70d0ba + 0 indirect bytes
==# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2537]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f864b <libglib-2.0-0.dll+0x3864b>)
==# 2 libglib-2.0-0.dll!? +0x0 (0x68811541 <libglib-2.0-0.dll+0x51541>)
==# 3 object_property_add [qom/object.c:758]
==# 4 object_property_add [qom/object.c:735]
==# 5 object_property_add_child [qom/object.c:1089]
==# 6 memory_region_init_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:933]
==# 7 memory_region_init_ram_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1183]
==# 8 memory_map_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:38]
==# 9 uc_mem_map [C:\MinGW\msys64\projects\unicorn\qemu/../uc.c:596]
==# 10 VM_exec [C:\MinGW\msys64\projects/eflags_noset.c:56]
==# 11 main [C:\MinGW\msys64\projects/eflags_noset.c:99]

Error # 26: LEAK 288 direct bytes 0x0a70d0e0-0x0a70d200 + 0 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 qemu_ram_alloc_from_ptr_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1094]
==# 3 qemu_ram_alloc_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/exec.c:1113]
==# 4 memory_region_init_ram_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:1191]
==# 5 memory_map_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/memory.c:38]
==# 6 uc_mem_map [C:\MinGW\msys64\projects\unicorn\qemu/../uc.c:596]
==# 7 VM_exec [C:\MinGW\msys64\projects/eflags_noset.c:56]
==# 8 main [C:\MinGW\msys64\projects/eflags_noset.c:99]

Error # 27: LEAK 4096 direct bytes 0x0a71ea60-0x0a71fa60 + 0 indirect bytes
==# 0 replace_calloc [d:\drmemory_package\common\alloc_replace.c:2577]
==# 1 libglib-2.0-0.dll!? +0x0 (0x687f86a3 <libglib-2.0-0.dll+0x386a3>)
==# 2 page_find_alloc_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:411]
==# 3 tb_alloc_page_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:1328]
==# 4 tb_link_page_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:1428]
==# 5 tb_gen_code_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/translate-all.c:1104]
==# 6 tb_find_slow_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:360]
==# 7 tb_find_fast_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:388]
==# 8 cpu_x86_exec [C:/MinGW/msys64/projects/unicorn/qemu/cpu-exec.c:201]
==# 9 tcg_cpu_exec_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:205]
==# 10 tcg_exec_all_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:225]
==# 11 qemu_tcg_cpu_thread_fn_x86_64 [C:/MinGW/msys64/projects/unicorn/qemu/cpus.c:154]

FINAL SUMMARY:

DUPLICATE ERROR COUNTS:
Error ==# 1: 2
Error ==# 17: 16
Error ==# 18: 16

SUPPRESSIONS USED:

ERRORS FOUND:
0 unique, 0 total unaddressable access(es)
3 unique, 4 total uninitialized access(es)
0 unique, 0 total invalid heap argument(s)
0 unique, 0 total GDI usage error(s)
0 unique, 0 total handle leak(s)
0 unique, 0 total warning(s)
16 unique, 46 total, 4767 byte(s) of leak(s)
8 unique, 8 total, 2545 byte(s) of possible leak(s)

@aquynh
Copy link
Member

aquynh commented Nov 11, 2015

If you can fix any memleaks, please send PR. One by one, we will fix them
all eventually.

This will take time, as some leaks are deep inside the core, and harder to
fix.

Thanks.

On Nov 12, 2015 4:43 AM, "farmdve" notifications@github.com wrote:

Yes there is, one is in a strdup operation that is never freed on exit.


Reply to this email directly or view it on GitHub
#258 (comment)
.

@aquynh
Copy link
Member

aquynh commented Jan 6, 2016

@farmdve, something is still wrong with your memleak commit at farmdve@d3a8574, leading to a segfault. to reproduce, you can run ./samples/sample_x86 -0 and see it crash quickly (in under 1 min)

@aquynh aquynh mentioned this issue Jan 6, 2016
@farmdve
Copy link
Contributor

farmdve commented Jan 6, 2016

@aquynh

Thank you for catching that.

EDIT: The reason is this, I free cpu->thread in qemu_tcg_cpu_thread_fn, but cpu->thread is later used in uc->pause_all_vcpus.

@aquynh
Copy link
Member

aquynh commented Jan 7, 2016

now if you uncomment line https://github.com/unicorn-engine/unicorn/blob/master/samples/sample_x86.c#L921, compile then run sample_x86 -0 for a long time without having any issues, you should make a pull request.

@farmdve
Copy link
Contributor

farmdve commented Jan 7, 2016

I should also mention that InitializeCriticalSection by default retains some debug information which increases the memory footprint of the Unicorn, InitializeCriticalSectionEx(Vista+) has a special flag that can be passed to disable this debug information.

Since I know that people might run Unicorn or derivatives for malware analysis on Windows XP we can't use InitializeCriticalSectionEx, but maybe it should be an option in the makefile or something.

@danghvu
Copy link
Contributor

danghvu commented Jul 9, 2016

This is fixed in the master branch, please confirm

@danghvu
Copy link
Contributor

danghvu commented Dec 27, 2016

Please feel free to open a new one if you find more memory leak.

@danghvu danghvu closed this as completed Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants