This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

libgcj/10868: java.net.ServerSocket's constructors create and leak extra sockets


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


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