United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7011591 JDWP socket transport should restart interrupted system calls (EINTR)
7011591 : JDWP socket transport should restart interrupted system calls (EINTR)

Details
Type:
Bug
Submit Date:
2011-01-11
Status:
Open
Updated Date:
2012-06-28
Project Name:
JDK
Resolved Date:
Component:
core-svc
OS:
solaris
Sub-Component:
debugger
CPU:
sparc
Priority:
P4
Resolution:
Unresolved
Affected Versions:
6
Targeted Versions:
8

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
BACKGROUND

JRockit includes a few patches of the JDK. In order to simplify the JRockit JDK updating process, we want to move as many as possible of these to the Java SE JDK.

PROBLEM

JRockit R27 may interrupt socket accepts when started with flag -Xdebug on Solaris. Therefore, the dbgSysAccept method in j2se/src/solaris/transport/socket/socket_md.c# must be able to handle the EINTR error code for both JDK 1.4.2, 1.5.0 and 1.6.0

JRockit overrides the following line
	if (errno != ECONNABORTED) {
with
	if (errno != ECONNABORTED && errno != EINTR) {
at:
http://opengrok.ireland.sun.com:8080/source/xref/6-rev-latest/j2se/src/solaris/transport/socket/socket_md.c#64

REPRODUCER

To reproduce the issue:

1) Download JRockit R27.6.7 for Solaris: ftp://jrpgftp.se.oracle.com/jrockit_builds/R27.6.7/builds/R27.6.7-23/release/solaris_sparcv9/jrockit-jdk1.6.0_20-solaris_sparcv9.zip
2) Replace jre/lib/sparcv9/libdt_socket.so with the default JDK version
3) Run java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1234 HelloWorld

It will fail to start, resulting in the output:
Listening for transport dt_socket at address: 1234
ERROR: transport error 202: accept failed: Interrupted system call
JDWP exit error JVMTI_ERROR_NONE(0): could not connect, timeout or fatal error [../../../src/share/back/transport.c:304]

AFFECTED VERSIONS: 1.4.2, 1.5.0, 1.6.0

                                    

Comments
EVALUATION

Need to add code to automatically retry if EINTR is returned from any of the blocking calls: send(), recv(), sendto(), recvfrom(), and accept(), connect(), poll()
                                     
2011-07-11



Hardware and Software, Engineered to Work Together