Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

GstreamerMediaPlayer: Fix callback function use-after-free #1867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tbluc4
Copy link

@tbluc4 tbluc4 commented Jan 20, 2021

Allocate a copy of the callback function and promise, and keep it until it
was executed. This fixes a problem where the callback function could
be freed as soon as the callback function sets the promise value and
the thread waiting on the promise exits the function immediately, freeing
the closure data while it is still executing.

We're trying to use the SDK in an x86-32 environment (not using the sample app), but are running into issues that appear to be timing sensitive bugs. This environment is considerably faster than the preferred arm-based Raspi-based setup, which is likely a key factor in reproducing this problem. It would randomly cause Alexa to stop responding and be stuck in "thinking" state, no longer accepting any requests. Usually after making no more than 5-15 requests, which can also easily be reproduced in an automated fashion.

@tbluc4 tbluc4 force-pushed the GstreamerMediaPlayerCallbackFixes branch from c7bdf09 to 5450083 Compare January 20, 2021 17:31
Allocate a copy of the callback function and promise, and keep it until it
was executed. This fixes a problem where the callback function could
be freed as soon as the callback function sets the promise value and
the thread waiting on the promise exits the function immediately, freeing
the closure data while it is still executing.
@tbluc4 tbluc4 force-pushed the GstreamerMediaPlayerCallbackFixes branch from 5450083 to 5990e30 Compare January 20, 2021 17:56
@womw
Copy link
Contributor

womw commented Jan 20, 2021

Hi @tbluc4

Thank you for the pull request. Our process is to make changes internally and run all test before pushing the change to github in the form of a new release. I have added this to our internal tracking system to be assessed and prioritized.

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

Successfully merging this pull request may close these issues.

2 participants