[
https://issues.apache.org/jira/browse/DERBY-5582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kathey Marsden updated DERBY-5582:
----------------------------------
Attachment: derby5582.policy
MySecurityManager.java
Derby5582Runner.java
Here is a reproduction for the issue. MySecurityManager has a
checkAccess(ThreadGroup tg) method which prevents creation of the index-stat
thread with the default (parent) Thread Group.
$ java Derby5582Runner
currentGroup:main
tg group: main
currentGroup:main
tg group: derby.daemons
currentGroup:main
tg group: derby.daemons
currentGroup:system
tg group: system
currentGroup:main
tg group: main
currentGroup:main
tg group: main
currentGroup:main
tg group: main
currentGroup:main
tg group: main
initialized derby
currentGroup:main
tg group: main
currentGroup:main
tg group: privtg
currentGroup:main
tg group: privtg
currentGroup:system
Enter run()
tg group: system
currentGroup:privtg
tg group: derby.daemons
Created database
Firing off the worker thread
Starting index-stat thread
currentGroup:privtg
tg group: privtg
throwing security exception
got exception
java.sql.SQLException: Java exception: 'No permission to private ThreadGroup
privtg: java.lang.SecurityException'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:436)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
at
org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2288)
at
org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:153)
at
org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Driver40.java:107)
at
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1613)
at
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1441)
at Derby5582Runner.run(Derby5582Runner.java:43)
at java.lang.Thread.run(Thread.java:736)
Caused by: java.sql.SQLException: Java exception: 'No permission to private
ThreadGroup privtg: java.lang.SecurityExcept
ion'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:42)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:12
2)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
... 12 more
Caused by: java.lang.SecurityException: No permission to private ThreadGroup
privtg
at MySecurityManager.checkAccess(MySecurityManager.java:10)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:226)
at java.lang.Thread.initialize(Thread.java:331)
at java.lang.Thread.<init>(Thread.java:267)
at java.lang.Thread.<init>(Thread.java:165)
at
org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.schedule(IndexStatisticsDaemonImpl.java:257)
at
org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:569)
at
org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:97)
at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConne
ctionContext.java:1103)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:134)
... 5 more
run done
> Access denied (java.lang.RuntimePermission modifyThreadGroup) in
> IndexStatisticsDaemonImpl.schedule()
> ------------------------------------------------------------------------------------------------------
>
> Key: DERBY-5582
> URL: https://issues.apache.org/jira/browse/DERBY-5582
> Project: Derby
> Issue Type: Bug
> Components: Services
> Affects Versions: 10.8.2.3
> Reporter: Kathey Marsden
> Attachments: Derby5582Runner.java, MySecurityManager.java,
> derby-5582_10_8_try1_diff.txt, derby5582.policy
>
>
> I user reported this exception with 10.8.2.3 - (1212722) when running
> regression tests against 10.8.
> As soon as the Index Statistics Thread was initialized they got the stack
> trace below.
> There was some discussion of this issue on the dev list:
> http://old.nabble.com/Report-of-security-manager-issue-with-10.8-and-ndexStatisticsDaemonImpl.schedule-to33137398.html
> I assume the failure is in
> runningThread = new Thread(this, "index-stat-thread");
> Stack Trace:
> java.security.AccessControlException: Access denied
> (java.lang.RuntimePermission modifyThreadGroup)
> at
> java.security.AccessController.checkPermission(AccessController.java:108)
> at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
> at
> com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:208)
> at
> com.ibm.ws.security.core.SecurityManager.checkAccess(SecurityManager.java:407)
> at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:226)
> at java.lang.Thread.initialize(Thread.java:345)
> at java.lang.Thread.<init>(Thread.java:281)
> at java.lang.Thread.<init>(Thread.java:179)
> at
> org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.schedule(Unknown
> Source)
> at
> org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
> at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown
> Source)
> at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
> Source)
> at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
> at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
> at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
> at
> org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
> at
> org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
> at
> org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> at
> org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> at
--
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