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

Although there is no memory leak in the MFC dll project, it is reporting a memory leak. #90

Open
sym457 opened this issue Jan 20, 2025 · 0 comments

Comments

@sym457
Copy link

sym457 commented Jan 20, 2025

Although there is no memory leak in the MFC dll project, it is reporting a memory leak.

The symptom occurs when vld.h is added to the vs2019 precompiled header.

If you add vld.h to the top of the class source (cpp) file and cause a memory leak, the memory leak is reported normally, but the location of the memory leak is not displayed.
Please confirm.

Thank you.

----------------------------<pch.h>-------------------------------------
#pragma once

#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
#endif

#include "targetver.h"

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 일부 CString 생성자는 명시적으로 선언됩니다.
#include <vld.h>
#include <afxwin.h> // MFC 핵심 및 표준 구성 요소입니다.
#include <afxext.h> // MFC 확장입니다.

Visual Leak Detector read settings from: C:\Program Files (x86)\Visual Leak Detector\vld.ini
Visual Leak Detector Version 2.7.0 installed.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\bcryptprimitives.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\kernel.appcore.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\msctf.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\TextShaping.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\TextInputFramework.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\CoreMessaging.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\CoreUIComponents.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\WinTypes.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\cryptbase.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\SHCore.dll'을(를) 로드했습니다.
'TestNewUID.exe'(Win32): 'C:\Windows\System32\dwmapi.dll'을(를) 로드했습니다.
0x82e4 스레드가 종료되었습니다(코드: 0 (0x0)).
0x64cc 스레드가 종료되었습니다(코드: 0 (0x0)).
0x44dc 스레드가 종료되었습니다(코드: 0 (0x0)).
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 262 at 0x0000000051E2FC40: 176 bytes ----------
Leak Hash: 0x2FB83BD2, Count: 1, Total 176 bytes
Call Stack (TID 32104):
ucrtbased.dll!malloc_dbg()
mfc140ud.dll!0x00007FFF640B7BE9()
mfc140ud.dll!0x00007FFF6456D047()
mfc140ud.dll!0x00007FFF6456A1E4()
mfc140ud.dll!0x00007FFF6452ED45()
mfc140ud.dll!0x00007FFF64533D4F()
mfc140ud.dll!0x00007FFF645233F2()
mfc140ud.dll!0x00007FFF645245C1()
mfc140ud.dll!0x00007FFF6422C555()
USER32.dll!CallWindowProcW() + 0x691 bytes
USER32.dll!SendMessageW() + 0xACC bytes
USER32.dll!GetWindowDpiAwarenessContext() + 0x1F3 bytes
ntdll.dll!KiUserCallbackDispatcher() + 0x24 bytes
win32u.dll!NtUserShowWindow() + 0x14 bytes
mfc140ud.dll!0x00007FFF6457894A()
mfc140ud.dll!0x00007FFF6455A3C6()
mfc140ud.dll!0x00007FFF6455C685()
mfc140ud.dll!0x00007FFF6442CA1D()
mfc140ud.dll!0x00007FFF6442B286()
mfc140ud.dll!0x00007FFF6442AA72()
mfc140ud.dll!0x00007FFF6442668D()
mfc140ud.dll!0x00007FFF6435C36B()
mfc140ud.dll!0x00007FFF6438639C()
mfc140ud.dll!0x00007FFF64385BD6()
mfc140ud.dll!0x00007FFF6435F5C8()
E:\project\dndsoft\TestNewUI\TestNewUI.cpp (122): TestNewUID.exe!CTestNewUIApp::InitInstance() + 0x10 bytes
mfc140ud.dll!0x00007FFF6456F46C()
D:\a_work\1\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp (26): TestNewUID.exe!wWinMain()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (123): TestNewUID.exe!invoke_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): TestNewUID.exe!__scrt_common_main_seh() + 0x5 bytes
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): TestNewUID.exe!__scrt_common_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): TestNewUID.exe!wWinMainCRTStartup()
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
Data:
20 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 ....@... ........
00 00 00 00 00 00 00 00 40 8F 56 64 FF 7F 00 00 ........ @.Vd....
D0 92 56 64 FF 7F 00 00 78 79 73 64 FF 7F 00 00 ..Vd.... xysd....
00 00 00 00 00 00 00 00 11 00 00 00 CD CD CD CD ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 ........ ........
78 79 73 64 FF 7F 00 00 00 00 00 00 00 00 00 00 xysd.... ........
07 00 00 00 CD CD CD CD 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
04 00 00 00 00 00 00 00 20 7C 78 64 FF 7F 00 00 ........ .|xd....
08 00 00 00 00 00 00 00 02 00 00 00 CD CD CD CD ........ ........

---------- Block 3043 at 0x0000000051E2FE20: 176 bytes ----------
Leak Hash: 0xE1357A50, Count: 1, Total 176 bytes
Call Stack (TID 32104):
ucrtbased.dll!malloc_dbg()
mfc140ud.dll!0x00007FFF640B7C9A()
mfc140ud.dll!0x00007FFF640B7D3D()
mfc140ud.dll!0x00007FFF645746B4()
mfc140ud.dll!0x00007FFF64574174()
mfc140ud.dll!0x00007FFF6452FCDD()
mfc140ud.dll!0x00007FFF64533D4F()
mfc140ud.dll!0x00007FFF645233F2()
mfc140ud.dll!0x00007FFF645245C1()
mfc140ud.dll!0x00007FFF6422C555()
USER32.dll!CallWindowProcW() + 0x691 bytes
USER32.dll!SendMessageW() + 0xACC bytes
USER32.dll!GetWindowDpiAwarenessContext() + 0x1F3 bytes
ntdll.dll!KiUserCallbackDispatcher() + 0x24 bytes
win32u.dll!NtUserMessageCall() + 0x14 bytes
USER32.dll!GetSystemMetrics() + 0x37B bytes
USER32.dll!GetSystemMetrics() + 0x214 bytes
UxTheme.dll!GetUserColorPreference() + 0x824D bytes
UxTheme.dll!GetUserColorPreference() + 0x631A bytes
UxTheme.dll!GetUserColorPreference() + 0xA1DF bytes
UxTheme.dll!GetUserColorPreference() + 0x9A71 bytes
USER32.dll!IsWindowUnicode() + 0x12A bytes
USER32.dll!CallWindowProcW() + 0x691 bytes
USER32.dll!CallWindowProcW() + 0x16C bytes
mfc140ud.dll!0x00007FFF64527786()
mfc140ud.dll!0x00007FFF6452787C()
mfc140ud.dll!0x00007FFF640809FD()
mfc140ud.dll!0x00007FFF64561255()
mfc140ud.dll!0x00007FFF6452FB7F()
mfc140ud.dll!0x00007FFF64533D4F()
mfc140ud.dll!0x00007FFF645233F2()
mfc140ud.dll!0x00007FFF645245C1()
mfc140ud.dll!0x00007FFF6422C555()
USER32.dll!CallWindowProcW() + 0x691 bytes
USER32.dll!SendMessageW() + 0xACC bytes
USER32.dll!GetWindowDpiAwarenessContext() + 0x1F3 bytes
ntdll.dll!KiUserCallbackDispatcher() + 0x24 bytes
win32u.dll!NtUserMessageCall() + 0x14 bytes
USER32.dll!GetSystemMetrics() + 0x37B bytes
USER32.dll!GetSystemMetrics() + 0x214 bytes
UxTheme.dll!GetUserColorPreference() + 0x824D bytes
UxTheme.dll!SetWindowThemeAttribute() + 0xCB9 bytes
UxTheme.dll!GetUserColorPreference() + 0xA1DF bytes
UxTheme.dll!GetUserColorPreference() + 0x9A71 bytes
USER32.dll!IsWindowUnicode() + 0x12A bytes
USER32.dll!CallWindowProcW() + 0x691 bytes
USER32.dll!CallWindowProcW() + 0x16C bytes
mfc140ud.dll!0x00007FFF64527786()
mfc140ud.dll!0x00007FFF64533D9E()
mfc140ud.dll!0x00007FFF645233F2()
mfc140ud.dll!0x00007FFF645245C1()
mfc140ud.dll!0x00007FFF6422C555()
USER32.dll!CallWindowProcW() + 0x691 bytes
USER32.dll!IsWindowUnicode() + 0x3CD bytes
mfc140ud.dll!0x00007FFF644EF9F3()
mfc140ud.dll!0x00007FFF644F11FF()
mfc140ud.dll!0x00007FFF644F1307()
mfc140ud.dll!0x00007FFF6435B614()
mfc140ud.dll!0x00007FFF6456F558()
D:\a_work\1\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp (26): TestNewUID.exe!wWinMain()
Data:
10 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 ....@... ........
00 00 00 00 00 00 00 00 D0 32 57 64 FF 7F 00 00 ........ .2Wd....
C0 33 57 64 FF 7F 00 00 78 79 73 64 FF 7F 00 00 .3Wd.... xysd....
00 00 00 00 00 00 00 00 11 00 00 00 CD CD CD CD ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 ........ ........
78 79 73 64 FF 7F 00 00 00 00 00 00 00 00 00 00 xysd.... ........
07 00 00 00 CD CD CD CD 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
04 00 00 00 00 00 00 00 C0 A3 78 64 FF 7F 00 00 ........ ..xd....
08 00 00 00 00 00 00 00 01 00 00 00 CD CD CD CD ........ ........

---------- Block 28 at 0x0000000051E302D0: 176 bytes ----------
Leak Hash: 0x8B75800E, Count: 1, Total 176 bytes
Call Stack (TID 32104):
ucrtbased.dll!malloc_dbg()
mfc140ud.dll!0x00007FFF640B7C9A()
mfc140ud.dll!0x00007FFF640B7D3D()
mfc140ud.dll!0x00007FFF64535A24()
mfc140ud.dll!0x00007FFF64528CD4()
mfc140ud.dll!0x00007FFF6407C094()
mfc140ud.dll!0x00007FFF644F0A5D()
mfc140ud.dll!0x00007FFF640704FC()
mfc140ud.dll!0x00007FFF6435FF63()
E:\project\dndsoft\TestNewUI\TestNewUI.cpp (97): TestNewUID.exe!CTestNewUIApp::InitInstance()
mfc140ud.dll!0x00007FFF6456F46C()
D:\a_work\1\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp (26): TestNewUID.exe!wWinMain()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (123): TestNewUID.exe!invoke_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): TestNewUID.exe!__scrt_common_main_seh() + 0x5 bytes
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): TestNewUID.exe!__scrt_common_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): TestNewUID.exe!wWinMainCRTStartup()
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
Data:
E8 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 ....@... ........
00 00 00 00 00 00 00 00 80 6B 52 64 FF 7F 00 00 ........ .kRd....
70 7A 52 64 FF 7F 00 00 78 79 73 64 FF 7F 00 00 pzRd.... xysd....
00 00 00 00 00 00 00 00 11 00 00 00 CD CD CD CD ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 ........ ........
78 79 73 64 FF 7F 00 00 00 00 00 00 00 00 00 00 xysd.... ........
07 00 00 00 CD CD CD CD 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
04 00 00 00 00 00 00 00 88 A8 77 64 FF 7F 00 00 ........ ..wd....
40 00 00 00 00 00 00 00 01 00 00 00 CD CD CD CD @....... ........

---------- Block 2048 at 0x0000000051E61260: 72 bytes ----------
Leak Hash: 0xAE89E750, Count: 1, Total 72 bytes
Call Stack (TID 32104):
ucrtbased.dll!malloc_dbg()
mfc140ud.dll!0x00007FFF640B7C9A()
mfc140ud.dll!0x00007FFF640B7D3D()
mfc140ud.dll!0x00007FFF644F2F05()
mfc140ud.dll!0x00007FFF644F417E()
mfc140ud.dll!0x00007FFF6453107C()
mfc140ud.dll!0x00007FFF64374393()
mfc140ud.dll!0x00007FFF645339AF()
mfc140ud.dll!0x00007FFF644EF7C5()
mfc140ud.dll!0x00007FFF644F0ED0()
mfc140ud.dll!0x00007FFF644EFABF()
mfc140ud.dll!0x00007FFF644EF9CB()
mfc140ud.dll!0x00007FFF644F11FF()
mfc140ud.dll!0x00007FFF644F1307()
mfc140ud.dll!0x00007FFF6435B614()
mfc140ud.dll!0x00007FFF6456F558()
D:\a_work\1\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp (26): TestNewUID.exe!wWinMain()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (123): TestNewUID.exe!invoke_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): TestNewUID.exe!__scrt_common_main_seh() + 0x5 bytes
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): TestNewUID.exe!__scrt_common_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): TestNewUID.exe!wWinMainCRTStartup()
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
Data:
40 00 00 00 00 00 00 00 EA 0F 7B 00 00 00 00 00 @....... ..{.....
03 E1 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 ........ ........
46 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 F....... ........
FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 ........ ........

---------- Block 420 at 0x0000000051E932D0: 512 bytes ----------
Leak Hash: 0xF53C8450, Count: 1, Total 512 bytes
Call Stack (TID 32104):
ucrtbased.dll!malloc_dbg()
mfc140ud.dll!0x00007FFF6456E92C()
mfc140ud.dll!0x00007FFF644F0E47()
mfc140ud.dll!0x00007FFF6435A1A1()
mfc140ud.dll!0x00007FFF644F12CC()
mfc140ud.dll!0x00007FFF6435B614()
mfc140ud.dll!0x00007FFF6456F558()
D:\a_work\1\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp (26): TestNewUID.exe!wWinMain()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (123): TestNewUID.exe!invoke_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): TestNewUID.exe!__scrt_common_main_seh() + 0x5 bytes
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): TestNewUID.exe!__scrt_common_main()
D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): TestNewUID.exe!wWinMainCRTStartup()
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
Data:
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant