runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Socket multicast will hang in UAP mode with any interfaces

Open caesar-chen opened this issue 9 years ago • 5 comments

The receiveTask will hang forever in UAP run: https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs#L131, no matter what interface is set for MulticastOption.

caesar-chen avatar Jun 13 '17 22:06 caesar-chen

This test will only fail in UAP mode (succeed in ILC run). I think it's probably related to app container. But even after I enabled loopback interface for the app, the test still hang. I will continue investigation by using debugger.

cc: @davidsh

caesar-chen avatar Jun 20 '17 18:06 caesar-chen

The description of this issue is not accurate.

There are two test cases for testing socket multicast with different interfaces (https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs#L85-L106). One is "any interface", the other is "loopback".

The hang is only happening with loopback interface. If disable MulticastInterface_Set_LoopbackSucceeds() from the beginning (i.e not running this method at all), the test MulticastInterface_SetAnyInterface_Succeeds() will always succeed. (I wrote a script to run it hundred times).

I opened this issue with "hang in UAP mode with any interfaces (not only loopback)", this is true as well. The repro procedures will be:

  1. Don't disable MulticastInterface_Set_Loopback_Succeeds(), let it run and hang
  2. Disable MulticastInterface_Set_Loopback_Succeeds()
  3. Now MulticastInterface_Set_AnyInterface_Succeeds() will hang

So I doubt for "any interface" option (index 0 means "any interface"), the choice for the interface is actually affected by some factors (in this case, whether MulticastInterface_Set_Loopback_Succeeds gets called or not is the factor).

I investigated into this, only found the parameter passed in (0 or 1) for choosing the interface will eventually used by Interop.Winsock.setsockopt(). I can't find information about this API for how to choose the interface, so I am not able to find the direct evidence to prove my doubt.

@davidsh @CIPop

caesar-chen avatar Jun 21 '17 18:06 caesar-chen

Keep track in dotnet/corefx#21327. I will submit a PR to re-enable MulticastInterface_SetAnyInterface_Succeeds().

caesar-chen avatar Jun 21 '17 20:06 caesar-chen

@caesar1995 this is still referenced by the ActiveIssue within the code. Please either update the code or the bug.

CIPop avatar Jun 22 '17 22:06 CIPop

It's in the PR: https://github.com/dotnet/corefx/pull/21328/files#diff-19adc45fa233056f6babaef13639a1acR96

caesar-chen avatar Jun 22 '17 22:06 caesar-chen