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 network/15946] getaddrinfo() writes DNS queries to random file descriptors under high load


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

Jiri Hruska <jirka at fud dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |jirka at fud dot cz
         Resolution|---                         |FIXED

--- Comment #14 from Jiri Hruska <jirka at fud dot cz> ---
That's a bug in the attached test case, though, not in glibc any more.

Line 122 should have `m = -1` instead of `m = 0`. Otherwise if the very first
dup() call fails, the close loop below will still do one iteration and close
somebody else's random file descriptor at fds[0].

To verify this, you can add the following before the `break` at line 158:
   if (errno == EMFILE) {
+    if (m == 0)
+      printf("Yo Dawg I herd you like bugs so I put a bug in your bug.c\n");
     break;
   } else {

When running the program now, every alleged error was preceded by this message
just before, and I wasn't able to trigger the bug at all when the code was
corrected as suggested above.

Marking as RESOLVED/FIXED again.

-- 
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]