Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Jaikiran Pai
On 29/06/21 12:21 am, Alan Bateman wrote: On 28/06/2021 18:16, Jaikiran Pai wrote: On a slightly related note, I was wondering why we decided to go with what appears to be a bit more aggressive approach to these warning messages as compared to what was done with the illegal reflective acce

Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Jaikiran Pai
On 29/06/21 12:34 pm, Jaikiran Pai wrote: > Out of all these 4 points, I think if point number 2 can be addressed such that it just prints only once the warning for each caller class, then the issue noted by users of Ant build file will be drastically reduced. I haven't yet tried or prove

Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Alan Bateman
On 29/06/2021 08:04, Jaikiran Pai wrote: Thank you Alan. I see that https://bugs.openjdk.java.net/browse/JDK-8269543 has been created for this. I'll keep a watch on that one. Yes, that was the original intention but had to dropped because it wasn't thread safe. BTW: I'm puzzled as to w

Re: [jdk17] RFR: 8269034: AccessControlException for SunPKCS11 daemon threads [v3]

2021-06-29 Thread Valerie Peng
On Tue, 29 Jun 2021 00:07:41 GMT, Sean Coffey wrote: >> Sufficient permissions missing if this code was ever to run with >> SecurityManager. >> >> Cleanest approach appears to be use of InnocuousThread to create the >> cleaner/poller threads. >> Test case coverage extended to cover the Securi

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Daniel Fuchs
On Mon, 28 Jun 2021 21:09:43 GMT, Weijun Wang wrote: > Add a cache to record which sources have called `System::setSecurityManager` > and only print out warning lines once for each. src/java.base/share/classes/java/lang/System.java line 337: > 335: = Collections.synchronizedMap(new

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Roger Riggs
On Tue, 29 Jun 2021 18:47:23 GMT, Daniel Fuchs wrote: >> Add a cache to record which sources have called `System::setSecurityManager` >> and only print out warning lines once for each. > > src/java.base/share/classes/java/lang/System.java line 337: > >> 335: = Collections.synchroniz

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Weijun Wang
On Tue, 29 Jun 2021 19:23:26 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/lang/System.java line 337: >> >>> 335: = Collections.synchronizedMap(new WeakHashMap<>()); >>> 336: } >>> 337: >> >> I wonder about the use of a WeakHashMap here. That may work well when th

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Chapman Flack
On 06/29/21 15:39, Weijun Wang wrote: > If I switch to a "non-weak" set or map, then it seems I can safely use > the source string as the key. Will using the Class object as a key prevent > them from unloading? I understand that it's in principle possible for classes to get GC'd, though I don't k

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Roger Riggs
On Tue, 29 Jun 2021 19:35:40 GMT, Weijun Wang wrote: >> Using a HashSet could use the callerClass as the key and be a stable >> reference for having given the message. >> or use a ConcurrentHashMap>, boolean> and avoid any separate >> synchronization that would be needed with a HashSet or HashM

Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Wei-Jun Wang
> On Jun 29, 2021, at 3:08 AM, Jaikiran Pai wrote: > > > On 29/06/21 12:34 pm, Jaikiran Pai wrote: >> >> >> >> > Out of all these 4 points, I think if point number 2 can be addressed such >> > that it just prints only once the warning for each caller class, then the >> > issue noted by u

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Weijun Wang
On Tue, 29 Jun 2021 19:57:24 GMT, Roger Riggs wrote: >> If I switch to a "non-weak" set or map, then it seems I can safely use the >> source string as the key. Will using the Class object as a key prevent them >> from unloading? > > Using a synchronized WeakHashMap with the class as the key wou

[jdk17] Integrated: 8269034: AccessControlException for SunPKCS11 daemon threads

2021-06-29 Thread Sean Coffey
On Tue, 22 Jun 2021 13:26:41 GMT, Sean Coffey wrote: > Sufficient permissions missing if this code was ever to run with > SecurityManager. > > Cleanest approach appears to be use of InnocuousThread to create the > cleaner/poller threads. > Test case coverage extended to cover the SecurityMana

RFR: Merge jdk17

2021-06-29 Thread Jesper Wilhelmsson
Forwardport JDK 17 -> JDK 18 - Commit messages: - Merge - 8269034: AccessControlException for SunPKCS11 daemon threads - 8269529: javax/swing/reliability/HangDuringStaticInitialization.java fails in Windows debug build - 8269232: assert(!is_jweak(handle)) failed: wrong method for

Re: RFR: 8268965: TCP Connection Reset when connecting simple socket to SSL server

2021-06-29 Thread Xue-Lei Andrew Fan
On Thu, 17 Jun 2021 13:20:54 GMT, Alexey Bakhtin wrote: > Please review the fix for JDK-8268965. > > The new jtreg test is added for the described issue. > sun/security/ssl and javax/net/ssl tests are passed I would like to have a look. I was wondering if there is a racing between close and r

Integrated: Merge jdk17

2021-06-29 Thread Jesper Wilhelmsson
On Wed, 30 Jun 2021 00:31:34 GMT, Jesper Wilhelmsson wrote: > Forwardport JDK 17 -> JDK 18 This pull request has now been integrated. Changeset: ee526a2e Author:Jesper Wilhelmsson URL: https://git.openjdk.java.net/jdk/commit/ee526a2ea840aedb97b23538f9d624acbccebc97 Stats: 127 l

Re: RFR: Merge jdk17 [v2]

2021-06-29 Thread Jesper Wilhelmsson
> Forwardport JDK 17 -> JDK 18 Jesper Wilhelmsson has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 113 commits: - Merge - 8269615: Fix for 8263640 broke Windows build Reviewed-by: iklam, dcubed - 8269268: JDWP: Properly fix t

Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Jaikiran Pai
Hello Max, On 30/06/21 2:42 am, Wei-Jun Wang wrote: On Jun 29, 2021, at 3:08 AM, Jaikiran Pai wrote: On 29/06/21 12:34 pm, Jaikiran Pai wrote: Out of all these 4 points, I think if point number 2 can be addressed such that it just prints only once the warning for each caller class, the

Re: [jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller

2021-06-29 Thread Alan Bateman
On Tue, 29 Jun 2021 21:18:35 GMT, Weijun Wang wrote: >> Using a synchronized WeakHashMap with the class as the key would not prevent >> class unloading. >> Using a non-weak set or map to strings would keep the strings around for the >> life of the runtime. > > I hope this is uncommon but if tha

Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Alan Bateman
On 30/06/2021 05:51, Jaikiran Pai wrote: In the case we are dealing with, the class is always "org.apache.tools.ant.types.Permissions". It will always be loaded by one single classloader (so classloaded just once). However, multiple different instances of this class will get created during th

Re: Initial feedback from Apache Ant users on recent security manager warning messages

2021-06-29 Thread Jaikiran Pai
On 30/06/21 12:10 pm, Alan Bateman wrote: On 30/06/2021 05:51, Jaikiran Pai wrote: In the case we are dealing with, the class is always "org.apache.tools.ant.types.Permissions". It will always be loaded by one single classloader (so classloaded just once). However, multiple different insta