JDK-6980747 : (process) Runtime.exec can fail due to SecurityException (lnx)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-08-28
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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 7
7 b112Fixed
Related Reports
Relates :  
Description
This bug relates to this discussion:
  http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-August/004782.html

and is probably a regression caused by 6944584.

Here's how the test fails on Linux:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at java.util.concurrent.SynchronousQueue.<init>(SynchronousQueue.java:827)
	at java.util.concurrent.SynchronousQueue.<init>(SynchronousQueue.java:817)
	at java.util.concurrent.Executors.newCachedThreadPool(Executors.java:194)
	at java.lang.UNIXProcess.<clinit>(UNIXProcess.java:120)
	at java.lang.ProcessImpl.start(ProcessImpl.java:128)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1016)
	at java.lang.Runtime.exec(Runtime.java:610)
	at java.lang.Runtime.exec(Runtime.java:448)
	at java.lang.Runtime.exec(Runtime.java:345)
	at SecurityManagerClinit.main(SecurityManagerClinit.java:71)
Caused by: java.lang.RuntimeException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.java.util.concurrent")
	at java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.<init>(AtomicReferenceFieldUpdater.java:217)
	at java.util.concurrent.atomic.AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdater.java:93)
	at java.util.concurrent.SynchronousQueue$TransferStack.<clinit>(SynchronousQueue.java:294)
	... 10 more
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.java.util.concurrent")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:345)
	at java.security.AccessController.checkPermission(AccessController.java:555)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1529)
	at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:134)
	at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:119)
	at java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.<init>(AtomicReferenceFieldUpdater.java:214)
	... 12 more

Comments
EVALUATION Missing doPrivileged.
28-08-2010