Skip to content

VPLAY-12738 : "com.comcast.viper" crash on VIPA enabled devices cont…#1124

Closed
vinodkadungoth wants to merge 1 commit intodev_sprint_25_2from
feature/VPLAY-12560_sprint25_2
Closed

VPLAY-12738 : "com.comcast.viper" crash on VIPA enabled devices cont…#1124
vinodkadungoth wants to merge 1 commit intodev_sprint_25_2from
feature/VPLAY-12560_sprint25_2

Conversation

@vinodkadungoth
Copy link
Copy Markdown
Contributor

…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

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

  • Addit Fix for Unit Test compilation issue

  • Implement a less intrusive protection against stream abstraction mutex deadlock


…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>
@vinodkadungoth vinodkadungoth requested a review from a team as a code owner March 4, 2026 19:18
Copilot AI review requested due to automatic review settings March 4, 2026 19:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 representation in MPD track context when encountering an empty period to avoid dereferencing a stale pointer (fixing GetCurrentMimeType() 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.

Comment thread priv_aamp.cpp
Comment on lines 3817 to +3823
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");
}
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread fragmentcollector_mpd.cpp
{
AAMPLOG_WARN("empty period");
pMediaStreamContext->adaptationSet = NULL;
pMediaStreamContext->representation = NULL;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the functional fix, yes?

@pstroffolino pstroffolino deleted the feature/VPLAY-12560_sprint25_2 branch March 9, 2026 20:28
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

Successfully merging this pull request may close these issues.

4 participants