You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (Created) (JIRA)" <ji...@apache.org> on 2011/11/24 01:40:41 UTC
[jira] [Created] (DERBY-5514) SecureServerTest doesn't play nice
ewith EMMA: AccessControlException
SecureServerTest doesn't play nice ewith EMMA: AccessControlException
---------------------------------------------------------------------
Key: DERBY-5514
URL: https://issues.apache.org/jira/browse/DERBY-5514
Project: Derby
Issue Type: Bug
Affects Versions: 10.9.0.0
Reporter: Dag H. Wanvik
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run inferior VMs with plain jars (downside: we won't get coverage for those)
run with a special default policy file when we run with EMMA, detect when we fork
with EMMA jars and use a dedicated "coverage.ec", either by telling EMMA to use another one if possible,
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Attachment: derby-5514-1.stat
derby-5514-1.diff
Uploading a patch which implements the third approach. This made the test complete with EMMA instrumented jars.
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest doesn't play nice
ewith EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Description:
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run inferior VMs with plain jars (downside: we won't get coverage for those)
run with a special default policy file when we run with EMMA ++
run the spawned VM with -noSecurityManager if with EMMA jars
was:
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run inferior VMs with plain jars (downside: we won't get coverage for those)
run with a special default policy file when we run with EMMA ++
> SecureServerTest doesn't play nice ewith EMMA: AccessControlException
> ---------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run inferior VMs with plain jars (downside: we won't get coverage for those)
> run with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156875#comment-13156875 ]
Dag H. Wanvik commented on DERBY-5514:
--------------------------------------
I found that the default test policy has the following entry for EMMA (granted to derby.jar)
// These permissions are needed when testing code instrumented with EMMA.
// They will only be used if the emma.active system property property is set,
// which should be set to "" for the permissions to be correct.
permission java.util.PropertyPermission "${emma.active}user.dir", "read";
permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
I tried approach two above, to craft a special policy file for the server and grant these privileges to *emma.jar* (for SecureServerTest). This worked in part, except for a case where there was a lacking permission for writeFileDescriptor (same stack trace as below).
Now, in the tools suite I found a similar issue after running SysinfoLocaleTest:
[junit] java.security.AccessControlException: access denied (java.lang.RuntimePermission writeFileDescriptor)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkWrite(SecurityManager.java:937)
[junit] at java.io.FileOutputStream.<init>(FileOutputStream.java:219)
[junit] at com.vladium.emma.data.DataFactory$UCFileOutputStream.<init>(DataFactory.java:292)
[junit] at com.vladium.emma.data.DataFactory$RandomAccessFileOutputStream.<init>(DataFactory.java:375)
[junit] at com.vladium.emma.data.DataFactory.writeEntry(DataFactory.java:715)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:672)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
except this time there is no spawned VM, so the code is running under the default test policy, which does have the EMMA permissions shown above. Note that this thread doesn't have any code from derby.jar on the stack, so the fact the derby.jar has the required privileges doesn't help: we still get AccessControlException.
I downloaded the EMMA sources and wrapped the call to RTCoverageDataPersister#DataFactory.persist (cdataView, outFile, merge) in a doPrivilegedException call. That made it work.
There is no other use of doPrivileged in EMMA's code, so we may see other similar problems.
The exception seen above is later followed by this warning:
[report] processing input file [/export/home/dag/java/sb/sb1/junit_20111124_1520/coverage.ec] ...
[report] java.io.UTFDataFormatException: malformed input around byte 0
which is may be the (partial?) reason why the coverage file gets corrupted.
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Issue & fix info: Patch Available
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156611#comment-13156611 ]
Knut Anders Hatlen commented on DERBY-5514:
-------------------------------------------
Running the network server with a special default policy file when we run with EMMA is probably the right thing to do, but running with -noSecurityManager also sounds perfectly acceptable.
The patch didn't compile in my environment:
junitcomponents:
[javac] Compiling 1 source file to /code/derby/trunk/classes
[javac] /code/derby/trunk/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java:264: cannot find symbol
[javac] symbol : method contains(java.lang.String)
[javac] location: class java.lang.String
[javac] classpath.contains("emma.jar"))
[javac] ^
[javac] 1 error
Changing contains() to indexOf() made it work, and I could run SecureServerTest without seeing the stack traces getting printed.
If I added the following line to NetworkServerTestSetup.startSeparateProcess()
al.add("-Demma.verbosity.level=silent");
I didn't have to change the assert in SecureServerTest.
SecureServerTest.runServerCommand() and Driver40UnbootedTest.test_notBooted() also set this property to prevent that EMMA interferes with the canons.
As to the problem with spawned processes possibly corrupting coverage.ec, perhaps we could run the spawned processes with the emma.coverage.out.file system property set, and use a counter to prevent name clashes? If so, I'd prefer that we do that in BaseTestCase.execJavaCmd() so that it works for most of the tests. NetworkServerTestSetup doesn't use BaseTestCase.execJavaCmd() yet, but making it do so should be trivial. Maybe it would also make sense to push the setting of emma.verbosity.level down to that method too, so that we don't have to do that in every test that happens to spawn a process.
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156936#comment-13156936 ]
Dag H. Wanvik commented on DERBY-5514:
--------------------------------------
With the patch to Emma, the fix to DERBY-5512 (thanks, Knut) and setting the path the the old releases when calling ant (since i'm behind a firewall), I was able to make all tests in ant target "derby-core" run with emma jars, albeit a few at a time. I'll start all the tests now passing larger heap size etc in via ANT_OPTS, so I'll see how far I get with Emma running the "emma-all" target. It would be nice to have it running again.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Knut Anders Hatlen (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen updated DERBY-5514:
--------------------------------------
Attachment: d5514-emma-permissions-to-all.diff
Thanks for that info, Dag! So it seems that the problem is that the JVM's runtime libraries don't have the permissions required by the EMMA code, and the lack of doPrivileged blocks in EMMA requires all code to have those permissions (except if Derby code that contains doPrivileged blocks itself is on the stack and limits the privilege checking).
Based on that observation, I tried a different approach that didn't require modifying the EMMA source (see d5514-emma-permissions-to-all.diff). Instead, I changed the policy files to grant the permissions required by EMMA to all code bases when running with the instrumented code. That's basically the same as the current policy files do, except they explicitly grant the permissions to all the jar files we know about, whereas my patch grants them to all code bases the JVM knows about. (This also simplifies the policy files a bit, since we now only need one grant rule that covers all code bases, instead of one grant rule per code base.)
I ran "ant -DderbyTesting.oldReleasePath=... emma-all" with my attached patch and Dag's initial patch for SecureServerTest. I saw two failures in RuntimeInfoTest, but it sounds like Dag already has a fix for that test in his sandbox (by setting the emma.verbosity.level property?).
I also had to make a small change to RoutineSecurityTest. It contained negative test cases that tried to get the value of various system properties from within a stored procedure. Among these properties were user.dir, on which EMMA requires a read permission. Since EMMA's permissions are now granted to a wider set of code bases, getting that property now unexpectedly succeeded.
Because of this, the patch skips the negative test case for user.dir. There are negative test cases for many other system properties, so I think RoutineSecurityTest still tests what it intended to test. Also, as a compensation, I enabled the negative test case for the user.home property in the same test. That test case has been disabled since the test was first checked in, but there is no comment saying why it's disabled, and it didn't fail in my environment (tested from both classes and jars, since they have different permissions granted to them, and also both sane and insane).
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Summary: SecureServerTest (and others) don't play nice with EMMA: AccessControlException (was: SecureServerTest doesn't play nice with EMMA: AccessControlException)
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik reassigned DERBY-5514:
------------------------------------
Assignee: Dag H. Wanvik
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Assignee: Dag H. Wanvik
> Fix For: 10.9.0.0
>
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik resolved DERBY-5514.
----------------------------------
Resolution: Fixed
Fix Version/s: 10.9.0.0
Issue & fix info: (was: Patch Available)
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Fix For: 10.9.0.0
>
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158583#comment-13158583 ]
Dag H. Wanvik commented on DERBY-5514:
--------------------------------------
Committed derby-5514-2 as svn 1207471, resolving.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Fix For: 10.9.0.0
>
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157219#comment-13157219 ]
Dag H. Wanvik commented on DERBY-5514:
--------------------------------------
Thanks, Knut! Good if we can get away without changing the Emma source. Yes, added "-Demma.verbosity.level=silent" to RuntimeInfoTest#RuntimeinfoCmd and RuntimeinfoLocaleCmd. Seems we are good to code for the emma-all target, then. Btw, the ANT_OPTS may not be required as you said offline, since ant starts each suite separately.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Description:
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run the spawned VMs with plain jars (downside: we won't get coverage for those)
run the spawned with a special default policy file when we run with EMMA ++
run the spawned VM with -noSecurityManager if with EMMA jars
was:
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run inferior VMs with plain jars (downside: we won't get coverage for those)
run with a special default policy file when we run with EMMA ++
run the spawned VM with -noSecurityManager if with EMMA jars
Summary: SecureServerTest doesn't play nice with EMMA: AccessControlException (was: SecureServerTest doesn't play nice ewith EMMA: AccessControlException)
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest doesn't play nice
ewith EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Description:
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run inferior VMs with plain jars (downside: we won't get coverage for those)
run with a special default policy file when we run with EMMA ++
was:
When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
[junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
[junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.policy: error adding Entry:
[junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
[junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
[junit] at java.security.AccessController.checkPermission(AccessController.java:546)
[junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
[junit] at java.io.File.exists(File.java:731)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:662)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This is presumably because the test spawns a server which runs with the default server policy.
Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
In this case the spawned process was started with this command line (I instrumented the code):
XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
Possible approaches:
run inferior VMs with plain jars (downside: we won't get coverage for those)
run with a special default policy file when we run with EMMA, detect when we fork
with EMMA jars and use a dedicated "coverage.ec", either by telling EMMA to use another one if possible,
> SecureServerTest doesn't play nice ewith EMMA: AccessControlException
> ---------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run inferior VMs with plain jars (downside: we won't get coverage for those)
> run with a special default policy file when we run with EMMA ++
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156618#comment-13156618 ]
Knut Anders Hatlen commented on DERBY-5514:
-------------------------------------------
> If I added the following line to NetworkServerTestSetup.startSeparateProcess()
> al.add("-Demma.verbosity.level=silent");
> I didn't have to change the assert in SecureServerTest.
I spoke too soon. This removed the unexpected line "EMMA: collecting runtime coverage data ..." from the output, but it still didn't show the security manager information expected by the test (because the security manager is not used), so the assert still fails.
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156887#comment-13156887 ]
Dag H. Wanvik commented on DERBY-5514:
--------------------------------------
Small correction to the above: the default policy file for the tests does contain explicit permissions for the emma jar. But, that isn't enough when emma doesn't call doPrivileged, of course. The default server policy does not, of course.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Attachment: derby-5514-2.stat
derby-5514-2.diff
Uploading patch derby-5514-2, which
- fixes the usa of String#contains,
- adds -Demma.verbosity.level=silent to RuntimeInfoTest
- adds the convenience method runsWithEmma to BaseTestCase
- adds fixes to NetworkServerTestSetup to
a) always use Emma verbosity silent when spawning a server in separate VM, and also
b) refrains from starting the server with the security manager when running with Emma since the default server policy doesn't contain permissions for Emma, and finally
- skips the assertion for the security manager being used in
SecureServerTest (it is not, see preceding item)
With these fixes *and* my patch to Emma (it will not be required when Knut's fixes to the policy files are added), "ant emma-all" completed successfully (see https://people.apache.org/~dag/coverage.html).
I notice emma-all doesn't contain the following tests which we may consider including:
- LobLimitsLiteTest
- StressMultiTest
- i18n._Suite
- ReplicationSuite
which are all run as part of PackagesAll in the regressions.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158442#comment-13158442 ]
Knut Anders Hatlen commented on DERBY-5514:
-------------------------------------------
I ran suites.All (which includes the above mentioned test suites that are not part of emma-all/junit-all) successfully with derby-5514-2.diff and instrumented jars. +1 to commit.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-5514:
---------------------------------
Component/s: Test
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Fix For: 10.9.0.0
>
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest (and others) don't
play nice with EMMA: AccessControlException
Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157413#comment-13157413 ]
Knut Anders Hatlen commented on DERBY-5514:
-------------------------------------------
Committed d5514-emma-permissions-to-all.diff with revision 1206409.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: d5514-emma-permissions-to-all.diff, derby-5514-1.diff, derby-5514-1.stat, derby-5514-2.diff, derby-5514-2.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (DERBY-5514) SecureServerTest (and
others) don't play nice with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156887#comment-13156887 ]
Dag H. Wanvik edited comment on DERBY-5514 at 11/24/11 11:39 PM:
-----------------------------------------------------------------
Small correction to the above: the default policy file for the tests does contain explicit permissions for the emma jar. But, that isn't enough when emma doesn't call doPrivileged, of course. The default server policy does not contain permissions for Emma.
was (Author: dagw):
Small correction to the above: the default policy file for the tests does contain explicit permissions for the emma jar. But, that isn't enough when emma doesn't call doPrivileged, of course. The default server policy does not, of course.
> SecureServerTest (and others) don't play nice with EMMA: AccessControlException
> -------------------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5514) SecureServerTest doesn't play nice
with EMMA: AccessControlException
Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156497#comment-13156497 ]
Dag H. Wanvik commented on DERBY-5514:
--------------------------------------
Related: RuntimeInfoTest fails due to asserting on the output from the spawned process: output contains EMMA info.
> SecureServerTest doesn't play nice with EMMA: AccessControlException
> --------------------------------------------------------------------
>
> Key: DERBY-5514
> URL: https://issues.apache.org/jira/browse/DERBY-5514
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.9.0.0
> Reporter: Dag H. Wanvik
> Attachments: derby-5514-1.diff, derby-5514-1.stat
>
>
> When running SecureServerTest with jars instrumented with EMMA using the ant emma-all target, I see:
> [junit] (net)derbynet.SecureServerTest.testServerStartup used 8475 ms junit.framework.TestListener: endTest(testServerStartup)
> [junit] START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.policy: error adding Entry:
> [junit] java.net.MalformedURLException: no protocol: /export/home/dag/java/sb/sb1/tools/java/emma.jar
> [junit] java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> [junit] at java.security.AccessController.checkPermission(AccessController.java:546)
> [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:731)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.security.AccessControlException: access denied (java.io.FilePermission coverage.ec read)
> [junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:662)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
> This is presumably because the test spawns a server which runs with the default server policy.
> Another thing is that is seems dangerous to let the spawned process write to EMMA's "coverage.ec", since we don't know when the parent process will write to it. This behavior could be what's been causing our corrutions in the EMMA runs earlier. The missing permissions just highlight what's happening.
> In this case the spawned process was started with this command line (I instrumented the code):
> XXX server startup command = /usr/jdk/instances/jdk1.6.0/jre/bin/java -classpath /<my sandbox>/tools/java/emma.jar:/<my sandbox>/jars/sane/derbyTesting.jar:/<my sandbox>/jars/emma/lib/derbyclient.jar:/<my sandbox>/jars/emma/lib/derbynet.jar:/<my sandbox>/jars/emma/lib/derby.jar:/<my sandbox>/jars/emma/lib/derbytools.jar:/<my sandbox>/jars/emma/lib/derbyrun.jar:/<my sandbox>/tools/java/junit.jar:/usr/share/lib/ant/ant-launcher.jar:/usr/share/lib/ant/ant.jar:/usr/share/lib/ant/ant-junit.jar org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
> Possible approaches:
> run the spawned VMs with plain jars (downside: we won't get coverage for those)
> run the spawned with a special default policy file when we run with EMMA ++
> run the spawned VM with -noSecurityManager if with EMMA jars
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira