Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Valgrind reports of memory issues #461

Closed
intelmark opened this issue Jan 17, 2020 · 1 comment
Closed

Valgrind reports of memory issues #461

intelmark opened this issue Jan 17, 2020 · 1 comment
Labels
Clean up A cleaner implementation or improved functionality

Comments

@intelmark
Copy link
Contributor

intelmark commented Jan 17, 2020

Using the following command with valgrind:

valgrind --leak-check=yes ./SvtHevcEncApp -i /root/testfiles/ParkJoy_864x480_10bit_50Hz_P420.yuv -w 864 -h 480 -bit-depth 10 -b /root/testfiles/parkB.hevc -n 50

Here's the output from SvtHevcEncApp:

SVT-HEVC Encoder
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.3.0        64 bit
LIB Build date: Jan 16 2020 14:54:28
-------------------------------------------

Warning: input profile is not correct, force converting it from 1 to Main10 for 10 bits cases
Number of logical cores available: 112
Number of PPCS 107
-------------------------------------------
SVT [config]: Main10 Profile    Tier (auto)     Level (auto)
SVT [config]: EncoderMode / Tune                                                        : 7 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat             : 10 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo                              : 864 / 480 / 0
SVT [config]: FrameRate / Gop Size                                                      : 60 / 64
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure                  : 3 / 0 / 2
SVT [config]: BRC Mode / QP / LookaheadDistance / SceneChange                           : CQP / 32 / 17 / 1
SVT [config]: BitRateReduction / ImproveSharpness                                       : 0 / 0
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV            : 1 / 1 / 0 / 0
SVT [config]: De-blocking Filter / SAO Filter                                           : 1 / 1
SVT [config]: HME / UseDefaultHME                                                       : 1 / 1
SVT [config]: MV Search Area Width / Height                                             : 16 / 7
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                                     : 0 / 0 / 0 / 90
SVT [config]: More configurations for debugging:
SVT [config]: Channel ID / ActiveChannelCount                                           : 0 / 1
SVT [config]: Number of Logical Processors / Target Socket                              : 0 / -1
SVT [config]: Threads To RT / Thread Count / ASM Type                                   : 1 / 0 / 1
SVT [config]: Speed Control / Injector Frame Rate                                       : 0 / 60
SVT [config]: MaxCLL / MaxFALL / Output Reconstructed YUV                               : 0 / 0 / 0
SVT [config]: MasterDisplayColorVolume / DolbyVisionProfile                             : 0 / 0
SVT [config]: DisplayPrimaryX[0], DisplayPrimaryX[1], DisplayPrimaryX[2]                : 0 / 0 / 0
SVT [config]: DisplayPrimaryY[0], DisplayPrimaryY[1], DisplayPrimaryY[2]                : 0 / 0 / 0
SVT [config]: WhitePointX (0, 0) / DisplayMasteringLuminance Range [0 ~ 0]
SVT [config]: Constrained Intra / HDR / Code VPS SPS PPS / Code EOS                     : 0 / 0 / 1 / 0
SVT [config]: Sending VUI / Temporal ID / VPS Timing Info                               : 0 / 1 / 1
SVT [config]: SEI Message:
SVT [config]: AccessUnitDelimiter / BufferingPeriod / PictureTiming                     : 0 / 0 / 0
SVT [config]: RegisteredUserData / UnregisteredUserData / RecoveryPoint                 : 0 / 0 / 0
-------------------------------------------
Encoding       300
SUMMARY --------------------------------- Channel 1  --------------------------------
Total Frames            Frame Rate              Byte Count              Bitrate
         300            60.00 fps                  1731477              2770.36 kbps


Channel 1
Average Speed:          61.44 fps
Total Encoding Time:    4883 ms
Total Execution Time:   5172 ms
Average Latency:        1553 ms
Max Latency:            2021 ms
Encoder finished





Here are the Valgrind results captured:

Memcheck, a memory error detector
==38194== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==38194== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==38194== Command: ./SvtHevcEncApp -i /root/testfiles/ParkJoy_864x480_10bit_50Hz_P420.yuv -w 864 -h 480 -bit-depth 10 -b /root/testfiles/parkB.hevc - n 50
==38194== Parent PID: 25056
==38194== 
==38194== Warning: set address range perms: large range [0x6949040, 0x52dfd040) (undefined)
==38194== Conditional jump or move depends on uninitialised value(s)
==38194==    at 0x4E9151A: CopyInputBuffer (EbEncHandle.c:3828)
==38194==    by 0x4E91D71: EbH265EncSendPicture (EbEncHandle.c:3858)
==38194==    by 0x116C6E: ProcessInputBuffer (EbAppProcessCmd.c:1289)
==38194==    by 0x1127DE: main (EbAppMain.c:201)
==38194== 
==38194== Thread 211:
==38194== Conditional jump or move depends on uninitialised value(s)
==38194==    at 0x4F4309A: GenerateIntraReference16bitSamplesEncodePass (EbIntraPrediction.c:2085)
==38194==    by 0x4EFB824: EncodePass (EbCodingLoop.c:3292)
==38194==    by 0x4E7AC5B: EncDecKernel (EbEncDecProcess.c:2999)
==38194==    by 0x59256DA: start_thread (pthread_create.c:463)
==38194==    by 0x5C5E88E: clone (clone.S:95)
==38194== 
==38194== Conditional jump or move depends on uninitialised value(s)
==38194==    at 0x4F4311F: GenerateIntraReference16bitSamplesEncodePass (EbIntraPrediction.c:2086)
==38194==    by 0x4EFB824: EncodePass (EbCodingLoop.c:3292)
==38194==    by 0x4E7AC5B: EncDecKernel (EbEncDecProcess.c:2999)
==38194==    by 0x59256DA: start_thread (pthread_create.c:463)
==38194==    by 0x5C5E88E: clone (clone.S:95)
==38194== 
==38194== Thread 210:
==38194== Conditional jump or move depends on uninitialised value(s)
==38194==    at 0x4F430CD: GenerateIntraReference16bitSamplesEncodePass (EbIntraPrediction.c:2085)
==38194==    by 0x4EFB824: EncodePass (EbCodingLoop.c:3292)
==38194==    by 0x4E7AC5B: EncDecKernel (EbEncDecProcess.c:2999)
==38194==    by 0x59256DA: start_thread (pthread_create.c:463)
==38194==    by 0x5C5E88E: clone (clone.S:95)
==38194== 
==38194== Thread 1:
==38194== Conditional jump or move depends on uninitialised value(s)
==38194==    at 0x4E9151A: CopyInputBuffer (EbEncHandle.c:3828)
==38194==    by 0x4E91D71: EbH265EncSendPicture (EbEncHandle.c:3858)
==38194==    by 0x116CFA: ProcessInputBuffer (EbAppProcessCmd.c:1301)
==38194==    by 0x1127DE: main (EbAppMain.c:201)
==38194== 
==38194== Warning: set address range perms: large range [0x6949028, 0x52dfd058) (noaccess)
==38194== 
==38194== HEAP SUMMARY:
==38194==     in use at exit: 10,955,160 bytes in 13 blocks
==38194==   total heap usage: 523,968 allocs, 523,955 frees, 3,604,376,735 bytes allocated
==38194== 
==38194== 24 bytes in 1 blocks are definitely lost in loss record 1 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x4E857E6: EbInitHandle (EbEncHandle.c:1744)
==38194==    by 0x111ADB: InitEncoder (EbAppContext.c:626)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 88 bytes in 1 blocks are still reachable in loss record 2 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110879: AllocateInputBuffers (EbAppContext.c:371)
==38194==    by 0x111B6B: InitEncoder (EbAppContext.c:660)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 112 bytes in 1 blocks are still reachable in loss record 3 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x11079D: AllocateInputBuffers (EbAppContext.c:366)
==38194==    by 0x111B6B: InitEncoder (EbAppContext.c:660)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 112 bytes in 1 blocks are still reachable in loss record 4 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110E15: AllocateOutputBuffers (EbAppContext.c:428)
==38194==    by 0x111B8C: InitEncoder (EbAppContext.c:669)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 112 bytes in 1 blocks are still reachable in loss record 5 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110B71: AllocateOutputReconBuffers (EbAppContext.c:408)
==38194==    by 0x111BAD: InitEncoder (EbAppContext.c:678)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 792 bytes in 1 blocks are possibly lost in loss record 6 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x4E7E4FB: EbEncHandleCtor (EbEncHandle.c:463)
==38194==    by 0x4E9322C: InitH265EncoderHandle (EbEncHandle.c:4075)
==38194==    by 0x4E8580B: EbInitHandle (EbEncHandle.c:1749)
==38194==    by 0x111ADB: InitEncoder (EbAppContext.c:626)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 65,600 bytes in 1 blocks are still reachable in loss record 7 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x4E857B6: EbInitHandle (EbEncHandle.c:1738)
==38194==    by 0x111ADB: InitEncoder (EbAppContext.c:626)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 207,360 bytes in 1 blocks are still reachable in loss record 8 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110191: AllocateInputBuffer (EbAppContext.c:317)
==38194==    by 0x11095A: AllocateInputBuffers (EbAppContext.c:376)
==38194==    by 0x111B6B: InitEncoder (EbAppContext.c:660)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 207,360 bytes in 1 blocks are still reachable in loss record 9 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110297: AllocateInputBuffer (EbAppContext.c:324)
==38194==    by 0x11095A: AllocateInputBuffers (EbAppContext.c:376)
==38194==    by 0x111B6B: InitEncoder (EbAppContext.c:660)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 829,440 bytes in 1 blocks are still reachable in loss record 10 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x11008F: AllocateInputBuffer (EbAppContext.c:311)
==38194==    by 0x11095A: AllocateInputBuffers (EbAppContext.c:376)
==38194==    by 0x111B6B: InitEncoder (EbAppContext.c:660)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 1,244,160 bytes in 1 blocks are still reachable in loss record 11 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110C4F: AllocateOutputReconBuffers (EbAppContext.c:413)
==38194==    by 0x111BAD: InitEncoder (EbAppContext.c:678)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 2,000,000 bytes in 1 blocks are still reachable in loss record 12 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x110EF2: AllocateOutputBuffers (EbAppContext.c:433)
==38194==    by 0x111B8C: InitEncoder (EbAppContext.c:669)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== 6,400,000 bytes in 1 blocks are still reachable in loss record 13 of 13
==38194==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==38194==    by 0x10F4E4: AllocateMemoryTable (EbAppContext.c:46)
==38194==    by 0x111AB9: InitEncoder (EbAppContext.c:622)
==38194==    by 0x1125E4: main (EbAppMain.c:162)
==38194== 
==38194== LEAK SUMMARY:
==38194==    definitely lost: 24 bytes in 1 blocks
==38194==    indirectly lost: 0 bytes in 0 blocks
==38194==      possibly lost: 792 bytes in 1 blocks
==38194==    still reachable: 10,954,344 bytes in 11 blocks
==38194==         suppressed: 0 bytes in 0 blocks
==38194== 
==38194== For counts of detected and suppressed errors, rerun with: -v
==38194== Use --track-origins=yes to see where uninitialised values come from
==38194== ERROR SUMMARY: 308 errors from 7 contexts (suppressed: 0 from 0)
@tianjunwork tianjunwork added the Clean up A cleaner implementation or improved functionality label Feb 21, 2020
@tianjunwork
Copy link
Contributor

Fixed by #467

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Clean up A cleaner implementation or improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants