Skip to content

LocalEndPointTestIPv6Sync.TcpAcceptSocket_WhenServerBoundToSpecificAddress_LocalEPIsSame failing #52141

Closed

Description

@runfoapp

Runfo Tracking Issue: LocalEndPointTestIPv6Sync.TcpAcceptSocket_WhenServerBoundToSpecificAddress_LocalEPIsSame failing

Build Definition Kind Run Name
1116477 runtime PR 52128 net6.0-Linux-Debug-x64-Mono_release-(Centos.8.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-helix-20201229003624-c1bf759
1113740 runtime PR 52046 net6.0-Linux-Debug-x64-Mono_release-(Debian.10.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-bfcd90a-20200121150006

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
1 2 2

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Apr 30, 2021
  2. added this to the 6.0.0 milestone on May 6, 2021
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on May 6, 2021
  4. karelz commented on May 7, 2021

    @karelz
    Member

    Call stack:

    Assert.Equal() Failure
    Expected: [::1]:53046
    Actual:   [::1]:53110
       at System.Net.Sockets.Tests.LocalEndPointTest`1.TcpAcceptSocket_WhenServerBoundToSpecificAddress_LocalEPIsSame() in /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs:line 162
    --- End of stack trace from previous location ---
    

    Failures (3/12-7/22, incl. PRs):

    Run Date OS
    Official run 4/2 Debian.9.Amd64.Open - CoreCLR
    PR #50929 4/9 Debian.9.Amd64.Open - Mono
    PR #49526 4/24 Ubuntu.1804.ArmArch.Open - Mono
    PR #52046 4/29 ubuntu.1604.amd64.open - Mono
    PR #52003 4/29 RedHat.7.Amd64.Open - CoreCLR
    PR #52128 4/30 Ubuntu.1604.Amd64.Open - Mono
    PR #52475 5/8 Centos.8.Amd64.Open - Mono
    PR #52510 6/7 Ubuntu.1804.ArmArch.Open - Mono
    PR #53645 6/14 Ubuntu.1804.Amd64.Open - Mono
    PR #54436 6/18 Fedora.30.Amd64.Open - Mono
    PR #54822 7/1 SLES.15.Amd64.Open - Mono
    PR #54253 7/2 Fedora.30.Amd64.Open - CoreCLR
    PR #55101 7/11 Fedora.30.Amd64.Open - Mono
    PR #52244 7/15 Fedora.32.Amd64.Open - Mono
    PR #52244 7/19 Centos.8.Amd64.Open - CoreCLR

    Alternative / related callstack:

    System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Socket is already connected 127.0.0.1:54400
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 3072
       at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 860
       at System.Net.Sockets.Tests.SocketHelperArraySync.<>c__DisplayClass3_0.<ConnectAsync>b__0() in /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTestHelper.cs:line 61
       at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 294
    --- End of stack trace from previous location ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2363
    --- End of stack trace from previous location ---
       at System.Net.Sockets.Tests.LocalEndPointTest`1.TcpAcceptSocket_WhenServerBoundToSpecificAddress_LocalEPIsSame() in /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs:line 159
    --- End of stack trace from previous location ---
    

    Failures (3/12-6/23, incl. PRs):

    Run Date OS
    PR #51763 4/27 OSX.1014.Amd64.Open - CoreCLR
  5. antonfirsov commented on May 10, 2021

    @antonfirsov
    Contributor

    A possible explanation might be that this is yet another dual stack IPv4/IPv6 port-collision issue, caused by other test cases running in parallel.

    int serverPort = server.BindToAnonymousPort(Loopback);
    Assert.Equal(Loopback, GetLocalEPAddress(server)); // server -> specific before accept
    server.Listen();
    Task<Socket> acceptTask = AcceptAsync(server);
    await ConnectAsync(client, new IPEndPoint(Loopback, serverPort));
    Socket accept = await acceptTask;
    Assert.Equal(accept.RemoteEndPoint, client.LocalEndPoint);
    Assert.Equal(GetLocalEPAddress(server), GetLocalEPAddress(accept)); // accept -> same address
    Assert.Equal(serverPort, GetLocalEPPort(accept));

    A dual-mode client in that other test that is intended to connect to it's matching IPv4-only listener may then connect to the server of the failing test case. Since the sync connection request kicks in slowly (AcceptAsync starting on a threadpool thread), the failing test then accepts that other connection request in Task<Socket> acceptTask = AcceptAsync(server); before accepting of it's own client-s connection.

    We can move the sync tests classes to a non-parallel collection as a quick fix attempt.

  6. added
    test-bugProblem in test source code (most likely)
    on May 10, 2021
  7. self-assigned this
    on Jul 26, 2021
  8. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 27, 2021
  9. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 30, 2021
  10. ghost locked as resolved and limited conversation to collaborators on Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions