<div dir="ltr"><div><div>No luck so far reproducing this problem.  The two times it happened to me yesterday have both been with Java 9 build 181 and the application has been idle for awhile. I login to our application, execute various features of the application, go to a meeting, return, and then see the java console repeatedly displaying the stack overflow exception.  Maybe meetings are bad for Java 9? :-)  I think there are some background threads in our application that are waking up periodically and doing "stuff".  I don't know what that "stuff" is yet, but that would be my guess at where I will find the code that triggered the overflow.<br><br></div><div></div><div></div><div>Assuming I can get our application to the point where I can reproduce the stack overflow, are there particular Java 9 builds that made significant changes to security-relevant code that you'd like me to try?<br><br></div><div>Keep in mind that our app runs on a network not connected to the internet.  As it is, I manually typed in the stack trace, so if there's a lot of output I'll have to print it and go through an approval process to show it to you via a scanned pdf.  I will continue testing of our app with the security debug turned on so that I'll have the output if it happens again.  I also have the logging and tracing enabled in the java control panel.<br><br></div><div>-- Tom<br></div></div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 12:13 PM, Sean Mullan <span dir="ltr"><<a href="mailto:sean.mullan@oracle.com" target="_blank">sean.mullan@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cross-posting to security-dev as this is more relevant to that list and bcc-ing core-libs-dev.<br>
<br>
I think this might be an issue with the JavaWebStart SecurityManager not being granted the proper permissions. It is possible that the deployment policy files are not being loaded or there is some other subtle bootstrapping issue. It should not result in a recursive loop of course, but there may be a workaround.<br>
<br>
In the meantime, can you send me more information, preferably a test case and a log file with -Djava.security.debug=all enabled? (The latter will help analyze the recursion and see what security checks are failing and for which ProtectionDomains). Also, have you tested this on builds earlier than b181?<br>
<br>
Thanks,<br>
Sean<span class=""><br>
<br>
On 9/19/17 2:53 PM, Tom Hood wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
I should add that we have not modified or overridden any policy files.<br>
Also, we are not using a custom security manager.<br>
<br>
On Tue, Sep 19, 2017 at 11:52 AM, Tom Hood <<a href="mailto:tom.w.hood@gmail.com" target="_blank">tom.w.hood@gmail.com</a>> wrote:<br>
<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hi,<br>
<br>
I hit an infinite recursion loop probably related to PolicyFile that<br>
exists in Java 9 build 181 for windows 64-bit.  It might be related to<br></span>
JDK-8077418 <<a href="https://bugs.openjdk.java.net/browse/JDK-8077418" rel="noreferrer" target="_blank">https://bugs.openjdk.java.net<wbr>/browse/JDK-8077418</a>><div><div class="h5"><br>
<br>
I haven't tracked down what is causing our webstart app to hit this<br>
problem yet, but I thought I would let you know sooner than later.  Also,<br>
it probably is not a problem for our particular application as I should be<br>
able to set the security manager to null which I think/hope will bypass<br>
this issue.  I will try today to reproduce it in our app so I can confirm<br>
if setting security manager to null will work for us.<br>
<br>
The stack looks like the following: (with many repeat stacks omitted)<br>
<br>
Exception in thread "AWT-EventQueue-2" java.lang.StackOverflowError<br>
at java.base/java.security.Access<wbr>Controller.doPrivileged(Native Method)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.getPermissions(Po<br>
licyFile.java:1135)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.getPermissions(Po<br>
licyFile.java:1082)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.implies(PolicyFil<br>
e.java:1038)<br>
at java.base/java.security.provid<wbr>er.ProtectionDomain.implies(Pr<br>
otectionDomain.java:323)<br>
at java.base/java.security.provid<wbr>er.ProtectionDomain.impliesWit<br>
hAltFilePerm(ProtectionDomain.<wbr>java:355)<br>
at java.base/java.security.provid<wbr>er.AccessControlContext.checkP<br>
ermission(AccessControlContext<wbr>.java:450)<br>
at java.base/java.security.provid<wbr>er.AccessController.checkPermi<br>
ssion(AccessController.java:89<wbr>5)<br>
at java.base/java.lang.SecurityMa<wbr>nager.checkPermission(Security<br>
Manager.java:558)<br>
at jdk.javaws/com.sun.javaws.secu<wbr>rity.JavaWebStartSecurity.chec<br>
kPermission(JavaWebStartSecuri<wbr>ty.java:237)<br>
at java.base/java.lang.SecurityMa<wbr>nager.checkRead(SecurityManage<wbr>r.java:897)<br>
at java.base/java.io.File.isDirec<wbr>tory(File.java:845)<br>
at java.base/sun.net.www.ParseUti<wbr>l.fileToEncodedURL(ParseUtil.<wbr>java:299)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.canonicalizeCodeb<br>
ase(PolicyFile.java:1665)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.access$700(Policy<br>
File.java:263)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile$7.run(PolicyFile.<wbr>java:1139)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile$7.run(PolicyFile.<wbr>java:1136)<br></div></div>
**** and again ****<br>
at java.base/java.security.Access<wbr>Controller.doPrivileged(Native Method)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.getPermissions(Po<br>
licyFile.java:1135)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.getPermissions(Po<br>
licyFile.java:1082)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.implies(PolicyFil<br>
e.java:1038)<br>
at java.base/java.security.provid<wbr>er.ProtectionDomain.implies(Pr<br>
otectionDomain.java:323)<br>
at java.base/java.security.provid<wbr>er.ProtectionDomain.impliesWit<br>
hAltFilePerm(ProtectionDomain.<wbr>java:355)<br>
at java.base/java.security.provid<wbr>er.AccessControlContext.checkP<br>
ermission(AccessControlContext<wbr>.java:450)<br>
at java.base/java.security.provid<wbr>er.AccessController.checkPermi<br>
ssion(AccessController.java:89<wbr>5)<br>
at java.base/java.lang.SecurityMa<wbr>nager.checkPermission(Security<br>
Manager.java:558)<br>
at jdk.javaws/com.sun.javaws.secu<wbr>rity.JavaWebStartSecurity.chec<span class=""><br>
kPermission(JavaWebStartSecuri<wbr>ty.java:237)<br>
at java.base/java.lang.SecurityMa<wbr>nager.checkRead(SecurityManage<wbr>r.java:897)<br>
at java.base/java.io.File.isDirec<wbr>tory(File.java:845)<br>
at java.base/sun.net.www.ParseUti<wbr>l.fileToEncodedURL(ParseUtil.<wbr>java:299)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.canonicalizeCodeb<br>
ase(PolicyFile.java:1665)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.access$700(Policy<br>
File.java:263)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile$7.run(PolicyFile.<wbr>java:1139)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile$7.run(PolicyFile.<wbr>java:1136)<br></span>
**** above lines start the stack that repeats until overflow ****<br>
at java.base/java.security.Access<wbr>Controller.doPrivileged(Native Method)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.getPermissions(Po<br>
licyFile.java:1135)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.getPermissions(Po<br>
licyFile.java:1082)<br>
at java.base/sun.security.provide<wbr>r.PolicyFile.implies(PolicyFil<br>
e.java:1038)<br>
<br>
-- Tom<br>
<br>
<br>
</blockquote></blockquote>
</blockquote></div><br></div>