Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v7]

2022-04-19 Thread Valerie Peng
On Tue, 19 Apr 2022 14:00:06 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v6]

2022-04-19 Thread Xue-Lei Andrew Fan
On Tue, 19 Apr 2022 00:14:06 GMT, Valerie Peng wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update signatures for native code > > src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c line 274: > >> 27

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v7]

2022-04-19 Thread Xue-Lei Andrew Fan
> This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem with the code changes. The Runnables registered with Cleaner > r

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-19 Thread Xue-Lei Andrew Fan
On Tue, 19 Apr 2022 00:12:26 GMT, Brent Christian wrote: >> I think it is safer to add the check for 'hModule'. >> >> >> -if (moduleData != NULL) { >> +if (moduleData != NULL && moduleData->hModule != NULL) { > > That is very safe -- we already checked that `ckpNativeData != 0L`

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v6]

2022-04-18 Thread Valerie Peng
On Sat, 16 Apr 2022 05:35:20 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-18 Thread Brent Christian
On Sat, 16 Apr 2022 05:28:39 GMT, Xue-Lei Andrew Fan wrote: >> src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c line 274: >> >>> 272: ModuleData *moduleData = jlong_to_ptr(ckpNativeData); >>> 273: >>> 274: if (moduleData != NULL) { >> >> The check should be (moduleData-

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread Xue-Lei Andrew Fan
On Fri, 15 Apr 2022 18:48:33 GMT, Brent Christian wrote: >>> CleanerFactory is in java.base module, and does not export to >>> jdk.crypto.cryptoki module. I'm not sure if adding modules dependency is >>> good or not. > > It seems fine to me to export the common Cleaner to `jdk.crypto.cryptoki

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v6]

2022-04-15 Thread Xue-Lei Andrew Fan
> This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem with the code changes. The Runnables registered with Cleaner > r

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-15 Thread Xue-Lei Andrew Fan
On Fri, 15 Apr 2022 17:51:43 GMT, Valerie Peng wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> add a reference to the clean up method > > src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c line 274: >

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-15 Thread Xue-Lei Andrew Fan
On Fri, 15 Apr 2022 17:44:08 GMT, Valerie Peng wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> add a reference to the clean up method > > src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c line 265: >

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread Brent Christian
On Fri, 15 Apr 2022 15:00:18 GMT, Xue-Lei Andrew Fan wrote: > > CleanerFactory is in java.base module, and does not export to > > jdk.crypto.cryptoki module. I'm not sure if adding modules dependency is > > good or not. It seems fine to me to export the common Cleaner to `jdk.crypto.cryptoki`

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-15 Thread Valerie Peng
On Fri, 15 Apr 2022 15:50:19 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-15 Thread Valerie Peng
On Fri, 15 Apr 2022 15:50:19 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

2022-04-15 Thread Xue-Lei Andrew Fan
> This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem with the code changes. The Runnables registered with Cleaner > r

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v4]

2022-04-15 Thread Xue-Lei Andrew Fan
On Fri, 15 Apr 2022 15:23:33 GMT, Roger Riggs wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> more update on replace lambda > > src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java >

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v4]

2022-04-15 Thread Roger Riggs
On Fri, 15 Apr 2022 15:04:20 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v4]

2022-04-15 Thread Daniel Fuchs
On Fri, 15 Apr 2022 15:04:20 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v2]

2022-04-15 Thread Xue-Lei Andrew Fan
On Thu, 14 Apr 2022 22:32:23 GMT, Brent Christian wrote: > Can a test case be included? The classes updated are not public. I'm still looking for the way to expose the reference of them. - PR: https://git.openjdk.java.net/jdk/pull/8248

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread Xue-Lei Andrew Fan
On Fri, 15 Apr 2022 08:25:40 GMT, Daniel Fuchs wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Don't use lambda in cleaner > > src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java > lin

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread Xue-Lei Andrew Fan
On Fri, 15 Apr 2022 13:32:10 GMT, altrisi wrote: > Can't this use `CleanerFactory.cleaner()` and reuse the common Cleaner > instead of having its own? CleanerFactory is in java.base module, and does not export to jdk.crypto.cryptoki module. I'm not sure if adding modules dependency is good or

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v4]

2022-04-15 Thread Xue-Lei Andrew Fan
> This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem with the code changes. The Runnables registered with Cleaner > r

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread altrisi
On Fri, 15 Apr 2022 07:20:42 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread Daniel Fuchs
On Fri, 15 Apr 2022 07:20:42 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v3]

2022-04-15 Thread Xue-Lei Andrew Fan
> This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem with the code changes. The Runnables registered with Cleaner > r

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v2]

2022-04-14 Thread Brent Christian
On Thu, 14 Apr 2022 22:01:18 GMT, Xue-Lei Andrew Fan wrote: >> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java >> line 168: >> >>> 166: // Calls disconnect() to cleanup the native part of the >>> wrapper. >>> 167: Cleaner.create().register(this, >>

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v2]

2022-04-14 Thread Brent Christian
On Thu, 14 Apr 2022 22:01:55 GMT, Xue-Lei Andrew Fan wrote: >> This is an effort to fix a problem introduced in the fix for >> [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which >> replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, >> there is a problem

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v2]

2022-04-14 Thread Xue-Lei Andrew Fan
On Thu, 14 Apr 2022 19:26:53 GMT, Daniel Fuchs wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> use static cleaner, and clean up swp file > > src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/P

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v2]

2022-04-14 Thread Xue-Lei Andrew Fan
> This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem with the code changes. The Runnables registered with Cleaner > r

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki

2022-04-14 Thread Xue-Lei Andrew Fan
On Thu, 14 Apr 2022 19:22:00 GMT, Valerie Peng wrote: > src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/.PKCS11.java.swp > file should not be there? Oops, I missed this swp file while using git commit. - PR: https://git.openjdk.java.net/jdk/pull/8248

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki

2022-04-14 Thread Daniel Fuchs
On Thu, 14 Apr 2022 18:06:10 GMT, Xue-Lei Andrew Fan wrote: > This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem wit

Re: RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki

2022-04-14 Thread Valerie Peng
On Thu, 14 Apr 2022 18:06:10 GMT, Xue-Lei Andrew Fan wrote: > This is an effort to fix a problem introduced in the fix for > [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which > replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there > is a problem wit

RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki

2022-04-14 Thread Xue-Lei Andrew Fan
This is an effort to fix a problem introduced in the fix for [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which replaced the finalizers in jdk.crypto.cryptoki with Cleaners. However, there is a problem with the code changes. The Runnables registered with Cleaner refer to th