OpenVisualCloud / SVT-HEVC

SVT HEVC encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
519 stars 169 forks source link

Fixed the core dump issue with only 1 frame input. #415

Closed Austin-Hu closed 4 years ago

Austin-Hu commented 4 years ago

(When receiving only 1 frame input, )SvtHevcEncApp or any application may invokes EbDeinitEncoder() ahead of all the kernel threads complete processing. And EbDeinitEncoder() would free all the recorded memory objects which may be still used by some threads, so that race condition happens.

So fixed (worked around) this issue by terminating the kernel threads before freeing memories. Ideally, there should be some object reference and unreference mechanism to make the objects access safe.

Note:

  1. EbObjectIncLiveCount() couldn't be helpful to address such race condition, because it just avoids that an EbObjectWrapper_t object wouldn't be returned back to an empty queue prematurely;
  2. EB_SEND_END_OBJ() plus EB_CHECK_END_OBJ() (induced in PR #270) could not avoid such race condition, either. Because the objects can be freed at any moment when a kernel thread is running and needs to access to it.

Signed-off-by: Austin Hu austin.hu@intel.com

Fixes #413 .

tianjunwork commented 4 years ago

Hi Austin, it needs to be Fixes #413 to auto close #413

Austin-Hu commented 4 years ago

Hi Austin, it needs to be Fixes #413 to auto close #413

It's in the last line of the 1st comment.

tianjunwork commented 4 years ago

Hi Austin, it needs to be Fixes #413 to auto close #413

It's in the last line of the 1st comment.

As Chris pointed out before in #408, it has to be certain format so that Github can read. It has to be Fixes #413. Your last line doesn't work.

Austin-Hu commented 4 years ago

Hi Austin, it needs to be Fixes #413 to auto close #413

It's in the last line of the 1st comment.

As Chris pointed out before in #408, it has to be certain format so that Github can read. It has to be Fixes #413. Your last line doesn't work.

Thanks! Edited it.