This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libgcj/10868: java.net.ServerSocket's constructors create and leak extra sockets
- From: gbenson at redhat dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 19 May 2003 16:42:08 -0000
- Subject: libgcj/10868: java.net.ServerSocket's constructors create and leak extra sockets
- Reply-to: gbenson at redhat dot com
>Number: 10868
>Category: libgcj
>Synopsis: java.net.ServerSocket's constructors create and leak extra sockets
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 19 16:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: gbenson@redhat.com
>Release: HEAD
>Organization:
>Environment:
Red Hat Linux 9
>Description:
The control flow of ServerSocket(int port, int backlog, InetAddress bindAddr) is as follows:
this();
impl.create(true);
impl.bind(bindAddr, port);
impl.listen(backlog);
The call to this() also calls impl.create(true), meaning that a second socket is created and the original socket is leaked. ServerSocket(int port) and ServerSocket(int port, int backlog) both call ServerSocket(int port, int backlog, InetAddress bindAddr) so they also leak a socket per call.
>How-To-Repeat:
>Fix:
Remove the call to impl.create() from ServerSocket(int port, int backlog, InetAddress bindAddr).
>Release-Note:
>Audit-Trail:
>Unformatted: