Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted

2023-01-27 Thread Alan Bateman
On Thu, 26 Jan 2023 06:46:16 GMT, Glavo wrote: > I checked the `java.base` module, and all the `Collection#toArray()` method > of collections be implemented correctly. > > Their return values can be trusted, so many unnecessary array duplication can > be eliminated. What about Collections.syn

Re: RFR: 8217920: Lookup.defineClass injects a class that can access private members of any class in its own module [v2]

2023-01-27 Thread Alan Bateman
On Thu, 26 Jan 2023 22:27:36 GMT, Mandy Chung wrote: >> Currently, a `Lookup` object with `PACKAGE` access can be used to inject a >> class in the runtime package of the Lookup's lookup class via >> `Lookup::defineClass`. The classes that are injected have the same access >> as other members

Re: [Proposal] Make toLowerCase and toUpperCase based on Locale.ROOT by default

2023-01-27 Thread Alan Bateman
On 27/01/2023 05:42, Glavo wrote: I analyzed the usage of toLowerCase and toUpperCase in OpenJDK more carefully,  and found that none of the use cases really expected locale-sensitive behavior I expected that as there were a number of passes over these use-sites over the years. That said, if

Re: Is ReDos seen as bug/vulnerability?

2023-01-27 Thread Alan Bateman
On 27/01/2023 11:50, David Schumann wrote: Hello, during a PenTest we found a ReDos issue in the JRE which causes Matcher.matches() to go into an endless loop. Is such an issue considered a bug for the JDK team (aka should I file a bug report)? Or is such an issue considered "by design"? Th

Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted [v2]

2023-01-27 Thread Alan Bateman
On Fri, 27 Jan 2023 13:53:45 GMT, Glavo wrote: >> I checked the `java.base` module, and all the `Collection#toArray()` method >> of collections be implemented correctly. >> >> Their return values can be trusted, so many unnecessary array duplication >> can be eliminated. > > Glavo has updated

Re: RFR: 8217920: Lookup.defineClass injects a class that can access private members of any class in its own module [v3]

2023-01-27 Thread Alan Bateman
On Fri, 27 Jan 2023 17:41:43 GMT, Mandy Chung wrote: >> Currently, a `Lookup` object with `PACKAGE` access can be used to inject a >> class in the runtime package of the Lookup's lookup class via >> `Lookup::defineClass`. The classes that are injected have the same access >> as other members

Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted [v2]

2023-01-28 Thread Alan Bateman
On Fri, 27 Jan 2023 21:02:25 GMT, Glavo wrote: > I think this is feasible, but it should be placed in a sub-package in > `jdk.internal`, because some trusted collections are outside `java.util`. The proposals so far in this PR have major security implications. It's not clear to me this is the

Re: Update TestTooManyEntries to run non-manual

2023-01-28 Thread Alan Bateman
On 26/01/2023 18:57, Eirik Bjørsnøs wrote: Hi, This PR updates the test TestTooManyEntries to not create gigabytes of ZIP files, allowing the test to run fast and non-manual: https://github.com/openjdk/jdk/pull/12231 May I please get some help with filing a JBS for this PR? The intention of th

Re: Why does ZipFile.Source.readFullyAt read in chunks?

2023-01-28 Thread Alan Bateman
On 27/01/2023 23:23, Eirik Bjørsnøs wrote: : If this is safe to remove, I'm happy to submit a PR. But code like this is usually there for a reason..? 8k is the threshold at which RAF spills into a temporary malloc'ed buffer for the I/O operation. At some point the RAF implementation will be

Re: RFR: 8301207: (jdeps) Deprecate jdeps -profile option

2023-01-30 Thread Alan Bateman
On Mon, 30 Jan 2023 18:06:12 GMT, Mandy Chung wrote: > jdeps -profile option shows which compact profile of the types that a class > depends on instead. By default jdeps shows the types and their modules that > a class depend on. Compact profiles becomes legacy since Java SE 9 when > modules

Re: RFR: 8301306: java/net/httpclient/* fail with -Xcomp: java.io.IOException: HTTP/1.1 header parser received no bytes

2023-01-30 Thread Alan Bateman
On Mon, 30 Jan 2023 07:16:17 GMT, SUN Guoyun wrote: > Hi all, > I think `BackgroundCompilation` should not be set to false when `-Xcomp` be > used, which causes the java thread to block for longer, then causing the > following tests failed frequently on the AArch64 and LoongArch64 architecture.

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-01-31 Thread Alan Bateman
On Mon, 30 Jan 2023 08:38:15 GMT, Amit Kumar wrote: > m=525312, n=498060, len=524288, eq=false The test doesn't print this so I assume this is tracing that you added in your runs. If I read it correctly, the initial input is len=524288, it deflates to m=525312, then re-inflates to n=498060. So

Re: RFR: 8240567: MethodTooLargeException thrown while creating a jlink image [v14]

2023-01-31 Thread Alan Bateman
On Thu, 26 Jan 2023 19:30:50 GMT, Christoph wrote: > We readded the splitting code and the test is passing. In the test we could > make it work with up to 130 modules where each module _n_ requires all > modules from _0...n_ The patch looks similar to the original. As a quick test, I changed t

Re: RFR: 8300917: Regression 2x and bimodal startup on Mac aarch64 in b27

2023-01-31 Thread Alan Bateman
On Wed, 25 Jan 2023 12:26:26 GMT, Per Minborg wrote: > This PR proposed to reduce contention in synchronized methods mainly by doing > I/O operations outside synch blocks. src/java.base/share/classes/java/lang/Module.java line 318: > 316: } > 317: > 318: private static boolean casEnab

Re: RFR: 8300917: Regression 2x and bimodal startup on Mac aarch64 in b27

2023-01-31 Thread Alan Bateman
On Wed, 25 Jan 2023 12:26:26 GMT, Per Minborg wrote: > This PR proposed to reduce contention in synchronized methods mainly by doing > I/O operations outside synch blocks. BTW: Is this PR meant by openjdk/jdk20 or openjdk/jdk? - PR: https://git.openjdk.org/jdk/pull/12193

Re: RFR: 8301043: Super-interface for PrintStream and PrintWriter [v2]

2023-01-31 Thread Alan Bateman
On Sun, 29 Jan 2023 07:11:26 GMT, Tingjun Yuan wrote: >> Add `java.io.PrintOutput` to represent print operations, and modify >> `java.io.PrintStream` and `java.io.PrintWriter` to implement it. > > Tingjun Yuan has updated the pull request incrementally with one additional > commit since the las

Re: RFR: JDK-8300909: Update com/sun/jndi/dns/Test6991580.java manual test instruction

2023-01-31 Thread Alan Bateman
On Tue, 31 Jan 2023 19:08:08 GMT, Bill Huang wrote: > Test failed for exception in thread "main" java.lang.IllegalAccessError: > class IPv6NameserverPlatformParsingTest (in unnamed module @0x72a8ab1a) > cannot access class com.sun.jndi.dns.DnsContextFactory (in module > jdk.naming.dns) because

Re: RFR: JDK-8300909: Update com/sun/jndi/dns/Test6991580.java manual test instruction [v2]

2023-01-31 Thread Alan Bateman
On Tue, 31 Jan 2023 19:38:22 GMT, Bill Huang wrote: >> Test failed for exception in thread "main" java.lang.IllegalAccessError: >> class IPv6NameserverPlatformParsingTest (in unnamed module @0x72a8ab1a) >> cannot access class com.sun.jndi.dns.DnsContextFactory (in module >> jdk.naming.dns) bec

Re: RFR: 8300917: Regression 2x and bimodal startup on Mac aarch64 in b27

2023-01-31 Thread Alan Bateman
On Wed, 1 Feb 2023 06:17:37 GMT, David Holmes wrote: > I can't quite see the effect of the change here. @minborg Have you used the wrong JBS issue by any chance? There is no information in the JBS issue, or here, that the proposed change fixes the reported startup regression after the JEP 434

Re: RFR: 8301569: list mode of jmod and jimage cannot be used normally in turkish locale

2023-01-31 Thread Alan Bateman
On Sun, 29 Jan 2023 15:37:28 GMT, Glavo wrote: > When the default Locale is `tr`, the jmod and jimage commands have the > following problems: > > * The jmod command does not correctly recognize the `list` mode typed in > lowercase; > * The jimage command cannot obtain the help information of t

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-01-31 Thread Alan Bateman
On Tue, 31 Jan 2023 09:00:18 GMT, Alan Bateman wrote: >> Hi @jaikiran , >> On my system OS's zlib is being used. and here is stack-trace. >> >> --System.out:(2/78)-- >> level:-1, strategy: 0, dowrap: false >> m=525312, n=498060, len=524

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-01 Thread Alan Bateman
On Wed, 1 Feb 2023 08:33:16 GMT, Amit Kumar wrote: > level:1, strategy: 0, dowrap: false > is finished: false Thanks for checking that. So "is finished: false" is telling us that not all of the input was compressed. So I think the right thing is to do the deflate in a loop

Re: RFR: JDK-8284236: Remove java/lang/ref/ReferenceEnqueue.java from ProblemList-Xcomp.txt

2023-02-01 Thread Alan Bateman
On Wed, 1 Feb 2023 19:09:48 GMT, Mandy Chung wrote: > This test failure is no longer reproducible. It was added to the problem > list from JDK-8286368 as a clean up after JEP 425 Virtual Threads > integration. This PR removes it from the problem list. Marked as reviewed by alanb (Reviewer).

Re: RFR: 8301637: ThreadLocalRandom.current().doubles().parallel() contention

2023-02-01 Thread Alan Bateman
On Wed, 1 Feb 2023 15:51:33 GMT, kabutz wrote: > ThreadLocalRandom.current().doubles().parallel() had a bad regression, > because it called the superclass methods of the ThreadLocalRandomProxy's > nextDouble() method instead of delegating to the ThreadLocalRandom.current(). > > Affects all ver

Re: RFR: 8301569: list mode of jmod and jimage cannot be used normally in turkish locale

2023-02-01 Thread Alan Bateman
On Wed, 1 Feb 2023 09:26:17 GMT, Glavo wrote: >> src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java line 1474: >> >>> 1472: String verb = words.get(0); >>> 1473: try { >>> 1474: options.mode = Enum.valueOf(Mode.class, >>> verb.toUpperCase(Locale.ROO

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]

2023-02-01 Thread Alan Bateman
On Wed, 25 Jan 2023 12:12:12 GMT, Ichiroh Takiguchi wrote: > We checked String.getByte()/new > String(...)/Reader/Writer/ByteArrayOutputStream.toString()... Is there good > way to pick up which parts need to be fixed ? I don't think there is so you may have to audit the classes that use Char

Re: RFR: JDK-8300098 : java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java fails with internal timeout when executed with TieredCompilation1/3

2023-02-02 Thread Alan Bateman
On Tue, 31 Jan 2023 10:45:07 GMT, Viktor Klang wrote: > The proposed fix by @DougLea ensures that the state transition into waiting > is retried in the cases where a previous waiter isn't making progress and a > new waiter goes into waiting. Marked as reviewed by alanb (Reviewer). ---

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-02 Thread Alan Bateman
On Wed, 1 Feb 2023 08:46:12 GMT, Alan Bateman wrote: >> Hi Alan, here is output: >> >> level:0, strategy: 2, dowrap: true >>

Re: RFR: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp

2023-02-02 Thread Alan Bateman
On Fri, 3 Feb 2023 03:19:05 GMT, SUN Guoyun wrote: > Hi all, > When `-Xcomp` be used, java thread to block for longer, then causing > StructuredTaskScopeTest.java failed frequently on the AArch64 and LoongArch64 > architecture. > > This PR fix the issue, Please help review it. > > Thanks. te

Re: RFR: 8300235: Use VarHandle access in Image(Input | Output)StreamImpl classes [v4]

2023-02-02 Thread Alan Bateman
On Thu, 2 Feb 2023 19:29:05 GMT, Per Minborg wrote: >> This PR suggests improving performance by using the newly introduced class >> `jdk.internal.util.ByteArray` to improve packing/unpacking operations. >> >> The PR also proposes adding a `ByteArrayLittleEndian` class for support for >> littl

Re: RFR: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp

2023-02-02 Thread Alan Bateman
On Fri, 3 Feb 2023 07:41:24 GMT, SUN Guoyun wrote: >> test/jdk/jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java >> line 617: >> >>> 615: try (var scope = new StructuredTaskScope(null, factory)) { >>> 616: Future future = scope.fork(() -> { >>> 617:

Re: RFR: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp [v2]

2023-02-02 Thread Alan Bateman
On Fri, 3 Feb 2023 07:55:05 GMT, SUN Guoyun wrote: >> Hi all, >> When `-Xcomp` be used, java thread to block for longer, then causing >> StructuredTaskScopeTest.java failed frequently on the AArch64 and >> LoongArch64 architecture. >> >> This PR fix the issue, Please help review it. >> >> Tha

Re: RFR: JDK-8301621: libzip should use pread instead of lseek+read

2023-02-05 Thread Alan Bateman
On Fri, 3 Feb 2023 19:49:44 GMT, Justin King wrote: > Avoid using `lseek` + `read` in favor of `pread`. For Windows, we can do the > same thing by using `OVERLAPPED`, as we are in synchronous mode we can use > `Offset` and `OffsetHigh` to achieve the same thing. > > Additionally I updated open

Re: RFR: 8301834: Templated Buffer classes leave a lot of empty lines in the generated source

2023-02-06 Thread Alan Bateman
On Mon, 6 Feb 2023 06:57:43 GMT, Jaikiran Pai wrote: > Can I please get a review for this change which proposes to fix the issue > noted in https://bugs.openjdk.org/browse/JDK-8301834? > > Some classes in `java.nio` package are generated from template files, during > the build. The template fi

Re: RFR: JDK-8301396: Port fdlibm expm1 to Java [v2]

2023-02-06 Thread Alan Bateman
On Fri, 3 Feb 2023 21:04:15 GMT, Joe Darcy wrote: >> Next on the FDLIBM C -> Java port, expm1. >> Coming soon, hyperbolic transcendentals (sinh, cosh, tanh)! >> >> For expm1, the C vs transliteration port show the usual kind of differences, >> beside formatting of the constants, the use of the

Re: RFR: JDK-8301833: Add manual tests for FDLIBM porting

2023-02-06 Thread Alan Bateman
On Mon, 6 Feb 2023 01:50:55 GMT, Joe Darcy wrote: > To help add assurances that the main-line port of FDLIBM to Java is working > correctly, added some long-running manual tests to probe that the > transliteration port and the corresponding StrictMath method are in agreement > on a large numbe

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-06 Thread Alan Bateman
On Thu, 2 Feb 2023 10:06:23 GMT, Alan Bateman wrote: >>> level:1, strategy: 0, dowrap: false >>> is finished: false >> >> Thanks for checking that. So "is finished: false" is telling us that not all >> of the input was compr

RFR: 8301767: Convert virtual thread tests to JUnit

2023-02-06 Thread Alan Bateman
The non-hotspot tests integrated with JEP 425/428 were mostly TestNG tests. We'd like to convert these JUnit in the main line in advance of other updates to these tests in 21. The changes are mostly mechanical and trivial: - BeforeClass/AfterClass changed to static BeforeAll/AfterAll methods -

Re: RFR: JDK-8301833: Add manual tests for FDLIBM porting

2023-02-06 Thread Alan Bateman
On Mon, 6 Feb 2023 17:53:24 GMT, Joe Darcy wrote: > Therefore, I think these tests should be included in the repository, but not > run all the time, which led me to declare them as a manual jtreg test. - PR: https://git.openjdk.org/jdk/pull/12430

Re: RFR: JDK-8301833: Add manual tests for FDLIBM porting

2023-02-06 Thread Alan Bateman
On Mon, 6 Feb 2023 17:53:24 GMT, Joe Darcy wrote: > Therefore, I think these tests should be included in the repository, but not > run all the time, which led me to declare them as a manual jtreg test. Manual tests are run at each release. There are a couple of examples in the repo with tests

Re: RFR: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp [v2]

2023-02-07 Thread Alan Bateman
On Tue, 7 Feb 2023 08:39:13 GMT, SUN Guoyun wrote: > @DamonFool Could you please sponsor it for me? Note that the problematic sleep in the joinXXX tests will be replaced if [PR 12426](https://github.com/openjdk/jdk/pull/12426) is integrated. - PR: https://git.openjdk.org/jdk/pull/

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v3]

2023-02-07 Thread Alan Bateman
On Tue, 7 Feb 2023 14:39:31 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v4]

2023-02-07 Thread Alan Bateman
On Tue, 7 Feb 2023 15:12:15 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v2]

2023-02-08 Thread Alan Bateman
estNG tests. > - A few of the tests in StructuredTaskScopeTest for joinXXX are changed to > use a CountDownLatch rather than sleeping, as the original tests weren't very > robust. Alan Bateman has updated the pull request with a new target base due to a merge or a reb

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v2]

2023-02-08 Thread Alan Bateman
On Wed, 8 Feb 2023 09:22:36 GMT, Jaikiran Pai wrote: >> test/jdk/java/lang/Thread/BuilderTest.java line 294: >> >>> 292: void testPriority3() { >>> 293: Thread currentThread = Thread.currentThread(); >>> 294: assumeFalse(currentThread.isVirtual(), "Main test is a virtual >>>

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v2]

2023-02-08 Thread Alan Bateman
On Wed, 8 Feb 2023 09:39:37 GMT, Christian Stein wrote: >> test/jdk/java/lang/Thread/virtual/GetStackTrace.java line 31: >> >>> 29: * @enablePreview >>> 30: * @modules java.base/java.lang:+open >>> 31: * @run main GetStackTrace >> >> That's interesting - so this test was marked as a testng t

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v2]

2023-02-08 Thread Alan Bateman
On Wed, 8 Feb 2023 09:49:17 GMT, Jaikiran Pai wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains five commits: >> >> - Merge >> - Merge >> - Fix typos in comments &

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v3]

2023-02-08 Thread Alan Bateman
estNG tests. > - A few of the tests in StructuredTaskScopeTest for joinXXX are changed to > use a CountDownLatch rather than sleeping, as the original tests weren't very > robust. Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v2]

2023-02-08 Thread Alan Bateman
On Wed, 8 Feb 2023 10:37:16 GMT, Jaikiran Pai wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains five commits: >> >> - Merge >> - Merge >> - Fix typos in comments &

Re: RFR: 8300139 : [AIX] Use pthreads to avoid JNI_createVM call from primordial thread

2023-02-08 Thread Alan Bateman
On Tue, 31 Jan 2023 05:24:35 GMT, Varada M wrote: > 1. test/jdk/jni/nullCaller/NullCallerTest.java > 2. test/jdk/java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java > 3. test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java > > The above tests were blocked on AIX [@require

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v4]

2023-02-08 Thread Alan Bateman
estNG tests. > - A few of the tests in StructuredTaskScopeTest for joinXXX are changed to > use a CountDownLatch rather than sleeping, as the original tests weren't very > robust. Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:

Re: RFR: 8301767: Convert virtual thread tests to JUnit [v2]

2023-02-08 Thread Alan Bateman
On Wed, 8 Feb 2023 09:39:21 GMT, Jaikiran Pai wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains five commits: >> >> - Merge >> - Merge >> - Fix typos in comments &

Integrated: 8301767: Convert virtual thread tests to JUnit

2023-02-08 Thread Alan Bateman
On Sat, 4 Feb 2023 08:59:29 GMT, Alan Bateman wrote: > The non-hotspot tests integrated with JEP 425/428 were mostly TestNG tests. > We'd like to convert these JUnit in the main line in advance of other updates > to these tests in 21. The changes are mostly mechanic

Re: RFR: 8301578: Perform output outside synchronization in Module.class [v4]

2023-02-09 Thread Alan Bateman
On Thu, 9 Feb 2023 15:05:13 GMT, Per Minborg wrote: >> This PR proposed to reduce contention in synchronized methods mainly by >> doing I/O operations outside synch blocks. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Us

Re: RFR: 6595142: (spec) ByteArrayInputStream treats bytes, not characters

2023-02-09 Thread Alan Bateman
On Fri, 10 Feb 2023 02:11:35 GMT, Brian Burkhalter wrote: > Replace the two occurrences of `character` with `byte`. Looks okay, I assume you've done a wider search to see if there are any more. - Marked as reviewed by alanb (Reviewer). PR: https://git.openjdk.org/jdk/pull/12505

Re: RFR: 8301578: Perform output outside synchronization in Module.class [v6]

2023-02-10 Thread Alan Bateman
On Thu, 9 Feb 2023 16:46:08 GMT, Per Minborg wrote: >> This PR proposed to reduce contention in synchronized methods mainly by >> doing I/O operations outside synch blocks. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Un

Re: RFR: 8301578: Perform output outside synchronization in Module.class [v4]

2023-02-10 Thread Alan Bateman
On Thu, 9 Feb 2023 16:27:34 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/lang/Module.java line 120: >> >>> 118: // memory semantics that preserves ordering and visibility across >>> threads. >>> 119: // >>> 120: // Used reflectively via Unsafe >> >> I assume L119-120

Re: RFR: 8301578: Perform output outside synchronization in Module.class [v7]

2023-02-10 Thread Alan Bateman
On Fri, 10 Feb 2023 09:11:22 GMT, Per Minborg wrote: >> This PR proposed to reduce contention in synchronized methods mainly by >> doing I/O operations outside synch blocks. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > R

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v6]

2023-02-10 Thread Alan Bateman
On Tue, 7 Feb 2023 16:40:06 GMT, Brian Burkhalter wrote: >> `java.io.InputStream::transferTo` could conceivably return a negative value >> if the count of bytes transferred overflows a `long`. Modify the method to >> limit the number of bytes transferred to `Long.MAX_VALUE` per invocation. > >

Re: RFR: 8298619: java/io/File/GetXSpace.java is failing

2023-02-10 Thread Alan Bateman
On Fri, 3 Feb 2023 02:02:39 GMT, Brian Burkhalter wrote: > Modify the `Space` instances used for size comparison to be created with > total number of bytes derived from the Windows `diskFree` utility instead of > Cygwin’s `df`. test/jdk/java/io/File/GetXSpace.java line 152: > 150: } > 151

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v9]

2023-02-10 Thread Alan Bateman
On Wed, 8 Feb 2023 10:53:22 GMT, Claes Redestad wrote: >> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to >> copy arrays more efficiently when exactly the whole input array is to be >> copied. This helps eliminate range checks and has been verified to help >> vario

Re: RFR: 6595142: (spec) ByteArrayInputStream treats bytes, not characters [v2]

2023-02-10 Thread Alan Bateman
On Fri, 10 Feb 2023 16:48:08 GMT, Brian Burkhalter wrote: >> Replace the two occurrences of `character` with `byte`. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 6595142: Refer to bytes, not characters in BufferedInp

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-02-10 Thread Alan Bateman
On Fri, 10 Feb 2023 17:38:51 GMT, Brian Burkhalter wrote: >> `java.io.InputStream::transferTo` could conceivably return a negative value >> if the count of bytes transferred overflows a `long`. Modify the method to >> limit the number of bytes transferred to `Long.MAX_VALUE` per invocation. > >

Re: RFR: JDK-8301833: Add wide-ranging tests for FDLIBM porting [v3]

2023-02-12 Thread Alan Bateman
On Sat, 11 Feb 2023 03:04:51 GMT, Joe Darcy wrote: >> To help add assurances that the main-line port of FDLIBM to Java is working >> correctly, added some long-running manual tests to probe that the >> transliteration port and the corresponding StrictMath method are in >> agreement on a large

Re: RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]

2023-02-12 Thread Alan Bateman
On Sun, 22 Jan 2023 23:17:10 GMT, Ichiroh Takiguchi wrote: >> On jdk17, following testcase works fine on Linux platform. >> >> Testcase >> >> $ cat cstest1.java >> import java.nio.charset.*; >> >> public class cstest1 { >> public static void main(String[] args) throws Exception { >> Cha

Re: RFR: 8298619: java/io/File/GetXSpace.java is failing

2023-02-12 Thread Alan Bateman
On Fri, 10 Feb 2023 17:10:46 GMT, Brian Burkhalter wrote: > Another possibility would be to add a native method to the test itself to > invoke > [GetDiskSpaceInformationW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskspaceinformationw) > to obtain the value of

Re: RFR: 8301627: System.exit and Runtime.exit debug logging

2023-02-12 Thread Alan Bateman
On Fri, 10 Feb 2023 20:33:39 GMT, Roger Riggs wrote: > It can be difficult to find the cause of calls to > `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java > runtime exits. > The status value and stack trace are logged using the System Logger named > `java.lang.Runti

Re: RFR: 8301627: System.exit and Runtime.exit debug logging

2023-02-12 Thread Alan Bateman
On Fri, 10 Feb 2023 20:33:39 GMT, Roger Riggs wrote: > It can be difficult to find the cause of calls to > `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java > runtime exits. > The status value and stack trace are logged using the System Logger named > `java.lang.Runti

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v10]

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 09:59:52 GMT, Claes Redestad wrote: >> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to >> copy arrays more efficiently when exactly the whole input array is to be >> copied. This helps eliminate range checks and has been verified to help >> vari

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. src/java.base/share/classes/java/lang/String.java line 2272: > 2270:

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch [v2]

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 16:10:14 GMT, Claes Redestad wrote: >> We can improve various String methods such as `startsWith`, `endsWith` and >> `regionMatches` by leveraging the intrinsified mismatch methods in >> `ArraysSupport`. > > Claes Redestad has updated the pull request incrementally with one

Re: RFR: 8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 16:57:17 GMT, Severin Gehwolf wrote: > The `jimage` location attributes are terminated with `ATTRIBUTE_END`-kinds. > However, > the byte containing `ATTRIBUTE_END` (most significant 5 bits, represent > `kind`), might > be non-zero in the lower 3 bits (values up to `0x07` rep

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v2]

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 10:57:35 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/java/lang/Shutdown.java line 162: >> >>> 160: * If the system logger {@code java.lang.Runtime} is enabled for >>> logging level DEBUG/FINE >>> 161: * the stack trace of the call to {@code Runtime.exit

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp

2023-02-14 Thread Alan Bateman
On Mon, 13 Feb 2023 14:12:15 GMT, Severin Gehwolf wrote: > Could I please get a review of this trivial comment-only change? > `imageFile.hpp` > describes some properties of the jimage file `lib/modules`. However, I don't > think > the comment example matches current code in the JDK. > [`ATTRIB

Re: RFR: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields

2023-02-14 Thread Alan Bateman
On Mon, 13 Feb 2023 19:35:52 GMT, Mandy Chung wrote: > I overlooked in the fix for JDK-8297757 that it should have passed the > declaring class of the static fields rather than the reference class passed > to `Lookup::findStaticVarHandle`. Looks right and you've added good test coverage. test

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp [v2]

2023-02-14 Thread Alan Bateman
On Tue, 14 Feb 2023 10:40:31 GMT, Alan Bateman wrote: >> Severin Gehwolf has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contain

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-14 Thread Alan Bateman
On Tue, 7 Feb 2023 07:07:54 GMT, Alan Bateman wrote: >>> Hi @AlanBateman , >>> with latest changes (doing inflate/deinflate) test passes over s390 and x86 >>> as well. Please take a look now. >> >> Good. One thing to try is to just deflate/infl

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-15 Thread Alan Bateman
On Wed, 15 Feb 2023 02:25:00 GMT, Amit Kumar wrote: > After reverting all of my changes, I applied your patch and I got time limit > error, probably because of some inf-loop ? > > ``` > result: Error. Agent error: java.lang.Exception: Agent 2 timed out with a > timeout of 480 seconds; check co

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v5]

2023-02-16 Thread Alan Bateman
On Thu, 16 Feb 2023 21:53:00 GMT, Roger Riggs wrote: >> It can be difficult to find the cause of calls to >> `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java >> runtime exits. >> The status value and stack trace are logged using the System Logger named >> `java.lang.

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-17 Thread Alan Bateman
On Thu, 16 Feb 2023 05:32:26 GMT, Amit Kumar wrote: > As you can see, the size of out1 is insufficient for the s390x. That's why I > proposed the fix to increase the buffer size. Because the compressor is not > deterministic, I don't want to be byte-perfect, so I changed the multiplier > to `6

Re: RFR: 8302664: Fix several incorrect usages of Preconditions.checkFromIndexSize

2023-02-17 Thread Alan Bateman
On Thu, 16 Feb 2023 14:42:52 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which fixes the usage of > `Preconditions.checkFromIndexSize`? This addresses > https://bugs.openjdk.org/browse/JDK-8302664. > > There was an oversight when these changes were introduced in > http

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v6]

2023-02-17 Thread Alan Bateman
On Fri, 17 Feb 2023 17:27:50 GMT, Roger Riggs wrote: >> It can be difficult to find the cause of calls to >> `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java >> runtime exits. >> The status value and stack trace are logged using the System Logger named >> `java.lang.

Re: RFR: 8302806: (fs) Remove unused enum sun.nio.file.SensitivityWatchEventModifier

2023-02-18 Thread Alan Bateman
On Sat, 18 Feb 2023 00:11:29 GMT, Brian Burkhalter wrote: > This enum is not used in the JDK and did not appear in external source code > searches. This API should probably have been deprecated many releases ago. It's the jdk.unsupported module so it may be possible to remove without first de

Re: RFR: 8302315: Examine cost of clone of primitive arrays compared to arraycopy

2023-02-18 Thread Alan Bateman
On Fri, 17 Feb 2023 09:58:54 GMT, Claes Redestad wrote: > During work on #12453 @schlosna reported that `array.clone()` might > underperform `System.arraycopy` in microbenchmarks and I opted to go with > `arraycopy` throughout while investigating. > > Testing on x86 (SandyBridge, AVX2) I obser

Re: RFR: 8302815 Use new Math.clamp method in core libraries [v2]

2023-02-19 Thread Alan Bateman
On Sat, 18 Feb 2023 21:40:08 GMT, Tagir F. Valeev wrote: > Revert changes in JrtPath, as it seems to be compiled with bootstrap JDK Yes, the jrt file system provider is compiled --release 8 to create lib/jrt-fs.jar. That's the plumbing needed to allow IDEs/tools running on JDK 8 access the con

Re: RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded [v2]

2023-02-20 Thread Alan Bateman
On Mon, 20 Feb 2023 09:34:17 GMT, David Holmes wrote: > You can't introduce a new public API and then blame people for using it! If > the API is really only intended to support the internal implementation of a > language feature than make it private and don't export it. There are a number of A

Re: RFR: 8302863: Speed up String::encodeASCII using countPositives

2023-02-20 Thread Alan Bateman
On Sat, 18 Feb 2023 23:26:08 GMT, Claes Redestad wrote: > When encoding Strings to US-ASCII we can speed up the happy path > significantly by using `StringCoding.countPositives` as a speculative check > for whether there are any chars that needs to be replaced by `'?'`. Once a > non-ASCII char

Re: RFR: 8302815 Use new Math.clamp method in core libraries [v2]

2023-02-20 Thread Alan Bateman
On Sat, 18 Feb 2023 21:40:08 GMT, Tagir F. Valeev wrote: >> For cleanup and dogfooding the new method, it would be nice to use >> Math.clamp where possible in java.base. See PR #12428. >> >> As Math.clamp performs an additional check that min is not greater than max, >> I conservatively replac

RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Alan Bateman
Executors.newSingleThreadExecutor returns a delegating ExecutorService that has finalizer to shutdown the underlying TPE when the wrapper is finalizable. It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer in java.base. Removing it will likely lead to bug reports/complain

Re: RFR: 8302871: Speed up StringLatin1.regionMatchesCI [v7]

2023-02-21 Thread Alan Bateman
On Tue, 21 Feb 2023 11:14:13 GMT, Eirik Bjorsnos wrote: >> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying >> 'the oldest ASCII trick in the book'. >> >> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two >> latin1 bytes for equality ignoring

Re: RFR: 8302822: Method/Field/Constructor/RecordComponent::getGenericInfo() is not thread safe

2023-02-21 Thread Alan Bateman
On Mon, 20 Feb 2023 22:26:21 GMT, David Holmes wrote: > I would also be concerned about the guarantee of idempotency from the factory > method - I hope its requirements in that area are clearly documented. The spec for the getGenericXXX methods are "Return a" rather than "Return the" so there

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Alan Bateman
On Tue, 21 Feb 2023 15:45:17 GMT, Viktor Klang wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v2]

2023-02-21 Thread Alan Bateman
bug reports/complaints as the > current behavior goes back to 2006. So the proposal is to just replace it > with a Cleaner, trivially done in this case. As part of the changes, I've > replaced the existing test with a more modern test that exercises more > scenarios. Alan

Re: RFR: 8302791: Add specific ClassLoader object to Proxy IllegalArgumentException message

2023-02-21 Thread Alan Bateman
On Sun, 19 Feb 2023 08:28:37 GMT, Ravali Yatham wrote: > Added specific class loader object to proxy IllegalArgumentException from > which the class was not visible > > The bug report for the same: https://bugs.openjdk.org/browse/JDK-8302791 src/java.base/share/classes/java/lang/reflect/Proxy.

Re: RFR: 8301119: Support for GB18030-2022

2023-02-22 Thread Alan Bateman
On Fri, 10 Feb 2023 20:35:58 GMT, Naoto Sato wrote: > Upgrading the GB18030 charset in the JDK to the latest 2022 standard. Since > this is not a compatible upgrade to the existing mapping, a new system > property `jdk.charset.GB18030` is introduced. If it is set to "2000", the > mapping falls

Re: RFR: 8301119: Support for GB18030-2022

2023-02-22 Thread Alan Bateman
On Wed, 22 Feb 2023 10:46:10 GMT, Sean Coffey wrote: > curious - what scenario triggers this call at initLevel < 1 ? It's not supported, but it is possible that someone might run with -Dfile.encoding=GB18030, in which case the default charset is used before the system properties are initialize

Re: RFR: 8301119: Support for GB18030-2022

2023-02-22 Thread Alan Bateman
On Fri, 10 Feb 2023 20:35:58 GMT, Naoto Sato wrote: > Upgrading the GB18030 charset in the JDK to the latest 2022 standard. Since > this is not a compatible upgrade to the existing mapping, a new system > property `jdk.charset.GB18030` is introduced. If it is set to "2000", the > mapping falls

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
On Tue, 21 Feb 2023 19:38:08 GMT, Brent Christian wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contai

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
bug reports/complaints as the > current behavior goes back to 2006. So the proposal is to just replace it > with a Cleaner, trivially done in this case. As part of the changes, I've > replaced the existing test with a more modern test that exercises more > scenarios. Alan

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
On Wed, 22 Feb 2023 17:20:21 GMT, Daniel Fuchs wrote: > Hmmm... so now shutdown no longer requires permission. You should probably > call super.shutdown() before invoking cleaner.clean(), assuming that > shutdown() can be called twice. You could modify the cleanup action to only > call shutdow

<    2   3   4   5   6   7   8   9   10   11   >