Exception at encoding core, MFXVideoCORE_SyncOperation permanently returns MFX_ERR_UNKNOWN after it

63 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Peter!

I didn't test imsdk2014 yet. I'll run tests in a few days and share results. Thank you!

 

I performed a series of runs of test application (single instance) for a few hours/days on i7-3770/i7-4770/i5-3330.
All ok, exceptions were not observed.

But when I run 2 applications simultaneously, the exceptions still occur.
And MFXVideoCORE_SyncOperation permanently returns MFX_WRN_IN_EXECUTION after it.
It happens after a few minutes/hours after application start.
Observed at i7-3770/i7-4770, win7x64, x86 application, MFX_IMPL_SOFTWARE, imsdk 1.8, msvs2010 (with latest updates).

Test application source and exception dumps are attached.

PS:
I'll test several encoder instances within one process also and share results.

Attachments: 

AttachmentSize
Download imsdk_h264enc_v3.zip10.42 KB
Download av_1.8.zip8.47 KB

So, tests of several encoder instances within one process are completed.

2 sessions (joined) and 2 encoders were used in all tests.
Environment: i7-3770 and i7-4770, win7x64, x86 application, MFX_IMPL_SOFTWARE, imsdk 1.8, msvs2010 (with latest updates).

1.
Sessions/encoders are created once, at application startup (infinite files are encoded).
Several-hours/days-runnings work well, exceptions were not observed.
Test application attached: imsdk_h264enc_multi_v1.zip

2.
Sessions are created once, at application startup. Encoders are recreated after each 1000-frames-file.
Got AV-exceptions.
Dumps are at imsdk_h264enc_multi_v2_av.zip, test application: imsdk_h264enc_multi_v2.zip.

3.
Parent session is created once, at application startup. Child session and encoders are recreated after each 1000-frames-file.
Got handles leak and AV-exceptions. Some AVs have interesting addresses: 0xabababab, 0xbaadf00d.
Exceptions are raised very quickly, after several/tens minutes after application start.
Dumps are at imsdk_h264enc_multi_v3_av.zip, test application: imsdk_h264enc_multi_v3.zip.

Attachments: 

Nothing has changed in the new imsdk 1.9.
AV-exceptions and IGFXKMDNotifyBatchBuffersComplete-handle leaks continue to occur.
You are implementing new features all the time, but can not ensure the normal operation of even basic functionality.
Sad.

 

Hi,

Very sorry for slow response. We are looking at this and appreciate the excellent description of issue.

-Tony

Hello, I have a similar problem.

I create three session for enconding three H264 streams in the same process but different threads and an internal exception is thrown in the library libmfxsw32.dll after 1 or 2 hours.

The issue seems that does not show up when only a session is created.

 

Thank you and regards,

 

And I saw exceptions within even 1process/1session during recent tests. Both sw and hw implementations, imsdk 1.8/1.9.

I'm tired of waiting for fixes and I aim to use encoders from other developers.

It's a pity, I used to be a better opinion about Intel.

Hello, I have noticed, that you have also handle leaks. I had detected some handle leaks too, but I thought that the problem came from another source,maybe I was wrong.

Ok, we will have to wait.

Thank you dj_alek.

 

I'm still seeing this error with the 2014 R2 version of the Media SDK.  

I turned on exception handling and got this message:

First-chance exception at 0x0000000000000030 in EncoderTest.exe: 0xC0000005: Access violation executing location 0x0000000000000030.

Here are the threads in play

Not Flagged        3348    0    Main Thread    Main Thread    libmfxsw64.dll!00000001800164c7    Normal
Not Flagged        3144    0    Worker Thread    ntdll.dll thread    ntdll.dll!000007fb059945db    Normal
Not Flagged        3716    0    Worker Thread    ntdll.dll thread    ntdll.dll!000007fb059945db    Normal
Not Flagged        2380    0    Worker Thread    combase.dll thread    combase.dll!000007fb0561196a    Normal
Not Flagged        1692    0    Worker Thread    ntdll.dll thread    ntdll.dll!000007fb059945db    Normal
Not Flagged        2132    0    Worker Thread    ntdll.dll thread    ntdll.dll!000007fb059945db    Normal
Not Flagged        1156    0    Worker Thread    CIndexer::ReadIndex    msvcr110.dll!malloc    Normal
Not Flagged        3968    0    Worker Thread    CIndexer::ReadIndex    msvcr110.dll!malloc    Normal
Not Flagged        424    0    Worker Thread    libmfxsw64.dll thread    libmfxsw64.dll!000000018001a62b    Normal
Not Flagged    >    3524    0    Worker Thread    libmfxsw64.dll thread    0000000000000030    Normal   <-- current thread
Not Flagged        2512    0    Worker Thread    libmfxsw64.dll thread    libmfxsw64.dll!000000018001a62b    Normal
Not Flagged        92    0    Worker Thread    libmfxsw64.dll thread    libmfxsw64.dll!000000018001a62b    Normal
Not Flagged        4504    0    Worker Thread    libmfxsw64.dll thread    libmfxsw64.dll!000000018001a811    Normal

 

 

After this, the encoder SyncOperation(syncPoint, 60000) returns either a MFX_WRN_IN_EXECUTION(1) error or MFX_ERR_UNKNOWN (-1).  

 

 

I am trying to use the JPEG Compressor.  

An interesting point is that I've found is that my content (720x368) needs to have the width/height adjusted as shown in the example code to make it aligned.  I've done this, but still get the problem in the sync operation.  

For the encoder surfaces, I'm using ippiMalloc_8u_C2(width, height *2, &stride) since my content is 422 YUY2.  If my content is  RGB4, then I call ippiMalloc_8u_C4(width, height * 4, &stride);  (width=736, height=384).

I have content that is already aligned (1920x1080) and there is no problems with the algorithm or the sync operation.

Any suggestions on how to debug this since the exception is coming from within the Media SDK?

 

As a follow up to the exception that I'm seeing from the SyncOperation:

First-chance exception at 0x0000000180312AD0 (libmfxsw64.dll) in EncoderTest.exe: 0xC0000005: Access violation reading location 0x000000031DA27000.

This is the disassembly of where the problem is occurring

0000000180312A8A  mov         rax,r11  
0000000180312A8D  vmovdqu     xmm0,xmmword ptr [r10]  
0000000180312A92  vmovdqu     xmmword ptr [r11],xmm0  
0000000180312A97  and         rax,0Fh  
0000000180312A9B  sub         rax,10h  
0000000180312A9F  sub         r10,rax  
0000000180312AA2  sub         r11,rax  
0000000180312AA5  add         rbx,rax  
0000000180312AA8  sub         rbx,40h  
0000000180312AAC  jl          0000000180312AEA  
0000000180312AAE  vmovdqu     xmm0,xmmword ptr [r10]  
0000000180312AB3  vmovdqa     xmmword ptr [r11],xmm0  
0000000180312AB8  vmovdqu     xmm0,xmmword ptr [r10+10h]  
0000000180312ABE  vmovdqa     xmmword ptr [r11+10h],xmm0  
0000000180312AC4  vmovdqu     xmm0,xmmword ptr [r10+20h]  
0000000180312ACA  vmovdqa     xmmword ptr [r11+20h],xmm0  
0000000180312AD0  vmovdqu     xmm0,xmmword ptr [r10+30h]      <--- exception is here
0000000180312AD6  add         r10,40h  
0000000180312ADA  vmovdqa     xmmword ptr [r11+30h],xmm0  
0000000180312AE0  add         r11,40h  
0000000180312AE4  sub         rbx,40h  
0000000180312AE8  jge         0000000180312AAE  
0000000180312AEA  add         rbx,40h  
0000000180312AEE  je          0000000180312B1F  
0000000180312AF0  test        rbx,20h  


The value for the registers are:

RAX = 0000000000000B40 
RBX = 00000000000006C0 
RCX = 0000000000000168 
RDX = 000000031D8A2FC0 
RSI = 0000000000000168 
RDI = 000000031DA26B90 
R8  = 0000000000000B40 
R9  = 0000000000000001 
R10 = 000000031DA26FD0 
R11 = 000000031D8A3400 
R12 = 0000000000000000 
R13 = 0000000000000002 
R14 = 0000000000000008 
R15 = 0000000000000018 
RIP = 0000000180312AD0 
RSP = 0000000311D7F900 
RBP = 000000000000002D 
EFL = 00010206 

The output bitstream going into the Encode Frame Async function is as follows and if I do the math : data+maxlength = 0x313c04040 + 0x652a70 = 0x314256ab0 so I’m guessing that this is not within the Access violation area listed above (0x31DA27000).  This is making me guess that the output data that I allocated with ippiMalloc_8u is not the cause of the  problem.

-mfxOutputBitStream
{EncryptedData=0x0000000000000000 <NULL> ExtParam=0x0000000000000000 {???} NumExtParam=0x0000 ...}mfxBitstream
EncryptedData 0x0000000000000000 <NULL>_mfxEncryptedData *
+ExtParam     0x0000000000000000 {???}mfxExtBuffer * *
NumExtParam   0x0000             unsigned short
+reserved     0x0000000311579030 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}unsigned int[0x00000006]
DecodeTimeStamp    0x0000000000000000  __int64
TimeStamp     0x0000000000000000       unsigned __int64
+Data         0x0000000313c04040 "ÿØÿà"unsigned char *
DataOffset    0x00000000               unsigned int
DataLength    0x00000000               unsigned int
MaxLength     0x00652a70               unsigned int
PicStruct     0x0000                   unsigned short
FrameType     0x0000                   unsigned short
DataFlag      0x0000                   unsigned short
reserved2     0x0000                   unsigned short


The input surface looks like this – and it too doesn’t seem to be in the area of the exception.

-surface  0x0000000312d303c0 {reserved=0x0000000312d303c0 {0x00000000, 0x00000000, 0x00000000, 0x00000000} Info=...}mfxFrameSurface1 *
+reserved    0x0000000312d303c0 {0x00000000, 0x00000000, 0x00000000, 0x00000000}unsigned int[0x00000004]
-Info        {reserved=0x0000000312d303d0 {0x00000000, 0x00000000, 0x00000000, 0x00000000} reserved4=0x0000 BitDepthLuma=...}   mfxFrameInfo
+reserved      0x0000000312d303d0 {0x00000000, 0x00000000, 0x00000000, 0x00000000}unsigned int[0x00000004]
reserved4      0x0000     unsigned short
BitDepthLuma   0x0000     unsigned short
BitDepthChroma 0x0000     unsigned short
Shift          0x0000     unsigned short
+FrameId      {TemporalId=0x0000 PriorityId=0x0000 DependencyId=0x0000 ...}mfxFrameId
FourCC         0x32595559 unsigned int
Width          0x02d0     unsigned short
Height         0x0170     unsigned short
CropX          0x0000     unsigned short
CropY          0x0000     unsigned short
CropW          0x02d0     unsigned short
CropH          0x0170     unsigned short
FrameRateExtN  0x00005f90 unsigned int
FrameRateExtD  0x00000eaa unsigned int
reserved3      0x0000     unsigned short
AspectRatioW   0x0000     unsigned short
AspectRatioH   0x0000     unsigned short
PicStruct      0x0001     unsigned short
ChromaFormat   0x0002     unsigned short
reserved2      0x0000     unsigned short
-Data         {reserved=0x0000000312d30418 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, ...} ...}mfxFrameData
+reserved     0x0000000312d30418 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}unsigned int[0x00000007]
reserved1     0x0000      unsigned short
PitchHigh     0x0000      unsigned short
TimeStamp     0x0000000000000000 unsigned __int64
FrameOrder    0x00000000  unsigned int
Locked        0x0001      unsigned short
Pitch         0x0b80      unsigned short
PitchLow      0x0b80      unsigned short
+Y            0x00000003137ac080 "%z%‚%|$„%|%‚%~%‚$}$$#$}$%~&‚'~'‚'~'‚'~'€(}((~'&}&€'~&‚&|&‚&|&‚&|&‚&{&‚&{%‚&{&ƒ'|'„'}(ƒ(|(„(|(„)|)ƒ)|)ƒ)|)„)|)„)|)„){(…)z+†-z.…-z,‡,{-‡.{/‡0z0†0y1†1x2†2x2‡2x2‡2x1‡1x1‡0y0‡0y0‡.y.‡.y,‡*y*†*y,…-z-ƒ...unsigned char *

+U
0x00000003137ac081 "z%‚%|$„%|%‚%~%‚$}$$#$}$%~&‚'~'‚'~'‚'~'€(}((~'&}&€'~&‚&|&‚&|&‚&|&‚&{&‚&{%‚&{&ƒ'|'„'}(ƒ(|(„(|(„)|)ƒ)|)ƒ)|)„)|)„)|)„){(…)z+†-z.…-z,‡,{-‡.{/‡0z0†0y1†1x2†2x2‡2x2‡2x1‡1x1‡0y0‡0y0‡.y.‡.y,‡*y*†*y,…-z-ƒ-...unsigned char *
+V
0x00000003137ac082 "%‚%|$„%|%‚%~%‚$}$$#$}$%~&‚'~'‚'~'‚'~'€(}((~'&}&€'~&‚&|&‚&|&‚&|&‚&{&‚&{%‚&{&ƒ'|'„'}(ƒ(|(„(|(„)|)ƒ)|)ƒ)|)„)|)„)|)„){(…)z+†-z.…-z,‡,{-‡.{/‡0z0†0y1†1x2†2x2‡2x2‡2x1‡1x1‡0y0‡0y0‡.y.‡.y,‡*y*†*y,…-z-ƒ-z...unsigned char *
+A
0x00000003137ac083 "‚%|$„%|%‚%~%‚$}$$#$}$%~&‚'~'‚'~'‚'~'€(}((~'&}&€'~&‚&|&‚&|&‚&|&‚&{&‚&{%‚&{&ƒ'|'„'}(ƒ(|(„(|(„)|)ƒ)|)ƒ)|)„)|)„)|)„){(…)z+†-z.…-z,‡,{-‡.{/‡0z0†0y1†1x2†2x2‡2x2‡2x1‡1x1‡0y0‡0y0‡.y.‡.y,‡*y*†*y,…-z-ƒ-z/...unsigned char *
MemId     0x0000000000000000  void *
Corrupted 0x0000              unsigned short
DataFlag  0x0000              unsigned short

 

Any suggestion of the root cause would be appreciated.

Thanks

IMSDK 1.11 (part of INDE 2015).
Exceptions problem isn't solved...

IMSDK 1.15 (INDE 2015 Update 2).
Still no improvements :((

 

Pages

Leave a Comment

Please sign in to add a comment. Not a member? Join today