VPLAY-12738 : "com.comcast.viper" crash on VIPA enabled devices cont…#1124
VPLAY-12738 : "com.comcast.viper" crash on VIPA enabled devices cont…#1124vinodkadungoth wants to merge 1 commit intodev_sprint_25_2from
Conversation
…ibuting BERR. (#1033) * Crash in GetCurrentMimeType() on empty period Reason for Change: Potential floating pointer with empty periods Test Procedure: Tune regression testing Risk: Low Signed-off-by: James Lofthouse <james_lofthouse@comcast.com> * LLAMA-18029 Release stream lock before calling Stop() Reason for Change: Fix deadlock Test Procedure: Stress test rewind to TSB start with increased progress frequency Risk: Low Signed-off-by: Jose Fagundez <jfagunde@synamedia.com> * VPLAY-12067 - [Linear] Crash occurred in PreFetchThread in channel change (#746) * VPLAY-12067 - [Linear] Crash occurred in PreFetchThread while doing sequential channel change Reason for change: In sequential channel change scenario, stop can be initiated when AampLicensePreFetcher::PreFetchThread is in the middle of processing the license request(ie in the middle of executing CreateDRMSession()). This operation internally uses StreamAbstractionAamp object(mFetchInstance) to call UpdateFailedDRMStatus. As PrivateInstanceAAMP::Stop progresses, it can destroy the StreamAbstractionAamp object, but this status will reflect in AampLicensePreFetcher at a later point when mDRMLicenseManager->Stop() is called. Meanwhile, PreFetchThread is calling UpdateFailedDRMStatus on the destroyed object and leading to crash. Changes: * Setting mFetchInstance in AampLicensePreFetcher to nullptr before destroying StreamAbstractionAamp object. Test Procedure: Refer JIRA ticket Risks: low Signed-off-by: anjali-syna <206662904+anjali-syna@users.noreply.github.com> * Addit Fix for Unit Test compilation issue Signed-off-by: anjali-syna <206662904+anjali-syna@users.noreply.github.com> * Implement a less intrusive protection against stream abstraction mutex deadlock --------- Signed-off-by: James Lofthouse <james_lofthouse@comcast.com> Signed-off-by: Jose Fagundez <jfagunde@synamedia.com> Signed-off-by: anjali-syna <206662904+anjali-syna@users.noreply.github.com> Co-authored-by: James Lofthouse <james_lofthouse@comcast.com> Co-authored-by: Jose Fagundez <jfagunde@synamedia.com> Co-authored-by: anjali-syna <206662904+anjali-syna@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses crash/deadlock scenarios in AAMP’s playback control and DASH MPD track handling, particularly around edge cases like empty periods and rewind-to-TSB-start workflows.
Changes:
- Update
PlayFromTsbStart()to use a non-blocking stream lock attempt to avoid a potential deadlock during rewind-to-BOS handling. - Clear
representationin MPD track context when encountering an empty period to avoid dereferencing a stale pointer (fixingGetCurrentMimeType()crash path).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| priv_aamp.cpp | Switches PlayFromTsbStart() from blocking lock acquisition to TryStreamLock() to reduce deadlock risk. |
| fragmentcollector_mpd.cpp | Nulls pMediaStreamContext->representation on empty periods to prevent stale-pointer deref in MIME type lookup. |
| rate = AAMP_NORMAL_PLAY_RATE; | ||
| AcquireStreamLock(); | ||
| TuneHelper(eTUNETYPE_SEEK); | ||
| ReleaseStreamLock(); | ||
| // Try to acquire the lock with a timeout to avoid deadlock | ||
| // If we can't get the lock, another operation is in progress | ||
| if (!TryStreamLock()) | ||
| { | ||
| AAMPLOG_WARN("Could not acquire stream lock for PlayFromTsbStart, operation already in progress"); | ||
| } |
There was a problem hiding this comment.
TryStreamLock() is a non-blocking try_lock() (no timeout), but the comment says it uses a timeout. More importantly, rate is set to AAMP_NORMAL_PLAY_RATE and NotifySpeedChanged(rate) is called even when the lock can't be acquired, so MonitorProgress() will stop retrying PlayFromTsbStart() while the underlying seek/tune never happened. Consider only updating rate/sending the speed-changed notification after a successful lock + TuneHelper(), or keep the rewind rate unchanged when the lock isn't acquired (and/or schedule a retry) to avoid leaving playback state inconsistent.
| { | ||
| AAMPLOG_WARN("empty period"); | ||
| pMediaStreamContext->adaptationSet = NULL; | ||
| pMediaStreamContext->representation = NULL; |
There was a problem hiding this comment.
This is the functional fix, yes?
…ributing BERR. (#1033)
Crash in GetCurrentMimeType() on empty period Reason for Change: Potential floating pointer with empty periods Test Procedure: Tune regression testing
Risk: Low
LLAMA-18029 Release stream lock before calling Stop()
Reason for Change: Fix deadlock
Test Procedure: Stress test rewind to TSB start with increased progress
frequency
Risk: Low
VPLAY-12067 - [Linear] Crash occurred in PreFetchThread in channel change (VPLAY-12067 - [Linear] Crash occurred in PreFetchThread in channel change #746)
VPLAY-12067 - [Linear] Crash occurred in PreFetchThread while doing sequential channel change
Reason for change: In sequential channel change scenario, stop can be initiated
when AampLicensePreFetcher::PreFetchThread is in the middle of processing the
license request(ie in the middle of executing CreateDRMSession()). This
operation internally uses StreamAbstractionAamp object(mFetchInstance)
to call UpdateFailedDRMStatus. As PrivateInstanceAAMP::Stop progresses,
it can destroy the StreamAbstractionAamp object, but this status will reflect
in AampLicensePreFetcher at a later point when mDRMLicenseManager->Stop()
is called. Meanwhile, PreFetchThread is calling UpdateFailedDRMStatus
on the destroyed object and leading to crash.
Changes:
Test Procedure: Refer JIRA ticket
Risks: low
Addit Fix for Unit Test compilation issue
Implement a less intrusive protection against stream abstraction mutex deadlock