Skip to content

wrong handling of broken IPv6 #3585

Closed
Closed

Description

@buzo-ffm

Curl behaves differently than before when a site cannot be reached via IPv6, but only IPv4. This causes network-manager (using libcurl) to loop forever and take 100% of one CPU. Please see https://bugs.archlinux.org/task/61688 for all the details.

In that report, it is stated that the change 4c35574 is the cause, see comment https://bugs.archlinux.org/task/61688#comment177215 .

Activity

  1. buzo-ffm commented on Feb 18, 2019

    @buzo-ffm
    Author

    The bug report for network-manager about this issue is here: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/123

  2. bagder commented on Feb 18, 2019

    @bagder
    Member

    I think this problem (even if this report is doing a lot of wild guessing and drawing funny conclusions) is already addressed in git with 4015fae, since it seems similar to the symptoms in #3542.

  3. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    We backported that commit and the one it fixes without success.

  4. bagder commented on Feb 19, 2019

    @bagder
    Member

    Can you make a standalone libcurl-using example that reproduces the problem?

  5. bagder commented on Feb 19, 2019

    @bagder
    Member

    And maybe try the git master version in its entirety first to make sure that the problem is still there.

  6. buzo-ffm commented on Feb 19, 2019

    @buzo-ffm
    Author

    The libcurl-using code is here within the #if WITH_CONCHECK blocks, but I don't know how to make a standalone example from it.

  7. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    The problem is still present as of commit 5908e90.

    FTR, the URL in question here is http://www.archlinux.org/check_network_status.txt, so http2 is not involved.

  8. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    @buzo-ffm NM's connectivity code had lots of changes in master; we're actually running https://gitlab.freedesktop.org/NetworkManager/NetworkManager/blob/nm-1-14/src/nm-connectivity.c .

  9. bagder commented on Feb 19, 2019

    @bagder
    Member

    The title says "wrong handling" of "broken IPv6". In what way is it broken?

  10. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    I have a working dual stack setup here; dropping all IPv6 packets from www.archlinux.org (via ip6tables -A INPUT -s 2a01:4f8:172:1d86::1/128 -j DROP) makes NM enter an infinite loop once it attempts to retrieve the URL.

  11. bagder commented on Feb 19, 2019

    @bagder
    Member

    If you, on the same machine with that filter enabled, run curl -v http://www.archlinux.org/check_network_status.txt (built from the problematic commit), what happens then?

  12. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    It runs fine, first trying IPv6 and quickly failing, then using IPv4. With -6 it times out after two minutes.

  13. bagder commented on Feb 19, 2019

    @bagder
    Member

    Unfortunately my dev machines don't have working IPv6 so I can't easily reproduce this setup.

    With a debug build created with configure --enable-debug, the curl command line tool gets an undocumented new option called --test-event that will make it run its normal operations internally with the event-based API (that NM is using) instead of the regular easy API that it otherwise uses. Any chance you can see if that reproduces it?

    $ curl --test-event -v http://www.archlinux.org/check_network_status.txt
    
  14. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    Hah, that does get into a loop printing * call curl_multi_socket_action(socket 4).

  15. heftig commented on Feb 19, 2019

    @heftig
    Contributor
    * STATE: INIT => CONNECT handle 0x55590a766ea8; line 1429 (connection #-5000)
    * Added connection 0. The cache now contains 1 members
    * STATE: CONNECT => WAITRESOLVE handle 0x55590a766ea8; line 1470 (connection #0)
    *   Trying 2a01:4f8:172:1d86::1...
    * TCP_NODELAY set
    * STATE: WAITRESOLVE => WAITCONNECT handle 0x55590a766ea8; line 1551 (connection #0)
    * socket cb: socket 3 ADDED as OUT
    *   Trying 138.201.81.199...
    * TCP_NODELAY set
    * socket cb: socket 4 ADDED as OUT
    * call curl_multi_socket_action(socket 4)
    * call curl_multi_socket_action(socket 4)
    * call curl_multi_socket_action(socket 4)
    [et cetera]
    
  16. buzo-ffm commented on Feb 19, 2019

    @buzo-ffm
    Author

    FWIW, my IPv6 is working fine, yet I am hit by this bug. The reason could be me having more than one default route:

    default via fe80::**** dev enp0s31f6 proto ra metric 100 pref medium
    default via fe80::**** dev wlp58s0 proto ra metric 600 pref medium
    default via fd28:**** dev buzo metric 1024 pref low

  17. heftig commented on Feb 19, 2019

    @heftig
    Contributor

    Since curl moves on to IPv4 quite quickly if the initial attempt at IPv6 takes too long, I guess just having a slow enough connection to the server is enough to trigger this.

  18. added a commit that references this issue on Feb 19, 2019
    b7753be
  19. locked as resolved and limited conversation to collaborators on May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions