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

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

Merged
tianjunwork merged 2 commits into
OpenVisualCloud:masterfrom
Austin-Hu:issues/413
Nov 12, 2019
Merged

Fixed the core dump issue with only 1 frame input.#415
tianjunwork merged 2 commits into
OpenVisualCloud:masterfrom
Austin-Hu:issues/413

Conversation

@Austin-Hu
Copy link
Copy Markdown
Contributor

@Austin-Hu Austin-Hu commented Nov 5, 2019

(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 Shutdown threads in a graceful way #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 .

(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 OpenVisualCloud#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>
@tianjunwork
Copy link
Copy Markdown
Contributor

tianjunwork commented Nov 6, 2019

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

Comment thread Source/Lib/Codec/EbEncHandle.c Outdated
@Austin-Hu
Copy link
Copy Markdown
Contributor Author

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

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

Signed-off-by: Austin Hu <austin.hu@intel.com>
@tianjunwork
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor Author

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.

@tianjunwork tianjunwork merged commit 1a0b2f6 into OpenVisualCloud:master Nov 12, 2019
@tianjunwork tianjunwork added the bug Something isn't working label Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SVT-HEVC] SvtHevcEncApp v1.4.1 core-dump occurred when encode

3 participants