-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Comments
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 Error # 2: UNINITIALIZED READ: reading register ax Error # 3: UNINITIALIZED READ: reading 0x0889fafc-0x0889fafd 1 byte(s) within 0x0889fafc-0x0889fb00 Error # 4: POSSIBLE LEAK 220 direct bytes 0x0a6d00f8-0x0a6d01d4 + 0 indirect bytes Error # 5: POSSIBLE LEAK 56 direct bytes 0x0a6d8198-0x0a6d81d0 + 144 indirect bytes Error # 6: POSSIBLE LEAK 40 direct bytes 0x0a6d83e0-0x0a6d8408 + 285 indirect bytes Error # 7: POSSIBLE LEAK 40 direct bytes 0x0a6d8828-0x0a6d8850 + 320 indirect bytes Error # 8: POSSIBLE LEAK 40 direct bytes 0x0a6d9710-0x0a6d9738 + 320 indirect bytes Error # 9: POSSIBLE LEAK 40 direct bytes 0x0a6d9ba0-0x0a6d9bc8 + 320 indirect bytes Error ==# 10: POSSIBLE LEAK 40 direct bytes 0x0a6da030-0x0a6da058 + 320 indirect bytes Error ==# 11: LEAK 9 direct bytes 0x0a705060-0x0a705069 + 0 indirect bytes Error ==# 12: LEAK 9 direct bytes 0x0a705090-0x0a705099 + 0 indirect bytes Error ==# 13: LEAK 9 direct bytes 0x0a7050e8-0x0a7050f1 + 0 indirect bytes Error ==# 14: LEAK 9 direct bytes 0x0a705118-0x0a705121 + 0 indirect bytes Error # 15: LEAK 10 direct bytes 0x0a705170-0x0a70517a + 0 indirect bytes Error # 16: LEAK 10 direct bytes 0x0a7051a0-0x0a7051aa + 0 indirect bytes Error # 17: LEAK 6 direct bytes 0x0a7051f8-0x0a7051fe + 0 indirect bytes Error # 18: LEAK 6 direct bytes 0x0a705220-0x0a705226 + 0 indirect bytes Error # 19: LEAK 72 direct bytes 0x0a70bad0-0x0a70bb18 + 0 indirect bytes Error # 20: LEAK 8 direct bytes 0x0a70bb38-0x0a70bb40 + 0 indirect bytes Error # 21: LEAK 16 direct bytes 0x0a70bb60-0x0a70bb70 + 0 indirect bytes Error # 22: POSSIBLE LEAK 40 direct bytes 0x0a70c688-0x0a70c6b0 + 320 indirect bytes Error # 23: LEAK 7 direct bytes 0x0a70ca70-0x0a70ca77 + 0 indirect bytes Error # 24: LEAK 10 direct bytes 0x0a70d070-0x0a70d07a + 0 indirect bytes Error # 25: LEAK 26 direct bytes 0x0a70d0a0-0x0a70d0ba + 0 indirect bytes Error # 26: LEAK 288 direct bytes 0x0a70d0e0-0x0a70d200 + 0 indirect bytes Error # 27: LEAK 4096 direct bytes 0x0a71ea60-0x0a71fa60 + 0 indirect bytes FINAL SUMMARY: DUPLICATE ERROR COUNTS: SUPPRESSIONS USED: ERRORS FOUND: |
If you can fix any memleaks, please send PR. One by one, we will fix them This will take time, as some leaks are deep inside the core, and harder to Thanks. On Nov 12, 2015 4:43 AM, "farmdve" notifications@github.com wrote:
|
@farmdve, something is still wrong with your memleak commit at farmdve@d3a8574, leading to a segfault. to reproduce, you can run |
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. |
now if you uncomment line https://github.com/unicorn-engine/unicorn/blob/master/samples/sample_x86.c#L921, compile then run |
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. |
This is fixed in the master branch, please confirm |
Please feel free to open a new one if you find more memory leak. |
There is only some memory leak :
valgrind --leak-check=yes ./mem_double_unmap
The text was updated successfully, but these errors were encountered: