JDK-5029980 : JDI can't connect to the app server a second time
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2004-04-10
  • Updated: 2004-10-13
  • Resolved: 2004-04-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
1.4.2_07 b01Fixed
- Start the appserver on windows in debug mode, listening for a connection
  from a debugger. 
- Connect from a debugger, eg, jdb.  Note that the connection succeeds.
- Quit jdb
- Connect a second time.  The connection is not established and no
  debugging can be done.

This failure only occurs on windows when the socket transport is used,
and the debuggee launches another application with Runtime.exec().

See bug  
  4989322 Debugger doesn't connect to app server for the second time

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.2_07 tiger-beta2 FIXED IN: 1.4.2_07 tiger-beta2 INTEGRATED IN: 1.4.2_07 tiger-b48 tiger-beta2

SUGGESTED FIX Here are the diffs for j2se/src/windows/transport/socket/socket_md.c: *** /tmp/geta23978 Sat Apr 10 12:46:24 2004 --- socket_md.c Sat Apr 10 12:35:31 2004 *************** *** 191,197 **** int dbgsysSocket(int domain, int type, int protocol) { ! return socket(domain, type, protocol); } int --- 191,201 ---- int dbgsysSocket(int domain, int type, int protocol) { ! int fd = socket(domain, type, protocol); ! if (fd != SOCKET_ERROR) { ! SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE); ! } ! return fd; }

EVALUATION ###@###.### 2004-04-10 On windows, the socket is inherited by the child process. This causes the socket to remain in use after the first debug session is terminated.