Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTC::Consumer::GetStats() | failed assertion `it != this->mapProfileRtpStream.end()': effective profile does not map to a rtp stream #160

Closed
ibc opened this issue Nov 13, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@ibc
Copy link
Member

ibc commented Nov 13, 2017

INFO:Participant#db6bivay consumer "effectiveprofilechange" event [profile:high]
INFO:Participant#db6bivay consumer "effectiveprofilechange" event [profile:none]
INFO:Participant#db6bivay consumer "effectiveprofilechange" event [profile:medium]
INFO:Participant#jxull4dn consumer "effectiveprofilechange" event [profile:high]
mediasoup-worker's stderr: ABORT[id:zxvppdey#1] RTC::Consumer::GetStats() | failed assertion `it != this->mapProfileRtpStream.end()': effective profile does not map to a rtp stream
mediasoup:ERROR:Worker child process exited [id:zxvppdey#1, code:null, signal:SIGABRT]

It happened once having stats retrieval enabled.

@ibc ibc added the bug label Nov 13, 2017
@ibc
Copy link
Member Author

ibc commented Nov 13, 2017

It seems that the same may crash on Consumer::GetLossPercentage().

@ibc
Copy link
Member Author

ibc commented Nov 13, 2017

It seems to me that effectiveProfile sometimes may point to targetProfile while such a profile does not exist in the map.

@jmillan
Copy link
Member

jmillan commented Nov 13, 2017

It seems to me that effectiveProfile sometimes may point to targetProfile while such a profile does not exist in the map.

your suspicion is correct :-)

ibc added a commit that referenced this issue Nov 13, 2017
- Fix #159: Don’t rely on VP8 payload descriptor flags to assure the existence of data.
- Fix #160: Reset `targetProfile` when the corresponding profile is removed.
@ibc
Copy link
Member Author

ibc commented Nov 17, 2017

It has crashed again in 2.0.4:

mediasoup-worker's stderr: ABORT[id:yoydtkfb#1] RTC::Consumer::GetStats() | failed assertion `it != this->mapProfileRtpStream.end()': effective profile does not map to a rtp stream

@ibc ibc reopened this Nov 17, 2017
@ibc
Copy link
Member Author

ibc commented Nov 17, 2017

It happens very often by just running:

CONSUMER.on('stats', (stats) => console.warn(JSON.stringify(stats, null, '  ')));
CONSUMER.enableStats();

AFAIS mostly when high stream dies.

@ibc
Copy link
Member Author

ibc commented Nov 17, 2017

AFAIS this commit e28738f fixed nothing. RecalculateTargetProfile() does not call to SetEffectiveProfile() at all.

// Target profile removed. Recalculate.
else if (this->targetProfile == profile)
{
	RecalculateTargetProfile();
}

It may perfectly happen that both targetProfile and effectiveProfile are the same, and also that it the removed profile. We are not updating effectiveProfileto NONE in that case so things crash.

@ibc
Copy link
Member Author

ibc commented Nov 17, 2017

Proposal: we need a test unit for the Consumer that provides source profiles, remove them, and checks that the effective and target profiles are always the proper ones.

ibc added a commit that referenced this issue Nov 17, 2017
@ibc
Copy link
Member Author

ibc commented Nov 17, 2017

a961e11 seems to fix the crash, and I would also say that I don't see frozen video anymore (#164) but I cannot confirm it at 100%.

Said that, there is something I don't like in the Consumer::RemoveProfile() method:

https://github.com/versatica/mediasoup/blob/master/worker/src/RTC/Consumer.cpp#L356

Why are we setting there the new targetProfile rather than relying on the RecalculateTargetProfile() method? IMHO we should rely on a single method to set the target profile (once we enable the effective one and add/remove available profiles).

@ibc
Copy link
Member Author

ibc commented Nov 20, 2017

Theoretically fixed in 2.0.5

@ibc ibc closed this as completed Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants