Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Alan Bateman
On Tue, 25 Jul 2023 02:09:29 GMT, Brian Burkhalter wrote: > It's based on micro-benchmarks. Having the loops in Java reduces throughput > but allocating memory using `malloc(len)` also reduces throughput as `len` > gets larger and this threshold appears to balance the two. Are these micro

Re: RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v3]

2023-07-24 Thread Xue-Lei Andrew Fan
On Mon, 24 Jul 2023 19:58:34 GMT, Valerie Peng wrote: >> src/java.base/share/classes/sun/security/rsa/RSASignature.java line 227: >> >>> 225: byte[] padded2 = padding.pad(encoded2); >>> 226: return MessageDigest.isEqual(padded2, decrypted); >>> 227: }

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Brian Burkhalter
On Mon, 24 Jul 2023 13:16:56 GMT, Alan Bateman wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > src/java.base/share/native/libjava/io_util.c line 62: > >> 60: /* The

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Brian Burkhalter
On Mon, 24 Jul 2023 12:59:55 GMT, Alan Bateman wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > src/java.base/share/classes/java/io/FileOutputStream.java line 366: >

Integrated: 8312578: Redundant javadoc in X400Address

2023-07-24 Thread John Jiang
On Mon, 24 Jul 2023 08:04:53 GMT, John Jiang wrote: > [JDK-8296741] removed the constructor `X400Address(byte[] value)`, but it > didn't remove the javadoc for this constructor. > This simple patch just removes this javadoc. > > [JDK-8296741]: >

Re: RFR: JDK-8311592 ECKeySizeParameterSpec causes too many exceptions on third party providers

2023-07-24 Thread Valerie Peng
On Tue, 18 Jul 2023 03:58:50 GMT, Anthony Scarpino wrote: > Hi, > > This fix eliminates needless exceptions each time the EC key size is obtained > through AlgorithmParameters on third party providers. These providers throw > an InvalidParameterSpecException as

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Brian Burkhalter
I think the idea is to treat an IOException thrown by any but the first invocation of readBytes() as equivalent to end-of-file such as described for InputStream::read(byte[],int,int)

Re: RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v3]

2023-07-24 Thread Valerie Peng
On Thu, 20 Jul 2023 05:06:11 GMT, Xue-Lei Andrew Fan wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update to address review feedbacks > > src/java.base/share/classes/sun/security/rsa/RSASignature.java line 227:

Re: RFR: 8312578: Redundant javadoc in X400Address

2023-07-24 Thread Hai-May Chao
On Mon, 24 Jul 2023 08:04:53 GMT, John Jiang wrote: > [JDK-8296741] removed the constructor `X400Address(byte[] value)`, but it > didn't remove the javadoc for this constructor. > This simple patch just removes this javadoc. > > [JDK-8296741]: >

Re: RFR: JDK-8311592 ECKeySizeParameterSpec causes too many exceptions on third party providers

2023-07-24 Thread Hai-May Chao
On Tue, 18 Jul 2023 03:58:50 GMT, Anthony Scarpino wrote: > Hi, > > This fix eliminates needless exceptions each time the EC key size is obtained > through AlgorithmParameters on third party providers. These providers throw > an InvalidParameterSpecException as

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Bernd
If you return the short buffer (on IOException), does it need to cache the pending exception or can you just rely on the next read hitting that underlying exception again? (Is there an actual guarantee somewhere that the read position is not altered on IOExceptions or

Re: RFR: 8312578: Redundant javadoc in X400Address

2023-07-24 Thread Xue-Lei Andrew Fan
On Mon, 24 Jul 2023 08:04:53 GMT, John Jiang wrote: > [JDK-8296741] removed the constructor `X400Address(byte[] value)`, but it > didn't remove the javadoc for this constructor. > This simple patch just removes this javadoc. > > [JDK-8296741]: >

RFR: 8309088: security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java fails

2023-07-24 Thread Rajan Halade
This is an update to test certificates issued by Amazon root CA. The new EE certificates have CRLDP so I have enabled CRL check on those. This test is updated to cover the failure while we wait for [JDK-8308592](https://bugs.openjdk.org/browse/JDK-8308592) - Commit messages: -

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Alan Bateman
On Mon, 24 Jul 2023 09:16:23 GMT, Vyom Tewari wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > src/java.base/share/native/libjava/io_util.c line 99: > >> 97:

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Alan Bateman
On Fri, 21 Jul 2023 22:40:00 GMT, Brian Burkhalter wrote: > Limit native memory allocation and move write loop from the native layer into > Java. This change should make the OOME reported in the issue much less likely. src/java.base/share/classes/java/io/FileOutputStream.java line 366: > 364:

Re: RFR: JDK-8312512: sspi.cpp avoid some NULL checks related to free and delete [v2]

2023-07-24 Thread Matthias Baesken
On Mon, 24 Jul 2023 11:30:29 GMT, Matthias Baesken wrote: >> sspi.cpp contains the gss_export_name function, where at the end some >> cleanup is done by calling delete. However this should be done more careful, >> because the function get_full_name which is called in gss_export_name might >>

Re: RFR: JDK-8312512: sspi.cpp gss_export_name avoid delete on NULL fullname [v2]

2023-07-24 Thread Daniel Jeliński
On Mon, 24 Jul 2023 11:30:29 GMT, Matthias Baesken wrote: >> sspi.cpp contains the gss_export_name function, where at the end some >> cleanup is done by calling delete. However this should be done more careful, >> because the function get_full_name which is called in gss_export_name might >>

Re: RFR: JDK-8312512: sspi.cpp gss_export_name avoid delete on NULL fullname [v2]

2023-07-24 Thread Matthias Baesken
On Mon, 24 Jul 2023 11:01:07 GMT, Daniel Jeliński wrote: > `free`, `delete` and `delete[]` are all safe to call on a NULL pointer. > > I noticed that we are checking for NULL in other places in this file; could > you remove these checks? Hi, I found and adjusted a number of places where the

Re: RFR: JDK-8312512: sspi.cpp gss_export_name avoid delete on NULL fullname [v2]

2023-07-24 Thread Matthias Baesken
> sspi.cpp contains the gss_export_name function, where at the end some cleanup > is done by calling delete. However this should be done more careful, because > the function get_full_name which is called in gss_export_name might return > NULL, so we better avoid calling delete in this case.

Re: RFR: 8308144: HttpClient - uncontrolled memory consumption in SSLFlowDelegate.Reader

2023-07-24 Thread zhurs
On Mon, 24 Jul 2023 06:28:23 GMT, Jaikiran Pai wrote: >> Thank you, I will look at these options. > > Hello @zhurs, would you mind if one of us took over this PR and moved this > forward? Daniel noted that the fix looks reasonable and it's the test which > will need some work. We will add you

Re: RFR: JDK-8312512: sspi.cpp gss_export_name avoid delete on NULL fullname

2023-07-24 Thread Daniel Jeliński
On Mon, 24 Jul 2023 07:50:44 GMT, Matthias Baesken wrote: > sspi.cpp contains the gss_export_name function, where at the end some cleanup > is done by calling delete. However this should be done more careful, because > the function get_full_name which is called in gss_export_name might return

[jdk21] Integrated: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock

2023-07-24 Thread Daniel Jeliński
On Fri, 21 Jul 2023 10:29:43 GMT, Daniel Jeliński wrote: > Hi all, > > This pull request contains a backport of commit > [354c6605](https://github.com/openjdk/jdk/commit/354c6605e32790ca421869636d8bf5456fc51717) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2023-07-24 Thread Vyom Tewari
On Fri, 21 Jul 2023 22:40:00 GMT, Brian Burkhalter wrote: > Limit native memory allocation and move write loop from the native layer into > Java. This change should make the OOME reported in the issue much less likely. src/java.base/share/native/libjava/io_util.c line 99: > 97: return

RFR: 8312578: Redundant javadoc in X400Address

2023-07-24 Thread John Jiang
[JDK-8296741] removed the constructor `X400Address(byte[] value)`, but it didn't remove the javadoc for this constructor. This simple patch just removes this javadoc. [JDK-8296741]: - Commit messages: - 8312578: Redundant javadoc in

RFR: JDK-8312512: sspi.cpp gss_export_name avoid delete on NULL fullname

2023-07-24 Thread Matthias Baesken
sspi.cpp contains the gss_export_name function, where at the end some cleanup is done by calling delete. However this should be done more careful, because the function get_full_name which is called in gss_export_name might return NULL, so we better avoid calling delete in this case.

Re: RFR: 8308144: HttpClient - uncontrolled memory consumption in SSLFlowDelegate.Reader

2023-07-24 Thread Jaikiran Pai
On Fri, 26 May 2023 09:17:41 GMT, zhurs wrote: >> When using HttpClient to make requests to HTTPS resources, there is an issue >> where the entire file is being downloaded into memory without the ability to >> limit the buffer size. >> If the SSLEngine cannot decode the entire buffer due to