This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12926] getaddrinfo()/make_request() may spin forever


https://sourceware.org/bugzilla/show_bug.cgi?id=12926

fengtiantian <fengtiantian at huawei dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |fengtiantian at huawei dot com
            Version|2.15                        |2.13
         Resolution|FIXED                       |---

--- Comment #7 from fengtiantian <fengtiantian at huawei dot com> ---
I met the same error when I use python programs, and a thread spinning here:
#0  0x00007ff4ae826dd0 in __recvmsg_nocancel () from /lib64/libc.so.6
#1  0x00007ff4ae848891 in make_request () from /lib64/libc.so.6
#2  0x00007ff4ae848daa in __check_pf () from /lib64/libc.so.6
#3  0x00007ff4ae811a23 in getaddrinfo () from /lib64/libc.so.6
#4  0x00007ff4ad919fd1 in setipaddr () from
/usr/lib64/python2.6/lib-dynload/_socket.so
#5  0x00007ff4ad91abdf in getsockaddrarg () from
/usr/lib64/python2.6/lib-dynload/_socket.so
#6  0x00007ff4ad91b086 in sock_sendto () from
/usr/lib64/python2.6/lib-dynload/_socket.so

the OS is suse 11 SP3 ,kernel 3.0.93.and the glibc version is
glibc-2.11.3-17.82.11, which have emerge the patch make-request-loop.patch

  1 2014-10-14  Paul Pluzhnikov  <ppluzhnikov@google.com>
  2
  3     [BZ #12926]
  4     * sysdeps/unix/sysv/linux/check_pf.c (make_request): Avoid
  5     infinite loop when __recvmsg returns 0.
  6
  7 Index: glibc-2.11.3/sysdeps/unix/sysv/linux/check_pf.c
  8 ===================================================================
  9 --- glibc-2.11.3.orig/sysdeps/unix/sysv/linux/check_pf.c
 10 +++ glibc-2.11.3/sysdeps/unix/sysv/linux/check_pf.c
 11 @@ -219,7 +219,7 @@ make_request (int fd, pid_t pid, bool *s
 12     };
 13
 14        ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
 15 -      if (read_len < 0)
 16 +      if (read_len <= 0)
 17     goto out_fail;
 18
 19        if (msg.msg_flags & MSG_TRUN 

So I think the patch do not fix my bug.

I do not understand ,in make_request function, while it use the (__recvmsg (fd,
&msg, 0),the blocking mode , and do not set the timeout. If the kernel not send
the NLMSG_DONE message, the __recvmsg will hung a long time.

I am not sur this is a kernel bug or glibc bug,if glibc think the kernel not
send the NLMSG_DONE message is a bug ?  I see in kernel source, some exception
branch is will not send the NLMSG_DONE .

can glibc  use the MSG_DONTWAIT flag to receive the message? If not receive the
message, return false?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]