Skip to content

curl_easy_duphandle() bug after 7.69.1 #5097

Closed

Description

@kn007

I try it on 7.69.1 and 7.69.2-dev, same problem. 7.69.0 working well.

  OS               Linux CentOS Linux release 8.1.1911 (Core)
  Kernel           5.5.5-1.el8.elrepo.x86_64
--disable-static --enable-threaded-resolver --with-gssapi --with-nghttp2 --enable-ares
curl 7.69.2-DEV (x86_64-pc-linux-gnu) libcurl/7.69.2-DEV OpenSSL/1.1.1c-fips zlib/1.2.11 c-ares/1.16.0 libidn2/2.2.0 nghttp2/1.40.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets

dnf:

CentOS-8 - AppStream                                                                                             0.0  B/s |   0  B     00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: curl_easy_duphandle() call failed

git:

Cloning into 'curl'...
warning: curl_multi_add_handle failed: Invalid easy handle
fatal: unable to access 'https://github.com/curl/curl/': failed to start HTTP request

Activity

  1. bagder commented on Mar 13, 2020

    @bagder
    Member

    Can you provide a simple stand-alone example code showing this problem? Both the tools you refer to above are huge and complex applications that make things really hard to debug or even understand what they're doing.

  2. kn007 commented on Mar 13, 2020

    @kn007
    Author

    Sorry, I'm afraid that I can't.
    I guess it happened after commit: c8f086b
    let me try it.

  3. kn007 commented on Mar 13, 2020

    @kn007
    Author

    My guess is correct.
    After run
    git reset --hard e364546fb3371ac27f59f897e4c55acce7fc824e
    make curl and it working fine.

    but reset to c8f086b , it's broken..

    Sorry that I could not get more information.

  4. bagder commented on Mar 13, 2020

    @bagder
    Member

    I still can't see what's wrong in there...

  5. added a commit that references this issue on Mar 13, 2020
  6. jay commented on Mar 14, 2020

    @jay
    Member

    If c-ares is too old or IPv6 support is disabled (like is the case here) those functions could return CURLE_NOT_BUILT_IN:

    curl/lib/asyn-ares.c

    Lines 788 to 812 in b81e0b0

    CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
    const char *local_ip6)
    {
    #if (ARES_VERSION >= 0x010704) && defined(ENABLE_IPV6)
    unsigned char a6[INET6_ADDRSTRLEN];
    if((!local_ip6) || (local_ip6[0] == 0)) {
    /* disabled: do not bind to a specific address */
    memset(a6, 0, sizeof(a6));
    }
    else {
    if(Curl_inet_pton(AF_INET6, local_ip6, a6) != 1) {
    return CURLE_BAD_FUNCTION_ARGUMENT;
    }
    }
    ares_set_local_ip6((ares_channel)data->state.resolver, a6);
    return CURLE_OK;
    #else /* c-ares version too old! */
    (void)data;
    (void)local_ip6;
    return CURLE_NOT_BUILT_IN;
    #endif
    }

    I don't know for sure this is the problem but I don't see what else it could be. #5100 should fix this, @kn007 can you please try it?

  7. kn007 commented on Mar 14, 2020

    @kn007
    Author

    Ok, let me try it, wait a minute.

    my c-ares is 1.16.0, IPv6 is disabled.

  8. kn007 commented on Mar 14, 2020

    @kn007
    Author

    @jay Yes, it's working fine after patch #5100 .
    Thanks for your work.

  9. bagder commented on Mar 14, 2020

    @bagder
    Member

    But why is the build IPv6-disabled, no such configure option was shown?

  10. changed the title [-]curl easy handle bug after 7.69.1[/-] [+]curl_easy_duphandle() bug after 7.69.1[/+] on Mar 14, 2020
  11. kn007 commented on Mar 14, 2020

    @kn007
    Author

    I don't know.
    My OS disabled the ipv6 on grub.

    GRUB_CMDLINE_LINUX = ... ipv6.disable=1
    

    Some people like me, will change it on the sysctl.conf file.

  12. jay commented on Mar 14, 2020

    @jay
    Member

    Thanks

  13. michael-o commented on Apr 2, 2020

    @michael-o
    Contributor

    To whom it may concern, the one off patch has already been applied to the FreeBSD Ports system: https://svnweb.freebsd.org/changeset/ports/530365

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