Showing results for 
Search instead for 
Did you mean: 

invalid read/write shown by valgrind

While using Media-SDK calls with iHD video driver, valgrind shows some invalid read/write and conditional jumps in Some of the sample errors given by valgrind are pasted below. We are observing that our application crashes sometimes after processing about 100K-200K frames of VGA size (Color Conversion followed by h.264 encode). We are not able to simulate the crash on small application hence have to depend on tools like valgrind. If you suggest any other tool to check memory problems we can do that as well.

Media SDK used from - MediaServerStudioEssentials2017R3

OS: Ubuntu 16.04

H/W: Intel compute stick core-m3

==2164== Conditional jump or move depends on uninitialised value(s)
==2164==    at 0xF253CE5: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x12498A98: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x12498C0D: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x12646C18: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1265A45E: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x12648D7E: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1264F252: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1247DF4F: MFXVideoVPP_QueryIOSurf (in /opt/intel/mediasdk/lib64/
==2164==    by 0x46FDCF: sr::VideoPreProcessorElement::setupSession(mfxVideoParam*) (VideoPreProcessorElement.cpp:328)

==2164== Invalid write of size 8
==2164==    at 0x4C3453F: memset (in /usr/lib/valgrind/
==2164==    by 0xF1FF367: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF1FC333: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF1F6693: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF1DC2CF: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF26EDF4: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xB66ECA3: vaCreateContext (in /usr/lib64/
==2164==    by 0x12592F84: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1258DFA7: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1251B1A7: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x12516C75: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x12479343: MFXVideoENCODE_Init (in /opt/intel/mediasdk/lib64/
==2164==  Address 0x7f74098e4000 is not stack'd, malloc'd or (recently) free'd

==2164== Invalid write of size 2
==2164==    at 0x4C3242B: memcpy@GLIBC_2.2.5 (in /usr/lib/valgrind/
==2164==    by 0xF286D0B: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF1FFAC8: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF1DD16B: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF06C89A: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF066588: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF1DC38C: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xF26EDF4: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0xB66ECA3: vaCreateContext (in /usr/lib64/
==2164==    by 0x12592F84: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1258DFA7: ??? (in /opt/intel/mediasdk/lib64/
==2164==    by 0x1251B1A7: ??? (in /opt/intel/mediasdk/lib64/
==2164==  Address 0x7f74098d2180 is not stack'd, malloc'd or (recently) free'd


0 Kudos
1 Reply

Even the sample_encode when run under valgrind gives similar invalid read/write and conditional jump errors. Command used is given below

$ valgrind ./sample_encode h264 -i streams/test_stream_176x96.yuv -w 176 -h 96 -o /tmp/test.h264 -hw

Also if instead of -hw, -sw is used (software encode) - It only shows few conditional jumps