Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

invalid read/write shown by valgrind

Ashim_Prasad
Beginner
871 Views

While using Media-SDK calls with iHD video driver, valgrind shows some invalid read/write and conditional jumps in iHD_drv_video.so 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==
==2164== Conditional jump or move depends on uninitialised value(s)
==2164==    at 0xF253CE5: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0x12498A98: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x12498C0D: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x12646C18: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1265A45E: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x12648D7E: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1264F252: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1247DF4F: MFXVideoVPP_QueryIOSurf (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x46FDCF: sr::VideoPreProcessorElement::setupSession(mfxVideoParam*) (VideoPreProcessorElement.cpp:328)

==2164== Invalid write of size 8
==2164==    at 0x4C3453F: memset (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2164==    by 0xF1FF367: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF1FC333: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF1F6693: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF1DC2CF: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF26EDF4: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xB66ECA3: vaCreateContext (in /usr/lib64/libva.so.1.9900.0)
==2164==    by 0x12592F84: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1258DFA7: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1251B1A7: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x12516C75: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x12479343: MFXVideoENCODE_Init (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==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/vgpreload_memcheck-amd64-linux.so)
==2164==    by 0xF286D0B: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF1FFAC8: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF1DD16B: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF06C89A: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF066588: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF1DC38C: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xF26EDF4: ??? (in /opt/intel/mediasdk/lib64/iHD_drv_video.so)
==2164==    by 0xB66ECA3: vaCreateContext (in /usr/lib64/libva.so.1.9900.0)
==2164==    by 0x12592F84: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1258DFA7: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==    by 0x1251B1A7: ??? (in /opt/intel/mediasdk/lib64/libmfxhw64-p.so.1.23)
==2164==  Address 0x7f74098d2180 is not stack'd, malloc'd or (recently) free'd
==2164==

 

0 Kudos
1 Reply
Ashim_Prasad
Beginner
871 Views

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

0 Kudos
Reply