JDK-8022202 : Intermittent test failures in com/sun/tools/attach/PermissionTests.sh
Type:Bug
Component:core-svc
Sub-Component:tools
Affected Version:8
Priority:P3
Status:Resolved
Resolution:Fixed
OS:windows
Submitted:2013-08-05
Updated:2014-04-07
Resolved:2014-01-17
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 Availability Release.
Observed same-binary test failure(s) with observed probability of failure:
TESTFAIL:com/sun/tools/attach/PermissionTests.sh, 0.0021598272138228943
Comments
issue fixed by Mattias Tobiasson while working on JDK-6461635.Test removed
17-01-2014
test was removed from jdk by http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/d30f49aa2d01
Test functionality moved to java tests
17-01-2014
Assigning to Shura
15-01-2014
Release team: Approved for deferral.
12-12-2013
8-defer-request-justification: P3 test issue
10-12-2013
ILW=MLH=P4, Medium impact as noisy tests, low likelihood of individual failure, no known workaround.
This test should definitely be stabilized post 8.
03-10-2013
The problem is in this output:
Application is process 7672
4092
672, shutdown port is 60558
When the test runs ok, this output should look like:
Application is process 1013, shutdown port is 50653
For some reason, the $pid has been set to several values with line breaks between them. This value is later used to launch the test app (PermissionTest) which now gets launched with an incorrect command line and that's where the exception comes from.
This was run on cygwin and the code looks like this:
${JAVA} ${TESTVMOPTS} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
pid="$!"
# MKS creates an intermediate shell to launch ${JAVA} so
# ${pid} is not the actual pid. We have put in a small sleep
# to give the intermediate shell process time to launch the
# "java" process.
if [ "$OS" = "Windows" ]; then
sleep 2
if [ "${isCygwin}" = "true" ] ; then
realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'`
else
realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
fi
pid=${realpid}
fi
I can't see how $pid can end up with several values with new lines in them.
06-09-2013
javatestOS=Windows 7 6.1 (amd64)
javatestVersion=4.4
jtregVersion=jtreg 4.1 fcs b07
script=com.sun.javatest.regtest.RegressionScript
sections=script_messages build compile shell
start=Sat Aug 10 11\:16\:16 PDT 2013
test=com/sun/tools/attach/PermissionTests.sh
user.name=aurora
work=C\:\\Users\\aurora\\sandbox_keepme\\results\\run_8\\testoutput\\jdk_tools\\JTwork\\com\\sun\\tools\\attach
#section:script_messages
----------messages:(5/195)*----------
JDK under test: (C:\\Users\\aurora\\SANDBO~1\\jdk)
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b102)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b44, mixed mode)
#section:build
----------messages:(3/120)----------
command: build PermissionTest
reason: User specified action: run build PermissionTest
elapsed time (seconds): 0.334
result: Passed. Build successful
#section:compile
----------messages:(3/223)*----------
command: compile -XDignore.symbol.file=true C:\\Users\\aurora\\sandbox_keepme\\testbase\\test\\com\\sun\\tools\\attach\\PermissionTest.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.328
result: Passed. Compilation successful
#section:shell
----------messages:(3/131)----------
command: shell PermissionTests.sh []
reason: User specified action: run shell PermissionTests.sh
elapsed time (seconds): 9.696
----------System.out:(19/961)----------
Waiting for Application to initialize...
60558
Application is process 7672
4092
672, shutdown port is 60558
Deny test
Exception in thread "main" java.security.AccessControlException: access denied ("com.sun.tools.attach.AttachPermission" "attachVirtualMachine")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:453)
at java.security.AccessController.checkPermission(AccessController.java:820)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at sun.tools.attach.HotSpotAttachProvider.checkAttachPermission(HotSpotAttachProvider.java:62)
at sun.tools.attach.WindowsAttachProvider.attachVirtualMachine(WindowsAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:213)
at PermissionTest.main(PermissionTest.java:45)
Allow test
- attached to target VM as expected.
Connecting to port 60558 to shutdown Application ...
1 test(s) failed:
60558
----------System.err:(0/0)----------
result: Failed. Execution failed: exit code 1
test result: Failed. Execution failed: exit code 1