That seems fair enough for the debuggee process, but the problem is that
in this case, jps doesn't report other java processes either.
Here is a script that demonstrates this.
#!/bin/sh
if [ $# = 0 ] ; then
java=java
jps=jps
javac=javac
else
java=$1/bin/java
jps=$1/bin/jps
javac=$1/bin/javac
fi
cat <<EOF > /tmp/hello.java
public class hello {
public static void main(String args[]) {
try {
Thread.sleep(50000);
}
catch (Exception ee) {
}
}
}
EOF
$javac -d . /tmp/hello.java
echo "jps without a waiting debuggee running:"
$java hello &
pid1=$!
$jps
echo
echo "run a debuggee that waits for a connection:"
$java -Xrunjdwp:transport=dt_socket,address=46225,server=y,suspend=y hello &
pid=$!
echo
sleep 5
echo "jps again"
$jps
kill $pid
kill $pid1
This failure mode has been seen in nightly testing. Here is
my analysis report entry:
New MISC_REGRESSION failures (from 2007.11.22)
sun/tools/jps/jps-lm.sh
sun/tools/jps/jps-l_2.sh
sun/tools/jps/jps-m_2.sh
sun/tools/jps/jps-Vm_2.sh
sun/tools/jps/jps-Vvml.sh
sun/tools/jps/jps-Vvml_2.sh
sun/tools/jps/jps-V_2.sh
These tests failed due to "Could not synchronize with target" on
Win32 Client VM (machine vm-8450r-3).
Update: Swamy believes these failures are due to problems with
the test machine.
Update: Swamy found the following existing bug:
6602355 4/4 If a debuggee is waiting for a connection, jps
fails with msg: Could not synchronize with target
Update: Swamy verified that the failures on vm-8450r-3 are due
to 6602355.
Here is another analysis report entry:
New MISC_REGRESSION failures (from 2007.11.28)
sun/tools/jps/jps-Defaults.sh
sun/tools/jps/jps-l_1.sh
* sun/tools/jps/jps-m.sh
sun/tools/jps/jps-Vm_2.sh
These tests failed due to "Could not synchronize with target"
on Win-AMD64 Server VM (machine vm-x2100-01). These failures
are an occurrence of the following bug:
6602355 4/4 If a debuggee is waiting for a connection, jps
fails with msg: Could not synchronize with target
Here is another analysis report entry:
New MISC_REGRESSION failures (from 2007.12.06)
* sun/tools/jps/jps-Vvm.sh
* sun/tools/jps/jps-v_1.sh
* sun/tools/jps/jps-vm_1.sh
These tests failed due to "Could not synchronize with target"
on Win32 Server VM (machine colfax005). These failures are an
occurrence of the following bug:
6602355 4/4 If a debuggee is waiting for a connection, jps
fails with msg: Could not synchronize with target
in this case, jps doesn't report other java processes either.
Here is a script that demonstrates this.
#!/bin/sh
if [ $# = 0 ] ; then
java=java
jps=jps
javac=javac
else
java=$1/bin/java
jps=$1/bin/jps
javac=$1/bin/javac
fi
cat <<EOF > /tmp/hello.java
public class hello {
public static void main(String args[]) {
try {
Thread.sleep(50000);
}
catch (Exception ee) {
}
}
}
EOF
$javac -d . /tmp/hello.java
echo "jps without a waiting debuggee running:"
$java hello &
pid1=$!
$jps
echo
echo "run a debuggee that waits for a connection:"
$java -Xrunjdwp:transport=dt_socket,address=46225,server=y,suspend=y hello &
pid=$!
echo
sleep 5
echo "jps again"
$jps
kill $pid
kill $pid1
This failure mode has been seen in nightly testing. Here is
my analysis report entry:
New MISC_REGRESSION failures (from 2007.11.22)
sun/tools/jps/jps-lm.sh
sun/tools/jps/jps-l_2.sh
sun/tools/jps/jps-m_2.sh
sun/tools/jps/jps-Vm_2.sh
sun/tools/jps/jps-Vvml.sh
sun/tools/jps/jps-Vvml_2.sh
sun/tools/jps/jps-V_2.sh
These tests failed due to "Could not synchronize with target" on
Win32 Client VM (machine vm-8450r-3).
Update: Swamy believes these failures are due to problems with
the test machine.
Update: Swamy found the following existing bug:
6602355 4/4 If a debuggee is waiting for a connection, jps
fails with msg: Could not synchronize with target
Update: Swamy verified that the failures on vm-8450r-3 are due
to 6602355.
Here is another analysis report entry:
New MISC_REGRESSION failures (from 2007.11.28)
sun/tools/jps/jps-Defaults.sh
sun/tools/jps/jps-l_1.sh
* sun/tools/jps/jps-m.sh
sun/tools/jps/jps-Vm_2.sh
These tests failed due to "Could not synchronize with target"
on Win-AMD64 Server VM (machine vm-x2100-01). These failures
are an occurrence of the following bug:
6602355 4/4 If a debuggee is waiting for a connection, jps
fails with msg: Could not synchronize with target
Here is another analysis report entry:
New MISC_REGRESSION failures (from 2007.12.06)
* sun/tools/jps/jps-Vvm.sh
* sun/tools/jps/jps-v_1.sh
* sun/tools/jps/jps-vm_1.sh
These tests failed due to "Could not synchronize with target"
on Win32 Server VM (machine colfax005). These failures are an
occurrence of the following bug:
6602355 4/4 If a debuggee is waiting for a connection, jps
fails with msg: Could not synchronize with target
- duplicates
-
JDK-6637230 jps doesn't work for application waiting for direct attach
-
- Closed
-
- relates to
-
JDK-6814929 AttachOnDemand tests fail with "jps -v (stderr): Could not synchronize with target"
-
- Closed
-