我正在开发一个SDL 1.2项目(Windows,C,Code :: Blocks,也使用sdl_tff库)。我试图用Dr.Memory检查内存泄漏,但我遇到的问题是它在启动时崩溃(下面提供的日志),
exe本身自行崩溃,一旦我将其使用的tff文件添加到其目录中,它就可以自行运行。
只要两个文件都在同一个目录中,两个文件在哪里都没关系,exe运行正常。
如何让Dr.Memory正确执行?
Dr. Memory version 1.8.0 build 8 built on Sep 9 2014 16:27:02
Dr. Memory results for pid 6168: "SDL_Project.exe"
Application cmdline: ""C:\CodeBlocks Projects\projectrepo\SDL_Project\bin\Debug\SDL_Project.exe""
Recorded 108 suppression(s) from default C:\Program Files (x86)\Dr. Memory\bin\suppress-default.txt
Error #1: UNADDRESSABLE ACCESS: reading 0x00000000-0x00000004 4 byte(s)
# 0 SDL_ttf.dll!? +0x0 (0x6f4c2a9d <SDL_ttf.dll+0x2a9d>)
# 1 SDL_ttf.dll!? +0x0 (0x6f4c2e1f <SDL_ttf.dll+0x2e1f>)
# 2 SDL_ttf.dll!? +0x0 (0x6f4c3253 <SDL_ttf.dll+0x3253>)
# 3 createText [C:/CodeBlocks Projects/projectrepo/SDL_Project/menu.c:99]
# 4 startMenu [C:/CodeBlocks Projects/projectrepo/SDL_Project/menu.c:70]
# 5 SDL_main [C:/CodeBlocks Projects/projectrepo/SDL_Project/main.c:68]
# 6 console_main [C:/CodeBlocks Projects/projectrepo/SDL_Project/menu.c:279]
# 7 WinMain@16 [C:/CodeBlocks Projects/projectrepo/SDL_Project/menu.c:279]
# 8 main [../../../../src/gcc-4.7.1/libgcc/config/i386/cygwin.S:185]
Note: @0:00:08.932 in thread 2912
Note: instruction: mov (%edi) -> %edx
===========================================================================
FINAL SUMMARY:
DUPLICATE ERROR COUNTS:
SUPPRESSIONS USED:
ERRORS FOUND:
1 unique, 1 total unaddressable access(es)
0 unique, 0 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)
0 unique, 0 total, 0 byte(s) of leak(s)
0 unique, 0 total, 0 byte(s) of possible leak(s)
ERRORS IGNORED:
82 potential error(s) (suspected false positives)
(details: C:\Users\User\AppData\Roaming\Dr. Memory\DrMemory-SDL_Project.exe.6168.000\potential_errors.txt)
183 potential leak(s) (suspected false positives)
(details: C:\Users\User\AppData\Roaming\Dr. Memory\DrMemory-SDL_Project.exe.6168.000\potential_errors.txt)
12 unique, 18 total, 323 byte(s) of still-reachable allocation(s)
(re-run with "-show_reachable" for details)
Details: C:\Users\User\AppData\Roaming\Dr. Memory\DrMemory-SDL_Project.exe.6168.000\results.txt