-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
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
Found a memory leak #16591
Comments
Please add minimal reproducer application. BTW, your debug symbols looks broken. |
ok. I try again,now info list: 0:000> !heap -p -a 0x007E1248 0:000> !heap -p -a 0x007B9DD0 0:000> !heap -p -a 0x007CAD90 |
These are static data structures, they are allocated only once and should not be considered a memory leak. You can suppress these hits, we have suppression file for valgrind: https://github.com/opencv/opencv/blob/master/platforms/scripts/valgrind.supp , but I don't know whether the MSVC have similar mechanism. I'll close the issue, feel free to reopen if you have additional details. |
Thank you! |
System information (version)
Detailed description
Steps to reproduce
1.I use VS2017, C ++/MFC/Win32 project。When I quit the program, I found a memory leak。
Detected memory leaks!
Dumping objects ->
{377} normal block at 0x041259A8, 56 bytes long.
Data: < > 01 00 CD CD 00 00 00 00 00 00 00 00 00 00 00 00
{311} normal block at 0x04122DE8, 12 bytes long.
Data: 4F 70 65 6E 43 56 54 72 61 63 65 00
{310} normal block at 0x04131F48, 24 bytes long.
Data: < - > 01 00 00 00 E8 2D 12 04 00 00 00 00 00 00 00 00
{305} normal block at 0x040DE428, 128 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{304} normal block at 0x040DEC68, 128 bytes long.
Data: < > 00 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD
{303} normal block at 0x04123268, 8 bytes long.
Data: <,4 > 2C 34 12 04 00 00 00 00
{302} normal block at 0x04123100, 8 bytes long.
Data: < 4 > 1C 34 12 04 00 00 00 00
{301} normal block at 0x041233E8, 84 bytes long.
Data: < qb > 02 01 00 00 A8 85 71 62 00 00 00 00 CD CD CD CD
{300} normal block at 0x04120F90, 48 bytes long.
Data: < qb > 02 01 00 00 A8 85 71 62 00 00 00 00 CD CD CD CD
2.Then I used windbg.exe to debug and found the following information:
0:000> !heap -p -a 0x041259A8
address 041259a8 found in
_HEAP @ 40b0000
HEAP_ENTRY Size Prev Flags UserPtr UserSize - state
04125970 000f 0000 [00] 04125988 0005c - (busy)
77e93484 ntdll!RtlpCallInterceptRoutine+0x00000026
77e50a8a ntdll!RtlpAllocateHeapInternal+0x00055c8a
77dfadee ntdll!RtlAllocateHeap+0x0000003e
622ab4a5 ucrtbased!heap_alloc_dbg_internal+0x00000195
622ab2c6 ucrtbased!heap_alloc_dbg+0x00000036
622ada3a ucrtbased!_malloc_dbg+0x0000001a
622ae354 ucrtbased!malloc+0x00000014
*** WARNING: Unable to verify checksum for D:\My Resources\2-PartTime\SmartDispenser\SmartDispenser 2020.02.02\Debug\opencv_core420d.dll
*** ERROR: Symbol file could not be found. Defaulted to export symbols for D:\My Resources\2-PartTime\SmartDispenser\SmartDispenser 2020.02.02\Debug\opencv_core420d.dll -
5dbf7ed opencv_core420d!cv::SparseMat::ptr+0x00a38123
5cee65a opencv_core420d!cv::SparseMat::ptr+0x00966f90
5cee918 opencv_core420d!cv::SparseMat::ptr+0x0096724e
*** WARNING: Unable to verify checksum for D:\My Resources\2-PartTime\SmartDispenser\SmartDispenser 2020.02.02\Debug\opencv_imgproc420d.dll
*** ERROR: Symbol file could not be found. Defaulted to export symbols for D:\My Resources\2-PartTime\SmartDispenser\SmartDispenser 2020.02.02\Debug\opencv_imgproc420d.dll -
79e14fb3 opencv_imgproc420d!cvDrawContours+0x00f9eb8b
79b138bd opencv_imgproc420d!cvDrawContours+0x00c9d495
622c59df ucrtbased!_initterm+0x0000003f
7a0e90f7 opencv_imgproc420d!cvDrawContours+0x01272ccf
7a0e8fb9 opencv_imgproc420d!cvDrawContours+0x01272b91
7a0e93a3 opencv_imgproc420d!cvDrawContours+0x01272f7b
7a0e958f opencv_imgproc420d!cvDrawContours+0x01273167
77e31d36 ntdll!LdrxCallInitRoutine+0x00000016
77df5558 ntdll!LdrpCallInitRoutine+0x00000051
77e03edf ntdll!LdrpInitializeNode+0x00000133
77e04786 ntdll!LdrpInitializeGraphRecurse+0x0000005d
77e0479d ntdll!LdrpInitializeGraphRecurse+0x00000074
77e0479d ntdll!LdrpInitializeGraphRecurse+0x00000074
77e0479d ntdll!LdrpInitializeGraphRecurse+0x00000074
77e0479d ntdll!LdrpInitializeGraphRecurse+0x00000074
77e69472 ntdll!LdrpInitializeGraph+0x00000013
77e692b2 ntdll!LdrpInitializeProcess+0x00001cc2
77e11d21 ntdll!_LdrpInitialize+0x000000ba
77e11c11 ntdll!LdrInitializeThunk+0x00000011
0:000> !heap -p -a 0x041233E8
address 041233e8 found in
_HEAP @ 40b0000
HEAP_ENTRY Size Prev Flags UserPtr UserSize - state
041233b0 0012 0000 [00] 041233c8 00078 - (busy)
77e93484 ntdll!RtlpCallInterceptRoutine+0x00000026
77e50a8a ntdll!RtlpAllocateHeapInternal+0x00055c8a
77dfadee ntdll!RtlAllocateHeap+0x0000003e
622ab4a5 ucrtbased!heap_alloc_dbg_internal+0x00000195
622ab2c6 ucrtbased!heap_alloc_dbg+0x00000036
622ada3a ucrtbased!_malloc_dbg+0x0000001a
622ae354 ucrtbased!malloc+0x00000014
5dbf7ed opencv_core420d!cv::SparseMat::ptr+0x00a38123
5cef0ba opencv_core420d!cv::SparseMat::ptr+0x009679f0
5ce6570 opencv_core420d!cv::SparseMat::ptr+0x0095eea6
5cf53d5 opencv_core420d!cv::SparseMat::ptr+0x0096dd0b
5cf5465 opencv_core420d!cv::SparseMat::ptr+0x0096dd9b
5cf6eae opencv_core420d!cv::SparseMat::ptr+0x0096f7e4
5cfd155 opencv_core420d!cv::SparseMat::ptr+0x00975a8b
5cfd056 opencv_core420d!cv::SparseMat::ptr+0x0097598c
5cfd661 opencv_core420d!cv::SparseMat::ptr+0x00975f97
5cf603b opencv_core420d!cv::SparseMat::ptr+0x0096e971
5d2ca80 opencv_core420d!cv::SparseMat::ptr+0x009a53b6
5d259a2 opencv_core420d!cv::SparseMat::ptr+0x0099e2d8
5afe90b opencv_core420d!cv::SparseMat::ptr+0x00777241
5afecb5 opencv_core420d!cv::SparseMat::ptr+0x007775eb
5afe8b3 opencv_core420d!cv::SparseMat::ptr+0x007771e9
5986f2d opencv_core420d!cv::SparseMat::ptr+0x005ff863
622c59df ucrtbased!_initterm+0x0000003f
5dc17c7 opencv_core420d!cv::SparseMat::ptr+0x00a3a0fd
5dc1689 opencv_core420d!cv::SparseMat::ptr+0x00a39fbf
5dc1a73 opencv_core420d!cv::SparseMat::ptr+0x00a3a3a9
5dc1c5f opencv_core420d!cv::SparseMat::ptr+0x00a3a595
77e31d36 ntdll!LdrxCallInitRoutine+0x00000016
77df5558 ntdll!LdrpCallInitRoutine+0x00000051
77e03edf ntdll!LdrpInitializeNode+0x00000133
77e04786 ntdll!LdrpInitializeGraphRecurse+0x0000005d
3.What is the problem? How to deal with it?
The text was updated successfully, but these errors were encountered: