RFR: 8278185: Custom JRE cannot find non-ASCII named module inside
Could you review this fix? Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE. Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value. Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice. ------------- Commit messages: - 8278185: Custom JRE cannot find non-ASCII named module inside Changes: https://git.openjdk.java.net/jdk/pull/6693/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6693&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8278185 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/6693.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6693/head:pull/6693 PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 07:29:17 GMT, Toshio Nakamura <tnakamura@openjdk.org> wrote:
Could you review this fix?
Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE.
Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value.
Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice.
Change looks reasonable. A regression test should be provided. Contact me directly for advice. ------------- Changes requested by jlaskey (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 12:35:22 GMT, Jim Laskey <jlaskey@openjdk.org> wrote:
Toshio Nakamura has updated the pull request incrementally with one additional commit since the last revision:
Changed testcase name to JImageNonAsciiNameTest.java
Change looks reasonable. A regression test should be provided. Contact me directly for advice.
Sure, I can. But I would like @JimLaskey to have a final look at it. ------------- PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 12:35:22 GMT, Jim Laskey <jlaskey@openjdk.org> wrote:
Toshio Nakamura has updated the pull request incrementally with one additional commit since the last revision:
Changed testcase name to JImageNonAsciiNameTest.java
Change looks reasonable. A regression test should be provided. Contact me directly for advice.
Sure, I can. But I would like @JimLaskey to have a final look at it.
Standing by ------------- PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 07:29:17 GMT, Toshio Nakamura <tnakamura@openjdk.org> wrote:
Could you review this fix?
Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE.
Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value.
Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice.
Yes, I think we would be good to have a test. If it's too hard using the tools then a test that uses the image reader API directly would be okay. @naotoj may have some suggestions too. ------------- PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 07:29:17 GMT, Toshio Nakamura <tnakamura@openjdk.org> wrote:
Could you review this fix?
Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE.
Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value.
Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice.
Regression tests for `ResourceBundle` class have tests that dynamically generate modules. Although I have not used non-ASCII module names, tests under `test/jdk/java/util/ResourceBundle/modules` may shed some light on the subject. ------------- PR: https://git.openjdk.java.net/jdk/pull/6693
Could you review this fix?
Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE.
Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value.
Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice.
Toshio Nakamura has updated the pull request incrementally with one additional commit since the last revision: Added a testcase ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/6693/files - new: https://git.openjdk.java.net/jdk/pull/6693/files/6c73d436..9f689aae Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6693&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6693&range=00-01 Stats: 90 lines in 2 files changed: 90 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/6693.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6693/head:pull/6693 PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 07:29:17 GMT, Toshio Nakamura <tnakamura@openjdk.org> wrote:
Could you review this fix?
Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE.
Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value.
Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice.
Thank you so much for the valuable advices, Jim, Alan, and Naoto. The created test calls `ImageStringsReader.stringFromByteBufferMatches()` directly. It's a package private method, and I tried to use library style. The upper public method, `BasicImageReader.match()`, is hard to prepare data. Calling jlink is also complex for me. So, I choose this way. ------------- PR: https://git.openjdk.java.net/jdk/pull/6693
On Fri, 3 Dec 2021 07:29:17 GMT, Toshio Nakamura <tnakamura@openjdk.org> wrote:
Could you review this fix?
Problem: Custom JRE generated by jlink cannot find non-ASCII named modules included inside the JRE.
Cause and fix: If module or package name was composed by ASCII then non-ASCII characters, ImageStringsReader:stringFromByteBufferMatches() miscalculated the length of matched string. The first part of ASCII characters was missing. This patch corrected the value.
Testing: tier1 and tier2 on Linux have no regression. I wasn't able to create an automate test for this issue. I appreciate any advice.
This pull request has now been integrated. Changeset: fcd67a52 Author: Toshio Nakamura <tnakamura@openjdk.org> Committer: Naoto Sato <naoto@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/fcd67a5242b7db06e4cb06b574972a463b20... Stats: 99 lines in 2 files changed: 98 ins; 0 del; 1 mod 8278185: Custom JRE cannot find non-ASCII named module inside Reviewed-by: naoto ------------- PR: https://git.openjdk.java.net/jdk/pull/6693
participants (4)
-
Alan Bateman
-
Jim Laskey
-
Naoto Sato
-
Toshio Nakamura