New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598928 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Regression



Sign in to add a comment

An erroneous BYE packet is sent from the receiving side when setting track.enabled = true after it has been false

Reported by rolly.fo...@gmail.com, Mar 30 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:48.0) Gecko/20100101 Firefox/48.0

Steps to reproduce the problem:
0. With a "publisher" sender video and audio and a "subscriber" receiving video
1. On the receiving side disable the video MediaStreamTrack (track.enabled = false)
2. Then re-enable the MediaStreamTrack

Note that the receiver sends BYE packet to the sender.

What is the expected behavior?

Chrome should not have send BYE to the sender.

What went wrong?
Attached is the offer, answer, and a Wireshark trace of a reproduction. This was captured on Chrome 50.0.2661.37, 64bit, running on Linux. Chrome was launched with the option "--disable-webrtc-encryption", so the packets can be decoded in wireshark.

The packet #5259 is the one causing the problem: the sender sends a receiver report, source description and a goodbye (the one that should not be sent).

Chrome itself seems to ignore the extra BYE, some other systems do not. Systems that honour the spurious BYE disconnect the sender.

Did this work before? Yes 

Chrome version: 50.0.2661.37  Channel: beta
OS Version: 
Flash Version: 

Note: this behaviour is only in Chrome 50, 49 is fine as is 51. I couldn't find an existing ticket for this, but it does seem to be fixed in 51.

If this has been fixed in 51 will the fix be backported to 50?

This one is generally easy to reproduce with browser based WebRTC app but let me know if it would help to write up a minimal test page and I'll do so.
 
answer.txt
1.4 KB View Download
offer.txt
2.3 KB View Download
capture.pcapng
6.0 MB Download
Components: Internals>WebRTC Blink>WebRTC
Cc: srnarayanan@chromium.org tommi@chromium.org jansson@chromium.org
Labels: -Pri-2 M-50 Pri-1
Owner: pthatcher@chromium.org
Status: Assigned (was: Unconfirmed)
Thank you for the thorough bug report!

> but let me know if it would help to write up a minimal test page and I'll do so.
If it's not too much trouble, would you create a minimal test page?

As for triaging - I'm not sure if this falls in the realm of tommi@'s team or pthatcher@'s, so I'm randomly setting pthatcher as owner. I'm setting this as a P1 in the hopes that someone can identify what fixed this in 51 (or broke this in 50) so that we can try to request an appropriate merge before 50 goes to the stable channel.
repro'd in 50.0.2661.49 by setting
  pc2.getRemoteStreams()[0].getVideoTracks()[0].enabled = false
and then to true again on  https://webrtc.github.io/samples/src/content/peerconnection/pc1/
event log attached. When converting it to a pcap with https://github.com/fippo/dump-webrtc-event-log the extra bye is in packet #837
bye.log
225 KB View Download

Comment 4 by juberti@webrtc.org, Mar 30 2016

Probably we are (were?) calling StopSend as a result of the disable, which seems wrong. Disable should just mute the outbound media.
Cc: pbos@chromium.org mflodman@chromium.org

Comment 6 by pbos@chromium.org, Mar 31 2016

Cc: deadbeef@chromium.org
Cc: holmer@chromium.org
fippo, can you provide some guidance on using dump-webrtc-event-log? I tried using "node rtp.js bye.log | text2pcap -u 10000,20000 - bye.pcap" but the 837th packet didn't look like a "bye".

Also, I couldn't reproduce the issue with 50.0.2661.49, using the "pc1" sample and disabling the remote track. Though if I disable the LOCAL track, a BYE is sent. Is there something I'm missing?
taylor: did you right-click and "decode as" -> "rtcp" in wireshark when viewing the bye.pcap? second report in packet.

Coudld not repro with 50.0.2661.57 that way anymore. Might be a good sign if that is fixed.

rolly?
If I decode as RTCP all I see is "RTCP frame length check: OK - 0 bytes". (Sorry, I'm a pretty novice Wireshark user).

Also, there hasn't been any WebRTC change on the m50 branch for two weeks, so I doubt the root problem is fixed. I still can't reproduce it though.

Comment 11 by jpu...@tokbox.com, Apr 6 2016

I confirm that the issue is still happening in version 50.0.2661.57 beta (64-bit)
I still can't reproduce it, on any version. Would it be possible to provide a minimal test page, as you offered earlier? And/or provide a chrome debug log?

Comment 13 by jpu...@tokbox.com, Apr 7 2016

Here is a test page:
https://dl.dropboxusercontent.com/u/2001525/bye/sender.html

Start the sender, and then click in the "mute and unmute sender".

If you want to use directly wireshark, you need to disable encription for webrtc:
/opt/google/chrome-beta/google-chrome-beta --disable-webrtc-encryption

Then open wireshark and capture the loopback interface. When clicking on the mute-unmute button, you will see the bye packet passing through
The test page disables and enables the track of the sender (which I did notice sends a BYE back in comment #8).

But I thought this bug was about disabling and enabling the track of the receiver? 

Comment 15 by jpu...@tokbox.com, Apr 7 2016

oh, you are totally right. Even though the description refers to the receiver, the bug applies to both of them. In the page that fippo commented, you can also use this code to repro the bug in the sender:

pc1.getLocalStreams()[0].getVideoTracks()[0].enabled = false; pc1.getLocalStreams()[0].getVideoTracks()[0].enabled = true;
Just to be clear: do you ever see this bug if you *only* disable the track in the remote stream? Because that's what I've been unable to reproduce.

If this only occurs when disabling the local track, I can start figuring out what CLs can be cherry-picked to fix it in M50. I just want to be sure I fully understand the cause of the issue.

Comment 17 by jpu...@tokbox.com, Apr 8 2016

no, it when I *enable* the track again after it has been disabled
I modified your test page to disable/enable the remote tracks, and ran with google-chrome-beta, but I still do not see any goodbye messages.

If possible, could you attach a chrome debug log to this bug (ideally also logging when you flip the "enabled" flag)?

In the meantime, I'll at least work on fixing the "bye" message when the local track is disabled.
Labels: Merge-Request-50

Comment 20 by tin...@google.com, Apr 9 2016

Labels: -Merge-Request-50 Merge-Review-50 Hotlist-Merge-Review
[Automated comment] Less than 2 weeks to go before stable on M50, manual review required.

Comment 21 by tommi@chromium.org, Apr 10 2016

Has the issue been fixed? I don't see what classes we're asking to be merged. 

Comment 22 by tommi@chromium.org, Apr 10 2016

Cl, not classes (auto correct) 
The issue was fixed recently by this CL: https://codereview.webrtc.org/1840043005

Here's a CL to cherry pick this fix into M50: https://codereview.webrtc.org/1870283002/

Comment 24 by tommi@chromium.org, Apr 10 2016

Great! Thanks for the update.  Do you think this is serious enough to ask for a merge to 50 (it'll be going to stable in just over a week I would guess)?  We'll need to have some bake time on dev and beta first (looks like the fix just made it in time before beta), so we'd probably be looking at merging in about a week's time anyway.
The merge request process requires confirmation that the fix works in Canary (proxy for ToT). https://codereview.webrtc.org/1840043005 looks like it landed in trunk about a week ago, and from looking at DEPS files, it looks like the fix first appears in Chrome 51.0.2701.0. 

deadbeef@, can you confirm that you've verified that your fix works with Chrome 51.0.2701.0 (or a newer version)?
Yes, I've verified it works in Chrome 51.0.2705.0. Also, I believe the fix is low-risk, since it just adds back a block of code that was inadvertently deleted during refactoring.

As for how serious the issue is: would you care to weigh in, jpujol@? How many systems are affected by the spurious BYE?

Comment 27 by jpu...@tokbox.com, Apr 11 2016

RFC 3550 states the following: "When a participant wishes to leave a session, a BYE packet is transmitted to inform the other participants of the event."

So my understanding is that systems in the middle of the conference may disconnect the bye sender, according to that.

Because of it, I think it is a very important issue to be fixed

Comment 28 by tin...@google.com, Apr 11 2016

Labels: -Merge-Review-50 Merge-Approved-50
Merge approved for M50 (branch 2661). Pls go ahead merge.

Comment 30 by tin...@google.com, Apr 11 2016

Labels: -Merge-Approved-50
Taylor@ Is this fixed? If not -- is this Pri-1 (given the time of the last update)?
Status: Fixed (was: Assigned)
Yes, it was fixed and merged to M50, just forgot to update status.

Sign in to add a comment