public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/16473] New: [3.4] ServerSocket leaks file descriptors
@ 2004-07-11 16:12 mckinlay at redhat dot com
  2004-07-11 16:13 ` [Bug libgcj/16473] " mckinlay at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mckinlay at redhat dot com @ 2004-07-11 16:12 UTC (permalink / raw)
  To: java-prs

As reported by Eric Wong:

In version 3.4.0/1, ServerSocket.accept() creates a
new Socket() and then in the process invoke
Socket.getImpl(), which goes something like this:

-----
SocketImpl getImpl() throws SocketException
    try
      {
        if (!implCreated)
          {
            impl.create(true);
            implCreated = true;
          }
      }
    catch (IOException e)
      {
        throw new SocketException(e.getMessage());
      }

    return impl;
-----

But create(true) alone will cause
natPlainSocketImplPosix.cc (depending on the platform)
to create a fresh yet never-been-used socket
descriptor. As a result, lsof will show:


>> socktest 31812 root 8u  sock 0,0 1364355 can't
identify protocol

So each ServerSocket.accept() call will generate
additional descriptor until we get EMFILE error ("Too
many open files").

-- 
           Summary: [3.4] ServerSocket leaks file descriptors
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckinlay at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16473


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-11 16:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-11 16:12 [Bug libgcj/16473] New: [3.4] ServerSocket leaks file descriptors mckinlay at redhat dot com
2004-07-11 16:13 ` [Bug libgcj/16473] " mckinlay at redhat dot com
2004-07-11 16:15 ` mckinlay at redhat dot com
2004-07-11 16:42 ` [Bug libgcj/16473] [3.4] ServerSocket accept() " cvs-commit at gcc dot gnu dot org
2004-07-11 16:42 ` mckinlay at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).