Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of deleted Adaptor in formatContextFinalizer() #8

Closed
mandersan opened this issue May 7, 2019 · 1 comment
Closed

Use of deleted Adaptor in formatContextFinalizer() #8

mandersan opened this issue May 7, 2019 · 1 comment

Comments

@mandersan
Copy link

Hi,

I've seen a number of odd issues when using Beamcoder heavily, and I believe this is due to a 'use after free' issue in the following line of code - https://github.com/Streampunk/beamcoder/blob/master/src/format.cc#L3831

Immediately prior to this the Governor is collected which deletes the Adaptor instance, so the Adaptor instance (passed as a hint) used in formatContextFinalizer() is no longer valid.

The issues I've seen are segfaults & hangs (waiting to lock an invalid mutex), and stability is much better removing the above mentioned call to 'adaptor->finish()'.

I'm not sure that this is the best fix for this issue though, which is why I've not submitted a pull request.

Thanks

@scriptorian
Copy link
Contributor

Thanks very much for the report!
I have reviewed this and made the change you suggested, along with a few other tidy ups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants