cURL

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1315 curl-7.34.0: hangs after hitting IPv6 address with no IPv6 available

From: Michał Górny <mgorny-gentoo_at_users.sf.net>
Date: Wed, 25 Dec 2013 20:50:45 +0000

The issue happens when the host has both IPv6 and IPv4 addresses. bad14 has only IPv6 address.

I can reproduce it with e.g. bad12. There it tries the two IPv6 addresses and then deadlocks.

Here follows a bit of single-steeping with breakspoints, but I doubt it will be close to readable (all in `connect.c`):

    1108 while(res != CURLE_OK &&
    (gdb) n
    1109 conn->tempaddr[0] &&
    (gdb) n
    1110 conn->tempaddr[0]->ai_next &&
    (gdb) n
    1112 res = trynextip(conn, FIRSTSOCKET, 0);
    (gdb) n

    Breakpoint 3, trynextip (conn=conn_at_entry=0x100bc00, sockindex=sockindex_at_entry=0,
        tempindex=tempindex_at_entry=0) at connect.c:537
    537 {
    (gdb) n
    544 curl_socket_t fd_to_close = conn->tempsock[tempindex];
    (gdb) n
    545 conn->tempsock[tempindex] = CURL_SOCKET_BAD;
    (gdb) p fd_to_close
    $1 = -1
    (gdb) n
    538 CURLcode rc = CURLE_COULDNT_CONNECT;
    (gdb) n
    547 if(sockindex == FIRSTSOCKET) {
    (gdb) n
    551 if(conn->tempaddr[tempindex]) {
    (gdb) n
    553 family = conn->tempaddr[tempindex]->ai_family;
    (gdb) p conn->tempaddr[tempindex]
    $2 = (Curl_addrinfo *) 0x100c680
    (gdb) p *conn->tempaddr[tempindex]
    $3 = {ai_flags = 0, ai_family = 10, ai_socktype = 1, ai_protocol = 0, ai_addrlen = 28,
      ai_canonname = 0x100c750 "bittern.gentoo.org", ai_addr = 0x100c770, ai_next = 0x100cc90}
    (gdb) n
    554 ai = conn->tempaddr[tempindex]->ai_next;
    (gdb) n
    559 family = (firstfamily == AF_INET) ? AF_INET6 : AF_INET;
    (gdb) p family
    $4 = 10
    (gdb) p ai
    $5 = (Curl_addrinfo *) 0x100cc90
    (gdb) n
    568 rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]);
    (gdb) p family
    $6 = 10
    (gdb) n
    563 while(ai) {
    (gdb) p rc
    $7 = CURLE_COULDNT_CONNECT
    (gdb) n
    564 while(ai && ai->ai_family != family)
    (gdb) p *ai
    $8 = {ai_flags = 0, ai_family = 2, ai_socktype = 1, ai_protocol = 0, ai_addrlen = 16,
      ai_canonname = 0x100ccd0 "bittern.gentoo.org", ai_addr = 0x100ccf0, ai_next = 0x0}
    (gdb) n
    565 ai = ai->ai_next;
    (gdb) n
    564 while(ai && ai->ai_family != family)
    (gdb) p ai
    $9 = (Curl_addrinfo *) 0x0
    (gdb) n
    567 if(ai) {
    (gdb) n
    579 if(fd_to_close != CURL_SOCKET_BAD)
    (gdb) n
    583 }
    (gdb) n

---
** [bugs:#1315] curl-7.34.0: hangs after hitting IPv6 address with no IPv6 available**
**Status:** open
**Created:** Tue Dec 24, 2013 04:00 PM UTC by Anthony G. Basile
**Last Updated:** Tue Dec 24, 2013 10:41 PM UTC
**Owner:** Bjorn Stenberg
This was hit on a gentoo system and the downstream report can be seen at
   https://bugs.gentoo.org/show_bug.cgi?id=495170
In brief, if curl 7.34.0 tries an ipv6 address when one isn't available, it falls into a loop and eats 100% cpu.  This issue is not reproduceable on 7.33.0.
Here we used c-ares-1.9.1, libidn-1.28, openssl-1.0.1e and zlib-1.2.8.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2013-12-25

These mail archives are generated by hypermail.

donate! Page updated December 19, 2013.
web site info

File upload with ASP.NET