Feature/vpaamp 411 debug#1604
Open
nebutler963 wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts DRM session cleanup ordering across AAMP teardown and the CDMI decryptor plugin to reduce the risk of use-after-free during GStreamer pipeline disposal and asynchronous DRM cleanup.
Changes:
- Move/centralize DRM session deactivation (
notifyCleanup()) intoPrivateInstanceAAMP::TeardownStream()after sink teardown, and remove earlier calls from HLS/MPD stream abstraction stop paths. - Proactively drop CDMI decryptor references to
drmSession/sessionManagerduringdispose()to avoid stale pointer usage during teardown.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| priv_aamp.cpp | Adds DRM cleanup notification during teardown after stopping the sink. |
| middleware/gst-plugins/drm/gst/gstcdmidecryptor.cpp | Nulls DRM session pointers in dispose() to reduce stale-pointer exposure during teardown. |
| fragmentcollector_mpd.cpp | Removes DRM cleanup notification from MPD stop path (now handled in teardown). |
| fragmentcollector_hls.cpp | Removes DRM cleanup notification from HLS stop path (now handled in teardown). |
Comment on lines
+259
to
+263
| // Nullify DRM session references before releasing GStreamer resources | ||
| // to prevent async DRM callbacks from accessing stale pointers | ||
| cdmidecryptor->drmSession = NULL; | ||
| cdmidecryptor->sessionManager = NULL; | ||
|
|
Comment on lines
+5798
to
+5806
| // Deactivate DRM session after pipeline teardown to avoid use-after-free race | ||
| // between GStreamer element disposal and async DRM session cleanup | ||
| if (!IsLocalAAMPTsb() && (ISCONFIGSET_PRIV(eAAMPConfig_UseSecManager) || ISCONFIGSET_PRIV(eAAMPConfig_UseFireboltSDK))) | ||
| { | ||
| if (mDRMLicenseManager) | ||
| { | ||
| mDRMLicenseManager->notifyCleanup(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a race condition, where the clean up of the pipeline occasionally before the pipeline was successfully stopped. This lead to a crash.
https://ccp.sys.comcast.net/browse/VPAAMP-411