JDK-8341246 : Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2024-09-30
  • Updated: 2024-10-07
  • Resolved: 2024-10-02
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.

To download the current JDK release, click here.
JDK 24
24 b18Fixed
Related Reports
Duplicate :  
Relates :  
Description
Test com/sun/tools/attach/PermissionTest.java fails, test log snippet:

STDERR:
 stdout: [];
 stderr: [WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
Exception in thread "main" java.lang.ExceptionInInitializerError
	at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:58)
	at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
	at PermissionTest$TestMain.main(PermissionTest.java:120)
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/proc/self/ns/mnt" "readlink")
	at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488)
	at java.base/java.security.AccessController.checkPermission(AccessController.java:1085)
	at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411)
	at java.base/sun.nio.fs.UnixFileSystemProvider.readSymbolicLink(UnixFileSystemProvider.java:554)
	at java.base/java.nio.file.Files.readSymbolicLink(Files.java:1474)
	at jdk.attach/sun.tools.attach.VirtualMachineImpl.<clinit>(VirtualMachineImpl.java:66)
	... 3 more
]
 exitValue = 1

java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]
	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:522)
	at PermissionTest.runTests(PermissionTest.java:102)
	at PermissionTest.main(PermissionTest.java:58)
Comments
The fix for this bug is integrated in jdk-24+18-2055.
02-10-2024

Changeset: 76283dd2 Branch: master Author: SendaoYan <syan@openjdk.org> Date: 2024-10-02 16:07:10 +0000 URL: https://git.openjdk.org/jdk/commit/76283dd2701ca4ad5c1c99a66f3e8e3d0fe55d44
02-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21269 Date: 2024-09-30 16:11:27 +0000
30-09-2024

Maybe fails after JDK-8327114
30-09-2024