avs-device-sdk
avs-device-sdk copied to clipboard
GstreamerMediaPlayer: Fix callback function use-after-free
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.
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.