You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2019/12/23 19:04:17 UTC

[GitHub] [lucene-solr] uschindler opened a new pull request #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit

uschindler opened a new pull request #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit
URL: https://github.com/apache/lucene-solr/pull/1114
 
 
   This is just a small improvement in Lucene/Solr master (Java 11) to detect exit of JVM in our test framework. There are other places in Lucene that use ineffective ways to inspect the stack trace.
   
   This one optimizes the implementation of TestSecurityManager#checkExit(status) to disallow all JVM exits outside of the official test runner by using StackWalker. In addition this needs no additional permissions, because we do not instruct StackWalker to fetch all crazy stuff like Class instances of stack elements.
   
   The way how this works is: Walk through stack trace:
   
   - skip all internal frames (those which come before the actual exit call)
   - skip all frmes with the actual exit call
   - limit to one more frame (the method calling System.exit())
   - check if that remaining frame is on our whitelist
   
   This can only be commited to master (9.0), as it requires Java 9.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit
URL: https://github.com/apache/lucene-solr/pull/1114#issuecomment-568802441
 
 
   LGTM!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler merged pull request #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit

Posted by GitBox <gi...@apache.org>.
uschindler merged pull request #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit
URL: https://github.com/apache/lucene-solr/pull/1114
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit

Posted by GitBox <gi...@apache.org>.
uschindler commented on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit
URL: https://github.com/apache/lucene-solr/pull/1114#issuecomment-568567830
 
 
   You are right:
   
   > If there is a security manager, and this thread is not the current thread, then the security manager's checkPermission method is called with a RuntimePermission("getStackTrace") permission to see if it's ok to get the stack trace.
   
   As we were only looking at current thread it was ok. Not sure why we had the permission stuff.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler edited a comment on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit

Posted by GitBox <gi...@apache.org>.
uschindler edited a comment on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit
URL: https://github.com/apache/lucene-solr/pull/1114#issuecomment-568567830
 
 
   You are right:
   
   > If there is a security manager, and this thread is not the current thread, then the security manager's checkPermission method is called with a RuntimePermission("getStackTrace") permission to see if it's ok to get the stack trace.
   
   As we were only looking at current thread it was useless to have the privileged context. Not sure why we had the permission stuff.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit

Posted by GitBox <gi...@apache.org>.
uschindler commented on issue #1114: LUCENE-9109: Use stack walker to implement TestSecurityManager's detection of test JVM exit
URL: https://github.com/apache/lucene-solr/pull/1114#issuecomment-568582551
 
 
   I just changed the static final predicate to a static method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org