From brent.christian at oracle.com Thu Aug 1 00:33:04 2019 From: brent.christian at oracle.com (Brent Christian) Date: Wed, 31 Jul 2019 17:33:04 -0700 Subject: The final optimized version of Dual-Pivot Quicksort (ver.19.1) In-Reply-To: References: <1560893862.105095134@f487.i.mail.ru> <5ab79374-a561-de15-6a35-0dde138fdcb9@oracle.com> Message-ID: Thanks, Laurent. I can sponsor this fix, get a RFR thread going for JDK-8226297, keep webrevs updated as the review progresses, etc. However I've uncovered an issue with the fix that should be resolved before proceeding. Specifically, the new Arrays.COMMON_PARALLELISM static constant causes exceptions at startup under some circumstances: * running with LANG=C on Linux[1] * setting a property value with non-Ascii characters on Mac[2] java.util.Arrays is used a fair bit for String handling (java.lang.StringCoding, java.langStringLatin1, etc). The problem is that early in startup, depending on the locale/language setup and/or property settings, java.util.Arrays can be called during initialization of system properties. During Arrays., COMMON_PARALLELISM is setup with a call to ForkJoinPool.getCommonPoolParallelism(). ForkJoinPool sets up some VarHandles, VarHandles leads to MethodHandleStatics., which reads some system properties. But we're still initializing the system properties - 'props' is null, so NPE. I think Arrays.java needs to remove the COMMON_PARALLELISM constant, and go back to making calls to ForkJoinPool.getCommonPoolParallelism(). I can do the update and post an updated webrev (unless further discussion is needed). Thanks, -Brent 1. FWIW, additional JNU_CHECK_EXCEPTION_RETURN calls were needed to produce this stack trace: Error occurred during initialization of VM java.lang.ExceptionInInitializerError at java.lang.invoke.VarHandle.(java.base/VarHandle.java:2052) at java.lang.invoke.VarHandles.makeFieldHandle(java.base/VarHandles.java:71) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandleCommon(java.base/MethodHandles.java:3147) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandle(java.base/MethodHandles.java:3107) at java.lang.invoke.MethodHandles$Lookup.findVarHandle(java.base/MethodHandles.java:2229) at java.util.concurrent.ForkJoinPool.(java.base/ForkJoinPool.java:3184) at java.util.Arrays.(java.base/Arrays.java:436) at java.lang.StringLatin1.newString(java.base/StringLatin1.java:767) at java.lang.StringBuilder.toString(java.base/StringBuilder.java:446) at sun.nio.cs.StandardCharsets.toLower(java.base/StandardCharsets.java:1284) at sun.nio.cs.StandardCharsets.lookup(java.base/StandardCharsets.java:1304) at sun.nio.cs.StandardCharsets.charsetForName(java.base/StandardCharsets.java:1338) at java.nio.charset.Charset.lookup2(java.base/Charset.java:471) at java.nio.charset.Charset.lookup(java.base/Charset.java:460) at java.nio.charset.Charset.isSupported(java.base/Charset.java:501) at jdk.internal.util.SystemProps$Raw.platformProperties(java.base/Native Method) at jdk.internal.util.SystemProps$Raw.(java.base/SystemProps.java:233) at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:54) at java.lang.System.initPhase1(java.base/System.java:2001) Caused by: java.lang.NullPointerException at java.lang.invoke.MethodHandleStatics.(java.base/MethodHandleStatics.java:62) at java.lang.invoke.VarHandle.(java.base/VarHandle.java:2052) at java.lang.invoke.VarHandles.makeFieldHandle(java.base/VarHandles.java:71) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandleCommon(java.base/MethodHandles.java:3147) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandle(java.base/MethodHandles.java:3107) at java.lang.invoke.MethodHandles$Lookup.findVarHandle(java.base/MethodHandles.java:2229) at java.util.concurrent.ForkJoinPool.(java.base/ForkJoinPool.java:3184) at java.util.Arrays.(java.base/Arrays.java:436) at java.lang.StringLatin1.newString(java.base/StringLatin1.java:767) at java.lang.StringBuilder.toString(java.base/StringBuilder.java:446) at sun.nio.cs.StandardCharsets.toLower(java.base/StandardCharsets.java:1284) at sun.nio.cs.StandardCharsets.lookup(java.base/StandardCharsets.java:1304) at sun.nio.cs.StandardCharsets.charsetForName(java.base/StandardCharsets.java:1338) at java.nio.charset.Charset.lookup2(java.base/Charset.java:471) at java.nio.charset.Charset.lookup(java.base/Charset.java:460) at java.nio.charset.Charset.isSupported(java.base/Charset.java:501) at jdk.internal.util.SystemProps$Raw.platformProperties(java.base/Native Method) at jdk.internal.util.SystemProps$Raw.(java.base/SystemProps.java:233) at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:54) at java.lang.System.initPhase1(java.base/System.java:2001) 2. I tried setting java.io.tmpdir to include a non-ascii character (e.g. ? ): Error occurred during initialization of VM java.lang.ExceptionInInitializerError at java.lang.invoke.VarHandle.(java.base/VarHandle.java:2052) at java.lang.invoke.VarHandles.makeFieldHandle(java.base/VarHandles.java:71) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandleCommon(java.base/MethodHandles.java:3140) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandle(java.base/MethodHandles.java:3100) at java.lang.invoke.MethodHandles$Lookup.findVarHandle(java.base/MethodHandles.java:2222) at java.util.concurrent.ForkJoinPool.(java.base/ForkJoinPool.java:3184) at java.util.Arrays.(java.base/Arrays.java:389) at java.lang.StringCoding.decodeUTF8_0(java.base/StringCoding.java:747) at java.lang.StringCoding.decodeUTF8(java.base/StringCoding.java:712) at java.lang.StringCoding.decode(java.base/StringCoding.java:231) at java.lang.String.(java.base/String.java:483) at java.lang.String.(java.base/String.java:553) at jdk.internal.util.SystemProps$Raw.vmProperties(java.base/Native Method) at jdk.internal.util.SystemProps$Raw.cmdProperties(java.base/SystemProps.java:253) at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:55) at java.lang.System.initPhase1(java.base/System.java:2001) Caused by: java.lang.NullPointerException at java.lang.invoke.MethodHandleStatics.(java.base/MethodHandleStatics.java:62) at java.lang.invoke.VarHandle.(java.base/VarHandle.java:2052) at java.lang.invoke.VarHandles.makeFieldHandle(java.base/VarHandles.java:71) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandleCommon(java.base/MethodHandles.java:3140) at java.lang.invoke.MethodHandles$Lookup.getFieldVarHandle(java.base/MethodHandles.java:3100) at java.lang.invoke.MethodHandles$Lookup.findVarHandle(java.base/MethodHandles.java:2222) at java.util.concurrent.ForkJoinPool.(java.base/ForkJoinPool.java:3184) at java.util.Arrays.(java.base/Arrays.java:389) at java.lang.StringCoding.decodeUTF8_0(java.base/StringCoding.java:747) at java.lang.StringCoding.decodeUTF8(java.base/StringCoding.java:712) at java.lang.StringCoding.decode(java.base/StringCoding.java:231) at java.lang.String.(java.base/String.java:483) at java.lang.String.(java.base/String.java:553) at jdk.internal.util.SystemProps$Raw.vmProperties(java.base/Native Method) at jdk.internal.util.SystemProps$Raw.cmdProperties(java.base/SystemProps.java:253) at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:55) at java.lang.System.initPhase1(java.base/System.java:2001) On 7/26/19 1:14 AM, Laurent Bourg?s wrote: > Hi all, > > I updated the DPQS patch thanks to latest release from Vladimir (Pi?ces > jointes2019.07.25): > http://cr.openjdk.java.net/~lbourges/dpqs/dpqs-8226297/dpqs-8226297.1/ > > " > Updated version of Arrays and DualPivotQuicksort files, the summary of > changes: > > 1. Corrected minimal threshold for parallelism argument (0 -> 1) > 2. Added constant for common parallelism > 3. Updated byte / char / short counting sort. > " > > Incremental patch change: > http://cr.openjdk.java.net/~lbourges/dpqs/dpqs-8226297/diff_dpqs_1_vs_0.log > > Cheers, > Laurent > > > Le?mer. 17 juil. 2019 ??17:12, Laurent Bourg?s > > a ?crit?: > > Hi, > > I integrated locally the complete DPQS 19.2 patch from Vladimir > Yaroslavskiy with up-to-date jdk14 (client) repository: > build OK and jtreg passed OK (java/util/Arrays). > > Here is the corresponding webrev for review: > http://cr.openjdk.java.net/~lbourges/dpqs/dpqs-8226297/webrev/ > > Cheers, > Laurent > From naoto.sato at oracle.com Thu Aug 1 00:57:51 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Wed, 31 Jul 2019 17:57:51 -0700 Subject: [14] RFR: 8215181: Accounting currency format support Message-ID: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> Hi, Please review the fix to the following issue: https://bugs.openjdk.java.net/browse/JDK-8215181 The proposed changeset is located at: https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ This is to enable "accounting" style currency formatting (negative values in parentheses) with CLDR. Naoto From dmitry.chuyko at bell-sw.com Thu Aug 1 04:09:30 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Thu, 1 Aug 2019 07:09:30 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> Message-ID: <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> Hi Andrew, Just a small comment about the tests. As you can see, some of tests in jdk/java/nio/channels/FileChannel check various modes, arguments, and expected exceptions. E.g. see MapTest, Mode and Args. I noticed that in your changes for the new map mode there are new exceptions thrown in different situations. For example, when the required mode is not supported, or it does not fit. In particular, this should happen correctly on systems that do not support nvram. Have you considered the possibility of extending or adding tests for this behavior? -Dmitry On 7/31/19 1:55 PM, Andrew Dinn wrote: > Hi Aleksey > > On 30/07/2019 17:00, Aleksey Shipilev wrote: >> On 7/30/19 5:04 PM, Andrew Dinn wrote: >> ........................... > Sure, welcome to the party even if most of the booze has been drunk :-) > > Thank you for a very thorough review. Comments (mostly in agreement) are > inline below. They include a few refusals and a walk past some of the > jumps pending confirmation they truly form part of the obstacle course. > > A new webrev against the latest jdk/jdk dev tree including all > uncontested changes is here: > > http://cr.openjdk.java.net/~adinn/8224974/webrev.10/ > >> === General:.................................. From ivan.gerasimov at oracle.com Thu Aug 1 04:21:31 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 31 Jul 2019 21:21:31 -0700 Subject: RFR (XS) 8228352 : CANON_EQ breaks when pattern contains supplementary codepoint Message-ID: Hello! Pattern.compile fails with IOOB when normalizing a pattern that contains a surrogate pair. Would you please help review a trivial 1-line fix? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8228352 WEBREV: http://cr.openjdk.java.net/~igerasim/8228352/00/webrev/ -- With kind regards, Ivan Gerasimov From bourges.laurent at gmail.com Thu Aug 1 06:22:54 2019 From: bourges.laurent at gmail.com (=?UTF-8?Q?Laurent_Bourg=C3=A8s?=) Date: Thu, 1 Aug 2019 08:22:54 +0200 Subject: The final optimized version of Dual-Pivot Quicksort (ver.19.1) In-Reply-To: References: <1560893862.105095134@f487.i.mail.ru> <5ab79374-a561-de15-6a35-0dde138fdcb9@oracle.com> Message-ID: Hi Brent, Le jeu. 1 ao?t 2019 ? 02:32, Brent Christian a ?crit : > Thanks, Laurent. I can sponsor this fix, get a RFR thread going for > JDK-8226297, keep webrevs updated as the review progresses, etc. > Excellent, I will let you and Vladimir work on this review. FYI I have implemented DPQS (int[] ) sorting 2 arrays (values + indices) in the Marlin renderer. It could be generalized to any array type and having the index array is very important in many algorithms... > However I've uncovered an issue with the fix that should be resolved > before proceeding. > > Specifically, the new Arrays.COMMON_PARALLELISM static constant causes > exceptions at startup under some circumstances: > * running with LANG=C on Linux[1] > * setting a property value with non-Ascii characters on Mac[2] > > java.util.Arrays is used a fair bit for String handling > (java.lang.StringCoding, java.langStringLatin1, etc). The problem is > that early in startup, depending on the locale/language setup and/or > property settings, java.util.Arrays can be called during initialization > of system properties. > > During Arrays., COMMON_PARALLELISM is setup with a call to > ForkJoinPool.getCommonPoolParallelism(). ForkJoinPool sets up > some VarHandles, VarHandles leads to > MethodHandleStatics., which reads some system properties. But > we're still initializing the system properties - 'props' is null, so NPE. > Chicken-egg problem. Maybe this field could be wrapped in a getter doing lazy resolution... > I think Arrays.java needs to remove the COMMON_PARALLELISM constant, and > go back to making calls to ForkJoinPool.getCommonPoolParallelism(). > I do not know why Vladimir changed that recently. Any good reason ? > I can do the update and post an updated webrev (unless further > discussion is needed). > PS: I can help on benchmarking as I developped a fair sort benchmark based on JMH: https://github.com/bourgesl/nearly-optimal-mergesort-code JMH test code: https://github.com/bourgesl/nearly-optimal-mergesort-code/tree/master/sort-bench/src/main/java/edu/sorting/bench I would be interested by improving the perf test code and possibly integrate it in OpenJDK JMH test suite... (later) > Goodbye & good luck, Laurent From vlv.spb.ru at mail.ru Thu Aug 1 09:21:35 2019 From: vlv.spb.ru at mail.ru (=?UTF-8?B?VmxhZGltaXIgWWFyb3NsYXZza2l5?=) Date: Thu, 01 Aug 2019 12:21:35 +0300 Subject: =?UTF-8?B?UmVbMl06IFRoZSBmaW5hbCBvcHRpbWl6ZWQgdmVyc2lvbiBvZiBEdWFsLVBp?= =?UTF-8?B?dm90IFF1aWNrc29ydCAodmVyLjE5LjEp?= In-Reply-To: References: <1560893862.105095134@f487.i.mail.ru> Message-ID: <1564651295.280359324@f407.i.mail.ru> Hi Brent, see my comments inline: >???????, 1 ??????? 2019, 9:23 +03:00 ?? Laurent Bourg?s : > >Hi Brent, > >Le jeu. 1 ao?t 2019 ? 02:32, Brent Christian < brent.christian at oracle.com > a ?crit?: >>Thanks, Laurent.? I can sponsor this fix, get a RFR thread going for >>JDK-8226297, keep webrevs updated as the review progresses, etc. Thank you for review! > >Excellent, I will let you and Vladimir work on this review.? > >FYI I have implemented DPQS (int[] ) sorting 2 arrays (values + indices) in the Marlin renderer. It could be generalized to any array type and having the index array is very important in many algorithms...? > >> >>However I've uncovered an issue with the fix that should be resolved >>before proceeding. >> >>Specifically, the new Arrays.COMMON_PARALLELISM static constant causes >>exceptions at startup under some circumstances: >>? ? ?* running with LANG=C on Linux[1] >>? ? ?* setting a property value with non-Ascii characters on Mac[2] >> >>java.util.Arrays is used a fair bit for String handling >>(java.lang.StringCoding, java.langStringLatin1, etc).? The problem is >>that early in startup, depending on the locale/language setup and/or >>property settings, java.util.Arrays can be called during initialization >>of system properties. >> >>During Arrays., COMMON_PARALLELISM is setup with a call to >>ForkJoinPool.getCommonPoolParallelism().? ForkJoinPool sets up >>some VarHandles, VarHandles leads to >>MethodHandleStatics., which reads some system properties.? But >>we're still initializing the system properties - 'props' is null, so NPE. > >Chicken-egg problem. Maybe this field could be wrapped in a getter doing lazy resolution... >> >>I think Arrays.java needs to remove the COMMON_PARALLELISM constant, and >>go back to making calls to ForkJoinPool.getCommonPoolParallelism(). > >I do not know why Vladimir changed that recently. Any good reason ? >> >>I can do the update and post an updated webrev (unless further >>discussion is needed). Yes, please, remove?COMMON_PARALLELISM constant and replace by call ForkJoinPool.getCommonPoolParallelism(). in parallelSort() methods. Please, go ahead and update webrev with corrected Arrays.java >> >PS: I can help on benchmarking as I developed a fair sort benchmark based on JMH: >https://github.com/bourgesl/nearly-optimal-mergesort-code > >JMH test code: >https://github.com/bourgesl/nearly-optimal-mergesort-code/tree/master/sort-bench/src/main/java/edu/sorting/bench >I would be interested by improving the perf test code and possibly integrate it in OpenJDK JMH test suite... (later) > >Goodbye & good luck, >Laurent -- Vladimir Yaroslavskiy From adinn at redhat.com Thu Aug 1 09:49:08 2019 From: adinn at redhat.com (Andrew Dinn) Date: Thu, 1 Aug 2019 10:49:08 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> Message-ID: Hello Dmitry, On 01/08/2019 05:09, Dmitry Chuyko wrote: > Just a small comment about the tests. As you can see, some of tests in > jdk/java/nio/channels/FileChannel check various modes, arguments, and > expected exceptions. E.g. see MapTest, Mode and Args. > > I noticed that in your changes for the new map mode there are new > exceptions thrown in different situations. For example, when the > required mode is not supported, or it does not fit. In particular, this > should happen correctly on systems that do not support nvram. Have you > considered the possibility of extending or adding tests for this behavior? I agree that these failure cases need better test coverage and automation. However, that is not to say they have not been tested. All current success and failure cases can be exercised by the current mmap test (PmemTest) if run in the correct circumstance. Unfortunately, automatic testing is not straightforward. 1) On x86_64 where MAP_SYNC is supported test PMemTest includes instructions to exercise a successful map from a real or emulated DAX file system. It can also be used (and has been used) to exercise the IOException failure path in the case where the file it tries to open belongs to a non-DAX file system (see line 99). Note that testing for success or failure cannot be done automatically using the test as it currently stands. Testing for a successful map requires mounting a real or emulated DAX file system at a known mount point and creating a writable dir to hold the mapped file. Testing for the IOException failure requires either setting up an equivalent non-DAX file system mount or editing the test to open the file in a non-DAX file system dir like, say, /tmp. A new, separate test for the IOException failure could be automated on x86_64 by trying to map a file located in /tmp (on the assumption that /tmp is not mounted as a DAX file system). Of course, at present this will only give the IOException result when MAP_SYNC is supported. Given a suitably old Linux/x86_64, UnsupportedOperationException could also be thrown. 2) On AArch64 where MAP_SYNC is not currently supported PmemTest clearly cannot be used to exercise the success path. However, it can be used (and has been used) to exercise the UnsupportedOperationException failure path. A check for the UnsupportedOperationException failure could be automated on AArch64 by a new test as described above. Of course, once MAP_SYNC support arrives in a new Linux/AArch64 it would also become for IOException to be thrown. So, to sum up, it would be possible to add a new, automatic test that checks for one or other failure occurring. I am happy to add such a test to the next webrev. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From shade at redhat.com Thu Aug 1 11:16:05 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Thu, 1 Aug 2019 13:16:05 +0200 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> Message-ID: <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> On 7/31/19 12:55 PM, Andrew Dinn wrote: >> So if pre wbsync is no-op, why do we need to handle it everywhere? We seem to be falling through all >> the way to the stub to do nothing there, maybe we should instead cut much earlier, e.g. when >> inlining Unsafe.writeBackPresync0? Would it be better to not emit CacheWBPreSync at all? > > The pre sync is definitely not needed at present. However, I put it > there because I didn't know for sure if some future port of this > capability (e.g. to ppc) might need to sync prior writes before writing > back cache lines. [Indeed, the old Intel documentation stated that > pre-sync was needed on x86 for clflush to be safe but it is definitely > not needed.] I am more concerned that the writeback call enters the pre sync stub unnecessarily. I had the idea to do this more efficiently, and simplify code at the same time: how about emitting CacheWBPreSync nodes, but emitting nothing for them in .ad matchers? That would leave generic code generic, and architectures would then be able to avoid the stub altogether for pre sync code. This would simplify current stub generators too, I think: you don't need to pass arguments to them. This leaves calling via Unsafe. I believe pulling up the isPre choice to the stub generation time would be beneficial. That is, generate *two* stubs: StubRoutines::data_cache_writeback_pre_sync() and StubRoutines::data_cache_writeback_post_sync(). If arch does not need the pre_sync, generate nop version of pre_sync(). This is not a strong requirement from my side. I do believe it would make code a bit more straight-forward. >> === src/hotspot/cpu/x86/assembler_x86.cpp >> >> It feels like these comments are redundant, especially L8630 and L8646 which mention magic values >> "6" and "7", not present in the code: ... > 8624 // 0x66 is instruction prefix > > 8627 // 0x0f 0xAE is opcode family > > 8630 // rdi == 7 is extended opcode byte > . . . > > Given that the code is simply stuffing numbers (whether supplied as > literals or as symbolic constants) into a byte stream I think these > comments are a help when it comes to cross-checking each specific > assembly against the corresponding numbers declared in the Intel > manuals. So, I don't really want to remove them. Would you prefer me to > reverse the wording as above? I was merely commenting on the style: the rest of the file does not have comments like that. The positions of prefixes, opcode families, etc is kinda implied by the code shape. >> === src/hotspot/cpu/x86/macroAssembler_x86.cpp > // prefer clwb (potentially parallel writeback without evict) > // otherwise prefer clflushopt (potentially parallel writeback > // with evict) > // otherwise fallback on clflush (serial writeback with evict) > > In the second case the comment is redundant because the need for an > sfence is covered by the existing comment inside the if: > > // need an sfence for post flush when using clflushopt or clwb > // otherwise no no need for any synchroniaztion Yes, this would be good to add. >> === src/hotspot/cpu/x86/stubGenerator_x86_64.cpp >> >> Is it really "cmpl" here, not "cmpb"? I think aarch64 code tests for byte. >> >> 2942 __ cmpl(is_pre, 0); > > This is a Java boolean input. I believe that means the value will be > loaded into c_arg0 as an int so this test ought to be adequate. Okay. >> === src/hotspot/share/opto/c2compiler.cpp >> >> Why inject new cases here, instead of at the end of switch? Saves sudden "break": >> >> 578 break; >> 579 case vmIntrinsics::_writeback0: >> 580 if (!Matcher::match_rule_supported(Op_CacheWB)) return false; >> 581 break; >> 582 case vmIntrinsics::_writebackPreSync0: >> 583 if (!Matcher::match_rule_supported(Op_CacheWBPreSync)) return false; >> 584 break; >> 585 case vmIntrinsics::_writebackPostSync0: >> 586 if (!Matcher::match_rule_supported(Op_CacheWBPostSync)) return false; >> 587 break; > > I placed them here so they were close to the other Unsafe intrinsics. In > particular they precede _allocateInstance, an ordering which is also the > case in the declarations in vmSymbols.hpp. > > In what sense do you mean that an extra 'break' is saved? That would be > true as regards the textual layout. It wouldn't affect the logic of > folding different ranges of values into branching range tests (which is > only determined by the numeric values of the intrinsics). If you are > concerned about the former then I would argue that placing the values in > declaration order seems to me to be the more important concern. I don't think we have to follow whatever ordering mess in vmSymbols.hpp. New code cuts into the last case block in that switch, which is mostly about "we know about these symbols, they are falling-through to the break". Adding cases with Matcher::match_rule_supported seems odd there. If anything, those new cases should be moved upwards to other cases, e.g. after vmIntrinsics::_minD. >> === src/hotspot/share/prims/unsafe.cpp >> >> Do we really need this function pointer mess? >> >> 457 void (*wb)(void *); >> 458 void *a = addr_from_java(line); >> 459 wb = (void (*)(void *)) StubRoutines::data_cache_writeback(); >> 460 assert(wb != NULL, "generate writeback stub!"); >> 461 (*wb)(a); >> >> Seems easier to: >> >> assert(StubRoutines::data_cache_writeback() != NULL, "sanity"); >> StubRoutines::data_cache_writeback()(addr_from_java(line)); > Hmm, "that whole brevity thing" again? Well, I guess you must now call > me "El Duderino". Well, that is, like, your opinion, man. C++ is messy if we allow it to be! > Are you sure that all the compilers used to build openJDK will happily > eat the second line of your replacement? If you can guarantee that I'll > happily remove the type declarations. I think they do: there are uses like that in the same file already, for example: if (StubRoutines::unsafe_arraycopy() != NULL) { StubRoutines::UnsafeArrayCopy_stub()(src, dst, sz); } else { Copy::conjoint_memory_atomic(src, dst, sz); } -Aleksey From adinn at redhat.com Thu Aug 1 11:48:37 2019 From: adinn at redhat.com (Andrew Dinn) Date: Thu, 1 Aug 2019 12:48:37 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> Message-ID: <04ac9cb2-4d7b-d316-9031-b4ce68c3b58e@redhat.com> Hi Boris, On 31/07/2019 13:01, Boris Ulasevich wrote: > I did a quick check of the change across our platforms. Arm32 and x86_64 > built successfully. But I see it fails due to minor issues on aarch64 > and x86_32 with webrev.09. > Can you please have a look at this? > >> src/hotspot/cpu/aarch64/aarch64.ad:2202:1: error: expected ?;? before > ?}? token >> src/hotspot/cpu/x86/macroAssembler_x86.cpp:9925: undefined reference > to `Assembler::clflush(Address)' The AArch64 error was simply a missing semi-colon. With that corrected AArch64 now builds and runs as expected (i.e. it fails the PMem support test with an UnsupportedOperationException). The second error is happening because the calling method MacroAssembler::cache_wb has not been guarded with #ifdef _LP64 (the same applies for MacroAssembler::cache_wbsync). Note that cache line writeback via Unsafe.writeBackMemory is only expected to work on Intel x86_64 so these two methods only get called from x86_64-specific code (x86_64.ad and stuGenerator_x86_64.cpp). So, the solution to this specific problem is to add #ifdef _LP64 around the declaration and implementation of these two methods. At the same time it would be helpful to remove the redundant #ifdef _LP64/#endif that I for some strange reason inserted around the definitions, but not the declarations, of clflushopt and clwb (that didn't help when I was trying to work out what was going wrong). However, a related problem also needs fixing. The Java code for method Unsafe.writebackMemory only proceeds when the data cache line writeback unit size (value of field UnsafeConstants.DATA_CACHE_LINE_FLUSH_SIZE) is non-zero. Otherwise it throws an exception. On x86_32 that field /must/ be zero. The native methods which Unsafe calls out to and the intrinsics which replace the native calls are not implemented on x86_32. The field from which the value of the Java constant is derived is currently initialised using CPU-specific information in vm_version_x86.cpp as follows if (os::supports_map_sync()) { // publish data cache line flush size to generic field, otherwise // let if default to zero thereby disabling writeback _data_cache_line_flush_size = _cpuid_info.std_cpuid1_ebx.bits.clflush_size * 8; } i.e. writeback is enabled on x86 when the operating is known to be capable of supporting MAP_SYNC. os_linux.cpp returns true for that call, irrespective of whether this is 32 or 64 bit linux. The rationale is that any Linux is capable of supporting map_sync (by contrast Windows, Solaris, AIX etc currently return false). So, the above assignment also needs to be guarded by #ifdef _LP64 in order to ensure that writeback is never attempted on x86_32. Thank you for spotting these errors. I will add the relevant fixes to the next patch and add you as a reviewer. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From thejasvi.v.voniadka at oracle.com Thu Aug 1 13:42:08 2019 From: thejasvi.v.voniadka at oracle.com (Thejasvi Voniadka) Date: Thu, 1 Aug 2019 06:42:08 -0700 (PDT) Subject: RFR: 8158880: test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale Message-ID: Hi, Request you to please review this change. JBS: https://bugs.openjdk.java.net/browse/JDK-8158880 (test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale) Description: The test " test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java# test_appendZoneText_parseGenericTimeZonePatterns" fails if run on certain locales (such as "ja"). At present the test does not enforce a specific locale for the DateTimeFormatter, and hence the machine's locale is used as the default. This could cause parsing mismatches when run on non-US locales. The fix is to set the locale explicitly in the test. Webrev: http://cr.openjdk.java.net/~vagarwal/8158880/webrev.0 From naoto.sato at oracle.com Thu Aug 1 16:13:19 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Thu, 1 Aug 2019 09:13:19 -0700 Subject: RFR: 8158880: test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale In-Reply-To: References: Message-ID: Looks good to me, Thejasvi. Naoto On 8/1/19 6:42 AM, Thejasvi Voniadka wrote: > Hi, > > Request you to please review this change. > > JBS: https://bugs.openjdk.java.net/browse/JDK-8158880 (test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale) > > Description: The test " test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java# test_appendZoneText_parseGenericTimeZonePatterns" fails if run on certain locales (such as "ja"). At present the test does not enforce a specific locale for the DateTimeFormatter, and hence the machine's locale is used as the default. This could cause parsing mismatches when run on non-US locales. The fix is to set the locale explicitly in the test. > > Webrev: http://cr.openjdk.java.net/~vagarwal/8158880/webrev.0 > > > From naoto.sato at oracle.com Thu Aug 1 17:02:31 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Thu, 1 Aug 2019 10:02:31 -0700 Subject: RFR (XS) 8228352 : CANON_EQ breaks when pattern contains supplementary codepoint In-Reply-To: References: Message-ID: <0e4bd953-7435-120d-adfe-956fc3b837e4@oracle.com> Hi Ivan, The change looks good to me. Naoto On 7/31/19 9:21 PM, Ivan Gerasimov wrote: > Hello! > > Pattern.compile fails with IOOB when normalizing a pattern that contains > a surrogate pair. > > Would you please help review a trivial 1-line fix? > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8228352 > WEBREV: http://cr.openjdk.java.net/~igerasim/8228352/00/webrev/ > From rafael.wth at gmail.com Thu Aug 1 18:42:32 2019 From: rafael.wth at gmail.com (Rafael Winterhalter) Date: Thu, 1 Aug 2019 20:42:32 +0200 Subject: RFC 8228988: Handle annotation values with incompatible runtime type Message-ID: Hello, I tried to fix a bug in AnnotationParser that throws a NullPointerException if an annotation enum property was refactored to an enumeration type or vice versa but retained its old name. There is currently no check if an annotation property is consistent with the runtime type, only the existance of the type is validated which causes this null pointer. I struggled to write a test for Jtreg as this requires quite a lot of setup but I hope that it is quite straight-forward to see from the changed code segments that the validation is missing. Nevertheless, I am not sure if this is the exception that would be expected from such a scenario. Here is the diff file inlined: Index: src/java.base/share/classes/sun/reflect/annotation/AnnotationParser.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/java.base/share/classes/sun/reflect/annotation/AnnotationParser.java (revision 55752:8ae33203d600a7c9f9b2be9b31a0eb8197270ab1) +++ src/java.base/share/classes/sun/reflect/annotation/AnnotationParser.java (revision 55752+:8ae33203d600+) @@ -358,6 +358,9 @@ result = parseConst(tag, buf, constPool); } + if (result == null) + result = new AnnotationTypeMismatchExceptionProxy( + memberType.getClass().getName()); if (!(result instanceof ExceptionProxy) && !memberType.isInstance(result)) result = new AnnotationTypeMismatchExceptionProxy( @@ -470,7 +473,10 @@ int constNameIndex = buf.getShort() & 0xFFFF; String constName = constPool.getUTF8At(constNameIndex); - if (!typeName.endsWith(";")) { + if (!enumType.isEnum()) + return new AnnotationTypeMismatchExceptionProxy( + typeName + "." + constName); + else if (!typeName.endsWith(";")) { // support now-obsolete early jsr175-format class files. if (!enumType.getName().equals(typeName)) return new AnnotationTypeMismatchExceptionProxy( From roger.riggs at oracle.com Thu Aug 1 21:40:19 2019 From: roger.riggs at oracle.com (Roger Riggs) Date: Thu, 1 Aug 2019 14:40:19 -0700 Subject: JDK 14 RFR of JDK-8202385: Annotation to mark serial-related fields and methods In-Reply-To: <69ac9d9d-0fb8-5483-760c-97b3e6495539@oracle.com> References: <83681e03-589b-b033-f0a1-75bfa3bb4114@oracle.com> <69ac9d9d-0fb8-5483-760c-97b3e6495539@oracle.com> Message-ID: Hi Joe, It would be good to more closely define the semantics of the @Serial annotation. Suggestion for the first sentence: "@Serial annotates each field or method specified by the Java Object Serialization Specification of a {@linkplain Serializable serializable} class." This annotation type is intended to allow compile-time checking of serialization-related declarations, analogous to the checking enabled by the {@link java.lang.Override} annotation type to validate method overriding. It would be useful to describe that reflection is used to access and use the fields and methods and they may? otherwise appear to be unused. A recommendation could be added in an @impleNote to apply @Serial to each serialization defined method or field. $02, Roger On 7/13/19 1:16 PM, Joe Darcy wrote: > PS I've uploaded an updated an iteration of the webrev > > http://cr.openjdk.java.net/~darcy/8202385.4/ > > to address. the syntactic concerns previously raised. I added > > ??? ...defined by the? Java Object Serialization > Specification... > > which is the current name of the document and is similar to the style > of reference made in java.io.Serializable. Offhand, I didn't know of > the correct idiom to refer to the document as a working hyperlink, but > would be switch to that idiom. > > Cheers, > > -Joe > > On 7/12/2019 8:19 PM, Joe Darcy wrote: >> Hi Roger, >> >> On 7/12/2019 1:31 PM, Roger Riggs wrote: >>> Hi Joe, >>> >>> As an annotation on a field or method, this is a use site annotation. >> >> >> It is an annotation intended for the declarations of fields and >> methods of Serializable types. >> >> >>> From the description, the checks that could be added would only be done >>> if the annotation was present and the annotation is a tag for existing >>> fields and methods that are part of the serialization spec. >> >> >> Right; the annotation is semantically only applicable to the fields >> and methods associated with the serialization system. >> >> >>> >>> The signatures of the fields and methods can be known to the >>> compiler independent >>> of the annotation and produce the same warnings. >>> So this looks like a case of trying to have belt and suspenders. >>> >>> If the checks are not done when the annotation is not present, then >>> it will still be >>> the case that incorrect or misused fields and methods will still >>> escape detection. >>> >>> Though the details of the compiler check are outside of the scope of >>> this annotation, >>> it seems unclear whether the annotation is necessary. >> >> I have a prototype annotation processor to implement checks for >> >> ??? JDK-8202056: Expand serial warning to check for bad overloads of >> serial-related methods and ineffectual fields >> >> The current version of the processor does not assume the presence of >> java.io.Serial. The summarize the existing checking methodology: >> >> ??? If a type is Serialiazable and a field or method has a name >> matching the names of one of the special fields or methods to >> serialization, check that the field or method has the required >> modifiers, type, and, the the case of methods, parameter types and >> exception types. >> >> That is all well and good and represents a large fraction of the >> checking of interest. However, it does not catch a mis-declaration >> like "readobject" instead of "readObject". One could argue that >> sufficiently thorough testing should catch that kind of error; >> however, my impression is that thoroughness of testing is rare in >> practice. I don't think it would be reasonable for javac to have some >> kind of Hamming distance >> (https://en.wikipedia.org/wiki/Hamming_distance) check between the >> name of fields/methods and the name of the serialization related >> fields methods to try to catch such mis-declarations. An annotation >> like java.io.Serial is intended to allow the programmer to indicate >> "yes, this is supposed to be one of the serialization related fields >> or methods" and enable the compile to perform checks against that >> category of error. >> >> >>> >>> Can the name of the annotation be more descriptive? >>> Just "Serial" seems a bit too simple and does not have a strong >>> binding to the Serialization classes and specification. >>> Alternatives: >>> ?? SerialMetadata >>> ?? SerialControl >>> ?? SerialFunction >> >> From the earlier design iterations "Serial" was chosen to be >> evocative of the "@serial" javadoc tag. >> >> Thanks, >> >> -Joe >> >>> >>> >>> 39:? There should be a reference to the serialization specification >>> for the definition >>> of the fields and methods to make it clear where the authoritative >>> identification is spec'd. >>> >>> 73-75:? Please align the
    and
tags on separate lines with >>> matching indentation. >>> >>> 77: Extra leading space. >>> >>> Regards, Roger >>> >>> On 7/9/19 7:14 PM, Joe Darcy wrote: >>>> Hello, >>>> >>>> Returning to some old work [1], please review the addition of a >>>> java.io.Serial annotation type for JDK 14 to mark serial-related >>>> fields and methods: >>>> >>>> ??? webrev: http://cr.openjdk.java.net/~darcy/8202385.3/ >>>> ??? CSR: https://bugs.openjdk.java.net/browse/JDK-8217698 >>>> >>>> Thanks, >>>> >>>> -Joe >>>> >>>> [1] Previous review threads: >>>> >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-May/053055.html >>>> >>>> >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054801.html >>>> >>>> >>> From ivan.gerasimov at oracle.com Fri Aug 2 00:51:49 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 1 Aug 2019 17:51:49 -0700 Subject: RFR (XS) 8228352 : CANON_EQ breaks when pattern contains supplementary codepoint In-Reply-To: <0e4bd953-7435-120d-adfe-956fc3b837e4@oracle.com> References: <0e4bd953-7435-120d-adfe-956fc3b837e4@oracle.com> Message-ID: Thank you Naoto for the review! With kind regards, Ivan On 8/1/19 10:02 AM, naoto.sato at oracle.com wrote: > Hi Ivan, > > The change looks good to me. > > Naoto > > On 7/31/19 9:21 PM, Ivan Gerasimov wrote: >> Hello! >> >> Pattern.compile fails with IOOB when normalizing a pattern that >> contains a surrogate pair. >> >> Would you please help review a trivial 1-line fix? >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8228352 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8228352/00/webrev/ >> > -- With kind regards, Ivan Gerasimov From joel.borggren.franck at gmail.com Fri Aug 2 08:00:41 2019 From: joel.borggren.franck at gmail.com (=?UTF-8?Q?Joel_Borggr=C3=A9n=2DFranck?=) Date: Fri, 2 Aug 2019 10:00:41 +0200 Subject: 8202469 / 8202473: Correct type annotation resolution for class type variables In-Reply-To: References: Message-ID: Hi Rafael Thanks for looking into this. Can you separate the two fixes into two different patches? The tests should be moved to java/lang/annotation/typeAnnotations/... . Nit, copyright year is wrong. I can host webrevs for you on cr to make it easier for other reviewers, if you also send me the patches or webrefs off-list to get around the attachment stripping I can upload them to cr. cheers /Joel On Tue, Jul 23, 2019 at 8:51 PM Rafael Winterhalter wrote: > I integrated the tests into the jtreg bits (to me it looks like they are > running ok but since this is my first time, please double-check). > > I have already signed the OCA a few years ago when I did some work on > Glassfish. Let me know if anything else is missing or if I need to do > anything else. > > Here comes the inline changeset including the additional jtreg tests: > > Index: > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationParameterizedNonInterfaceBound.java > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =================================================================== > --- > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationParameterizedNonInterfaceBound.java > (revision 55752+:8ae33203d600+) > +++ > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationParameterizedNonInterfaceBound.java > (revision 55752+:8ae33203d600+) > @@ -0,0 +1,52 @@ > +/* > + * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 only, as > + * published by the Free Software Foundation. > + * > + * This code is distributed in the hope that it will be useful, but > WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > + * version 2 for more details (a copy is included in the LICENSE file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public License > version > + * 2 along with this work; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > + * or visit www.oracle.com if you need additional information or have any > + * questions. > + */ > + > +/* > + * @test > + * @bug 8202473 > + * @summary Make sure a type variable bound on a parameterized > non-interface bound does not receive a type path offset > + */ > + > +import java.lang.annotation.Target; > +import java.lang.annotation.*; > +import java.lang.reflect.AnnotatedType; > +import java.lang.reflect.TypeVariable; > +import java.util.ArrayList; > + > +public class TestTypeAnnotationParameterizedNonInterfaceBound @TestTypeAnnotationParameterizedNonInterfaceBound.TypeAnnotation > ArrayList> { > + > + public static void main(String[] args) { > + TypeVariable[] variables = > TestTypeAnnotationParameterizedNonInterfaceBound.class.getTypeParameters(); > + TypeVariable variable = variables[0]; > + AnnotatedType[] bounds = variable.getAnnotatedBounds(); > + AnnotatedType bound = bounds[0]; > + Annotation[] annotations = bound.getAnnotations(); > + if (annotations.length != 1) { > + throw new AssertionError(); > + } > + } > + > + @Retention(RetentionPolicy.RUNTIME) > + @Target(ElementType.TYPE_USE) > + @interface TypeAnnotation { } > +} > Index: > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationTwoVariables.java > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =================================================================== > --- > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationTwoVariables.java > (revision 55752+:8ae33203d600+) > +++ > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationTwoVariables.java > (revision 55752+:8ae33203d600+) > @@ -0,0 +1,61 @@ > +/* > + * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 only, as > + * published by the Free Software Foundation. > + * > + * This code is distributed in the hope that it will be useful, but > WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > + * version 2 for more details (a copy is included in the LICENSE file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public License > version > + * 2 along with this work; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > + * or visit www.oracle.com if you need additional information or have any > + * questions. > + */ > + > +/* > + * @test > + * @bug 8202473 > + * @summary Make sure a type path for a type variable's bound is filtered > by variable index > + */ > + > +import java.lang.annotation.Target; > +import java.lang.annotation.*; > +import java.lang.reflect.AnnotatedParameterizedType; > +import java.lang.reflect.AnnotatedType; > +import java.lang.reflect.TypeVariable; > +import java.util.concurrent.Callable; > + > +public class TestTypeAnnotationTwoVariables< > + U extends > Callable<@TestTypeAnnotationTwoVariables.TypeAnnotation(0) ?>, > + V extends > Callable<@TestTypeAnnotationTwoVariables.TypeAnnotation(1) ?>> { > + > + public static void main(String[] args) { > + TypeVariable[] variables = > TestTypeAnnotationTwoVariables.class.getTypeParameters(); > + for (int i = 0; i < 2; i++) { > + TypeVariable variable = variables[i]; > + AnnotatedType[] bounds = variable.getAnnotatedBounds(); > + AnnotatedType bound = bounds[0]; > + AnnotatedParameterizedType parameterizedType = > (AnnotatedParameterizedType) bound; > + AnnotatedType[] actualTypeArguments = > parameterizedType.getAnnotatedActualTypeArguments(); > + Annotation[] annotations = > actualTypeArguments[0].getAnnotations(); > + if (annotations.length != 1 || ((TypeAnnotation) > annotations[0]).value() != i) { > + throw new AssertionError(); > + } > + } > + } > + > + @Retention(RetentionPolicy.RUNTIME) > + @Target(ElementType.TYPE_USE) > + @interface TypeAnnotation { > + int value(); > + } > +} > Index: > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationTypeVariableBound.java > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =================================================================== > --- > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationTypeVariableBound.java > (revision 55752+:8ae33203d600+) > +++ > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationTypeVariableBound.java > (revision 55752+:8ae33203d600+) > @@ -0,0 +1,51 @@ > +/* > + * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 only, as > + * published by the Free Software Foundation. > + * > + * This code is distributed in the hope that it will be useful, but > WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > + * version 2 for more details (a copy is included in the LICENSE file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public License > version > + * 2 along with this work; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > + * or visit www.oracle.com if you need additional information or have any > + * questions. > + */ > + > +/* > + * @test > + * @bug 8202469 > + * @summary Make sure a type variable that has another type variable as > its bound receives the correct type annotation > + */ > + > +import java.lang.annotation.Target; > +import java.lang.annotation.*; > +import java.lang.reflect.AnnotatedType; > +import java.lang.reflect.TypeVariable; > + > +public class TestTypeAnnotationTypeVariableBound @TestTypeAnnotationTypeVariableBound.TypeAnnotation U> { > + > + public static void main(String[] args) { > + TypeVariable[] variables = > TestTypeAnnotationTypeVariableBound.class.getTypeParameters(); > + TypeVariable variable = variables[1]; > + AnnotatedType[] bounds = variable.getAnnotatedBounds(); > + AnnotatedType bound = bounds[0]; > + Annotation[] annotations = bound.getAnnotations(); > + if (annotations.length != 1) { > + throw new AssertionError(); > + } > + } > + > + @Retention(RetentionPolicy.RUNTIME) > + @Target(ElementType.TYPE_USE) > + @interface TypeAnnotation { } > +} > Index: > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationUnionBound.java > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =================================================================== > --- > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationUnionBound.java > (revision 55752+:8ae33203d600+) > +++ > > test/jdk/java/lang/reflect/AnnotatedElement/TestTypeAnnotationUnionBound.java > (revision 55752+:8ae33203d600+) > @@ -0,0 +1,64 @@ > +/* > + * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 only, as > + * published by the Free Software Foundation. > + * > + * This code is distributed in the hope that it will be useful, but > WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > + * version 2 for more details (a copy is included in the LICENSE file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public License > version > + * 2 along with this work; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > + * or visit www.oracle.com if you need additional information or have any > + * questions. > + */ > + > +/* > + * @test > + * @bug 8202473 > + * @summary Make sure that the union bounds of a type variable receive the > correct type annotations > + */ > + > +import java.lang.annotation.Target; > +import java.lang.annotation.*; > +import java.lang.reflect.AnnotatedParameterizedType; > +import java.lang.reflect.AnnotatedType; > +import java.lang.reflect.TypeVariable; > +import java.util.List; > +import java.util.concurrent.Callable; > + > +public class TestTypeAnnotationUnionBound< > + U extends Callable<@TestTypeAnnotationUnionBound.TypeAnnotation(0) > ?> & List<@TestTypeAnnotationUnionBound.TypeAnnotation(1) ?>> { > + > + public static void main(String[] args) { > + TypeVariable[] variables = > TestTypeAnnotationUnionBound.class.getTypeParameters(); > + TypeVariable variable = variables[0]; > + if (variable.getAnnotations().length > 0) { > + throw new AssertionError(); > + } > + AnnotatedType[] bounds = variable.getAnnotatedBounds(); > + for (int i = 0; i < 2; i++) { > + AnnotatedType bound = bounds[i]; > + AnnotatedParameterizedType parameterizedType = > (AnnotatedParameterizedType) bound; > + AnnotatedType[] actualTypeArguments = > parameterizedType.getAnnotatedActualTypeArguments(); > + Annotation[] annotations = > actualTypeArguments[0].getAnnotations(); > + if (annotations.length != 1 || ((TypeAnnotation) > annotations[0]).value() != i) { > + throw new AssertionError(); > + } > + } > + } > + > + @Retention(RetentionPolicy.RUNTIME) > + @Target(ElementType.TYPE_USE) > + @interface TypeAnnotation { > + int value(); > + } > +} > Index: > > src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =================================================================== > --- > > src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java > (revision 55752:8ae33203d600a7c9f9b2be9b31a0eb8197270ab1) > +++ > > src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java > (revision 55752+:8ae33203d600+) > @@ -276,11 +276,21 @@ > // index 1. > if (bounds.length > 0) { > Type b0 = bounds[0]; > - if (!(b0 instanceof Class)) { > - startIndex = 1; > - } else { > - Class c = (Class)b0; > - if (c.isInterface()) { > + if (!(b0 instanceof TypeVariable)) { > + if (b0 instanceof Class) { > + Class c = (Class) b0; > + if (c.isInterface()) { > + startIndex = 1; > + } > + } else if (b0 instanceof ParameterizedType) { > + ParameterizedType p = (ParameterizedType) b0; > + Type r = p.getRawType(); > + if (!(r instanceof Class)) { > + throw new AnnotationFormatError("Unexpected > raw type: " + r); > + } else if (((Class) r).isInterface()) { > + startIndex = 1; > + } > + } else { > startIndex = 1; > } > } > @@ -295,10 +305,11 @@ > l.add(t); > } > } > + TypeAnnotation[] annon = > l.toArray(EMPTY_TYPE_ANNOTATION_ARRAY); > res[i] = > AnnotatedTypeFactory.buildAnnotatedType(bounds[i], > AnnotatedTypeFactory.nestingForType(bounds[i], > loc), > - l.toArray(EMPTY_TYPE_ANNOTATION_ARRAY), > - candidates.toArray(EMPTY_TYPE_ANNOTATION_ARRAY), > + annon, > + annon, > (AnnotatedElement)decl); > } > return res; > From 2217232293 at qq.com Sun Aug 4 17:12:37 2019 From: 2217232293 at qq.com (=?gb18030?B?zrTAtNH0ueI=?=) Date: Mon, 5 Aug 2019 01:12:37 +0800 Subject: help to become a auther Message-ID: Hi, all. I wana to commit to Core Libraries module. And I found a bug in this module. But I don?t have a jdk account to create a issue at https://bugs.openjdk.java.net. I had send a OCA to oracle-ca_us at oracle.com, what do I need to do next? thanks very match. My Info UserName: lamber-ken E-mail : 2217232293 at qq.com Tel : +8619941866946 Regards, lamber-ken From christoph.langer at sap.com Mon Aug 5 08:23:16 2019 From: christoph.langer at sap.com (Langer, Christoph) Date: Mon, 5 Aug 2019 08:23:16 +0000 Subject: RFR 8213031: (zipfs) Add support for POSIX file permissions In-Reply-To: References: <953449f0913340f6a94ae3d83611fd92@sap.com> <9b3c9cfe-63e9-94ea-1af0-7ba9e2db52fd@oracle.com> <62a26037-a991-dc31-a972-a82386f63b92@oracle.com> <9806f4b1-9b55-d1d8-4511-5db0ef6786a5@oracle.com> <33E52896-E491-4660-A932-46D5A270A63E@oracle.com> <458d4ce8-d669-3117-908d-687dae2ad8d2@oracle.com> Message-ID: Hi, the changeset for the zipfs POSIX permissions support seems to be ready now. I've spent some iterations with Lance to finalize it, mainly some formal things and additions/cleanups to the test. I've got reviews now from both, Alan and Lance. So, that's the last call for review/feedback/objections from anybody else. If I don't get further feedback I'm going to push this within the next 2-3 days: http://cr.openjdk.java.net/~clanger/webrevs/8213031.17/ Thank you, Christoph From: Langer, Christoph Sent: Mittwoch, 5. Juni 2019 16:45 To: Alan Bateman ; Lance Andersen Cc: nio-dev ; Java Core Libs Subject: RE: RFR 8213031: (zipfs) Add support for POSIX file permissions Hi Lance, Alan, et al., as it seems we are getting close to CSR approval, the changeset should also be finally reviewed. Here is the most current version: http://cr.openjdk.java.net/~clanger/webrevs/8213031.14/ I have made some updates to ZipConstants as suggested by Lance in a private mail. Best regards Christoph From ramanand.patil at oracle.com Mon Aug 5 08:27:49 2019 From: ramanand.patil at oracle.com (Ramanand Patil) Date: Mon, 5 Aug 2019 01:27:49 -0700 (PDT) Subject: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b Message-ID: <0230ff0a-9f4b-4a59-b1e4-3eb76be23df9@default> Hi all, Please review the patch for tzdata2019b integration into jdk project(jdk-14). Webrev: http://cr.openjdk.java.net/~rpatil/8228469/14/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 Summary: - This patch uses "vanguard" format tzdata from IANA (instead of rearguard format), as the enhancement bug[1] is fixed now. Many thanks to Naoto for this. - As per the latest changes to Palestine zone rules, the hard-coded checks for "Asia/Gaza" and "Asia/Hebron" are no more needed in ZoneInfoFile.java. Because of those checks test/jdk/sun/util/calendar/zi/TestZoneInfo310.java was failing as mentioned in the bug comment[3]. - test/jdk/java/util/TimeZone/TimeZoneTest.java is updated to set ZoneDescriptor.daylight value to "false" for BET zone id. - The patch has passed all the related testing including JCK. Notes: - As per the mail from tzdata maintainers[2] there is a possibility that Brazil might not abolish DST. - Since the enhancement bug[1] is not fixed in update releases, jdk13u will still use the rearguard format tzdata. A separate review request will be sent for the same. [1] https://bugs.openjdk.java.net/browse/JDK-8212970 [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html [3] https://bugs.openjdk.java.net/browse/JDK-8228469?focusedCommentId=14281498&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14281498 Regards, Ramanand. From naoto.sato at oracle.com Mon Aug 5 19:54:51 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Mon, 5 Aug 2019 12:54:51 -0700 Subject: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b In-Reply-To: <0230ff0a-9f4b-4a59-b1e4-3eb76be23df9@default> References: <0230ff0a-9f4b-4a59-b1e4-3eb76be23df9@default> Message-ID: Hi Ramanand, Looks good to me. Glad that the number of files to review has decreased a lot :-) Naoto On 8/5/19 1:27 AM, Ramanand Patil wrote: > Hi all, > Please review the patch for tzdata2019b integration into jdk project(jdk-14). > Webrev: http://cr.openjdk.java.net/~rpatil/8228469/14/webrev.00/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 > > Summary: > - This patch uses "vanguard" format tzdata from IANA (instead of rearguard format), as the enhancement bug[1] is fixed now. Many thanks to Naoto for this. > - As per the latest changes to Palestine zone rules, the hard-coded checks for "Asia/Gaza" and "Asia/Hebron" are no more needed in ZoneInfoFile.java. > Because of those checks test/jdk/sun/util/calendar/zi/TestZoneInfo310.java was failing as mentioned in the bug comment[3]. > - test/jdk/java/util/TimeZone/TimeZoneTest.java is updated to set ZoneDescriptor.daylight value to "false" for BET zone id. > - The patch has passed all the related testing including JCK. > > Notes: > - As per the mail from tzdata maintainers[2] there is a possibility that Brazil might not abolish DST. > - Since the enhancement bug[1] is not fixed in update releases, jdk13u will still use the rearguard format tzdata. A separate review request will be sent for the same. > > > [1] https://bugs.openjdk.java.net/browse/JDK-8212970 > [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html > [3] https://bugs.openjdk.java.net/browse/JDK-8228469?focusedCommentId=14281498&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14281498 > > > Regards, > Ramanand. > From martinrb at google.com Mon Aug 5 20:27:26 2019 From: martinrb at google.com (Martin Buchholz) Date: Mon, 5 Aug 2019 13:27:26 -0700 Subject: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b In-Reply-To: <0230ff0a-9f4b-4a59-b1e4-3eb76be23df9@default> References: <0230ff0a-9f4b-4a59-b1e4-3eb76be23df9@default> Message-ID: Thanks for the update and redundancy removal. Looks good to me. What is the recommendation for older releases? Migrate to vanguard format by backporting recent changes or stay on rearguard forever? On Mon, Aug 5, 2019 at 1:28 AM Ramanand Patil wrote: > Hi all, > Please review the patch for tzdata2019b integration into jdk > project(jdk-14). > Webrev: http://cr.openjdk.java.net/~rpatil/8228469/14/webrev.00/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 > > Summary: > - This patch uses "vanguard" format tzdata from IANA (instead of > rearguard format), as the enhancement bug[1] is fixed now. Many thanks to > Naoto for this. > - As per the latest changes to Palestine zone rules, the > hard-coded checks for "Asia/Gaza" and "Asia/Hebron" are no more needed in > ZoneInfoFile.java. > Because of those checks > test/jdk/sun/util/calendar/zi/TestZoneInfo310.java was failing as mentioned > in the bug comment[3]. > - test/jdk/java/util/TimeZone/TimeZoneTest.java is updated to set > ZoneDescriptor.daylight value to "false" for BET zone id. > - The patch has passed all the related testing including JCK. > > Notes: > - As per the mail from tzdata maintainers[2] there is a possibility that > Brazil might not abolish DST. > - Since the enhancement bug[1] is not fixed in update releases, jdk13u > will still use the rearguard format tzdata. A separate review request will > be sent for the same. > > > [1] https://bugs.openjdk.java.net/browse/JDK-8212970 > [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html > [3] > https://bugs.openjdk.java.net/browse/JDK-8228469?focusedCommentId=14281498&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14281498 > > > Regards, > Ramanand. > From raffaello.giulietti at gmail.com Mon Aug 5 21:02:48 2019 From: raffaello.giulietti at gmail.com (Raffaello Giulietti) Date: Mon, 5 Aug 2019 23:02:48 +0200 Subject: Are classes generated by LambdaMetafactory special? Message-ID: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> Hello, experiment suggests that classes generated by java.lang.invoke.LambdaMetafactory are somewhat special: (1) getName() on the class returns a string of the form Xxx$$Lambda$nn/0xhhh where Xxx is a fully qualified class name (with periods '.' as package separators), nn is a decimal integer and hhh is a hex integer. What's the role of the slash '/' in the name? (2) An invocation of Class.forName() with that name fails. (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass() with that class as an argument returns false. Is this intentional or is it a bug? Greetings Raffaello From mandy.chung at oracle.com Mon Aug 5 21:11:02 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 5 Aug 2019 14:11:02 -0700 Subject: Are classes generated by LambdaMetafactory special? In-Reply-To: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> References: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> Message-ID: <4e9a7ffa-33f9-a4e9-078f-a7c421d891f4@oracle.com> This is intentional.? The lambda proxy classes are defined as VM anonymous classes through a JDK internal API Unsafe::defineAnonymousClass.? These generated classes are JDK implementation details that are hidden for any class lookup and not modifiable by JVM TI agent. JDK-8171335 is the RFE to define a supported API to replace Unsafe VM anonymous class.? We have a prototype in the "nestmates" branch in valhalla repo [1]. Mandy [1] http://hg.openjdk.java.net/valhalla/valhalla/ On 8/5/19 2:02 PM, Raffaello Giulietti wrote: > Hello, > > experiment suggests that classes generated by > java.lang.invoke.LambdaMetafactory are somewhat special: > > (1) getName() on the class returns a string of the form > ??? Xxx$$Lambda$nn/0xhhh > where Xxx is a fully qualified class name (with periods '.' as package > separators), nn is a decimal integer and hhh is a hex integer. What's > the role of the slash '/' in the name? > > (2) An invocation of Class.forName() with that name fails. > > (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass() > with that class as an argument returns false. > > Is this intentional or is it a bug? > > > Greetings > Raffaello From forax at univ-mlv.fr Mon Aug 5 21:34:21 2019 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 5 Aug 2019 23:34:21 +0200 (CEST) Subject: Are classes generated by LambdaMetafactory special? In-Reply-To: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> References: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> Message-ID: <461209609.160829.1565040861664.JavaMail.zimbra@u-pem.fr> It is intentional and the implementation details are planned to change in the future (there are already some patches in the valhalla/nestmates branch). The slash in the name is because you can create several classes from the same bytecode by patching it at runtime, the number after the slash is for each patching. Unlike a classical class, the class is not stored by a classloader in order to be garbage collected sooner, hence you can not find it this Class.forName. Intrumentation of a lambda proxy tends to fail because there is no API to get the patched data and because the class name is not resolvable (see above) so the easier solution was to mark those classes as non-modifiable. This may change in the future. R?mi ----- Mail original ----- > De: "raffaello giulietti" > ?: "core-libs-dev" > Envoy?: Lundi 5 Ao?t 2019 23:02:48 > Objet: Are classes generated by LambdaMetafactory special? > Hello, > > experiment suggests that classes generated by > java.lang.invoke.LambdaMetafactory are somewhat special: > > (1) getName() on the class returns a string of the form > Xxx$$Lambda$nn/0xhhh > where Xxx is a fully qualified class name (with periods '.' as package > separators), nn is a decimal integer and hhh is a hex integer. What's > the role of the slash '/' in the name? > > (2) An invocation of Class.forName() with that name fails. > > (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass() > with that class as an argument returns false. > > Is this intentional or is it a bug? > > > Greetings > Raffaello From brent.christian at oracle.com Mon Aug 5 21:43:46 2019 From: brent.christian at oracle.com (Brent Christian) Date: Mon, 5 Aug 2019 14:43:46 -0700 Subject: RFR: 8226297: Dual-pivot quicksort improvements Message-ID: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> Hi, Please review Vladimir Yaroslavskiy's changes to DualPivotQuickSort (seen earlier[1] on this alias). I will be sponsoring this change. I have a webrev against jdk-jdk here: http://cr.openjdk.java.net/~bchristi/8226297/webrev03-rfr/ (Note that I did a little re-ordering, and removed some superfluous spacing changes, in order to simplify the webrev. I've also included Vladimir's FailedFloat[2] test case.) Information about benchmarking the changes was posted[3] recently. An automated test run passes cleanly. Thanks! -Brent -- 1. http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061363.html 2. https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061513.html 3. http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061553.html From raffaello.giulietti at gmail.com Mon Aug 5 21:51:41 2019 From: raffaello.giulietti at gmail.com (Raffaello Giulietti) Date: Mon, 5 Aug 2019 23:51:41 +0200 Subject: Are classes generated by LambdaMetafactory special? In-Reply-To: <461209609.160829.1565040861664.JavaMail.zimbra@u-pem.fr> References: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> <461209609.160829.1565040861664.JavaMail.zimbra@u-pem.fr> Message-ID: Thanks R?mi and Mandy. I still don't get the full rationale on why lambda classes should be treated so specially but at least I now understand the current behavior. Greetings Raffaello On 05/08/2019 23.34, Remi Forax wrote: > It is intentional and the implementation details are planned to change in the future > (there are already some patches in the valhalla/nestmates branch). > > The slash in the name is because you can create several classes from the same bytecode by patching it at runtime, > the number after the slash is for each patching. > > Unlike a classical class, the class is not stored by a classloader in order to be garbage collected sooner, hence you can not find it this Class.forName. > > Intrumentation of a lambda proxy tends to fail because there is no API to get the patched data and because the class name is not resolvable (see above) so the easier solution was to mark those classes as non-modifiable. This may change in the future. > > R?mi > > ----- Mail original ----- >> De: "raffaello giulietti" >> ?: "core-libs-dev" >> Envoy?: Lundi 5 Ao?t 2019 23:02:48 >> Objet: Are classes generated by LambdaMetafactory special? > >> Hello, >> >> experiment suggests that classes generated by >> java.lang.invoke.LambdaMetafactory are somewhat special: >> >> (1) getName() on the class returns a string of the form >> Xxx$$Lambda$nn/0xhhh >> where Xxx is a fully qualified class name (with periods '.' as package >> separators), nn is a decimal integer and hhh is a hex integer. What's >> the role of the slash '/' in the name? >> >> (2) An invocation of Class.forName() with that name fails. >> >> (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass() >> with that class as an argument returns false. >> >> Is this intentional or is it a bug? >> >> >> Greetings >> Raffaello From mandy.chung at oracle.com Tue Aug 6 00:04:47 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 5 Aug 2019 17:04:47 -0700 Subject: Are classes generated by LambdaMetafactory special? In-Reply-To: References: <65441a43-5705-1af0-0eff-610e534e477c@gmail.com> <461209609.160829.1565040861664.JavaMail.zimbra@u-pem.fr> Message-ID: <73bfb9b0-c53c-92fe-ad33-1f6a232ac868@oracle.com> One property of a lambda proxy class is to be in the same nest as the caller class as it's logically part of the caller class (as it may access its private member).? VM anonymous class is an interim implementation solution until we provide a way to define a dynamically generated class as a nestmate of an existing class. Second property of proxy classes is that proxy classes are not symbolically referenced by other class and they are sole implementation of some methods or some classes/interfaces.? Proxy classes can be defined as ordinary class while it has to ensure that the class name must be unique in the global VM namespace. There is overhead generating such a class to the system dictionary (not to mention loader constraints).? OTOH the name of a proxy class is only useful for troubleshooting but entirely not needed at runtime. Mandy On 8/5/19 2:51 PM, Raffaello Giulietti wrote: > Thanks R?mi and Mandy. > > I still don't get the full rationale on why lambda classes should be > treated so specially but at least I now understand the current behavior. > > > Greetings > Raffaello > > > > > On 05/08/2019 23.34, Remi Forax wrote: >> It is intentional and the implementation details are planned to >> change in the future >> (there are already some patches in the valhalla/nestmates branch). >> >> The slash in the name is because you can create several classes from >> the same bytecode by patching it at runtime, >> the number after the slash is for each patching. >> >> Unlike a classical class, the class is not stored by a classloader in >> order to be garbage collected sooner, hence you can not find it this >> Class.forName. >> >> Intrumentation of a lambda proxy tends to fail because there is no >> API to get the patched data and because the class name is not >> resolvable (see above) so the easier solution was to mark those >> classes as non-modifiable. This may change in the future. >> >> R?mi >> >> ----- Mail original ----- >>> De: "raffaello giulietti" >>> ?: "core-libs-dev" >>> Envoy?: Lundi 5 Ao?t 2019 23:02:48 >>> Objet: Are classes generated by LambdaMetafactory special? >> >>> Hello, >>> >>> experiment suggests that classes generated by >>> java.lang.invoke.LambdaMetafactory are somewhat special: >>> >>> (1) getName() on the class returns a string of the form >>> ???? Xxx$$Lambda$nn/0xhhh >>> where Xxx is a fully qualified class name (with periods '.' as package >>> separators), nn is a decimal integer and hhh is a hex integer. What's >>> the role of the slash '/' in the name? >>> >>> (2) An invocation of Class.forName() with that name fails. >>> >>> (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass() >>> with that class as an argument returns false. >>> >>> Is this intentional or is it a bug? >>> >>> >>> Greetings >>> Raffaello From ramanand.patil at oracle.com Tue Aug 6 04:44:02 2019 From: ramanand.patil at oracle.com (Ramanand Patil) Date: Mon, 5 Aug 2019 21:44:02 -0700 (PDT) Subject: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b In-Reply-To: References: <0230ff0a-9f4b-4a59-b1e4-3eb76be23df9@default> Message-ID: Thank you Martin and Naoto for your reviews. Hi Martin, Currently, we are evaluating the approach for update releases. But in my opinion, it is better to migrate to vanguard format. Regards, Ramanand. From: Martin Buchholz Sent: Tuesday, August 6, 2019 1:57 AM To: Ramanand Patil Cc: core-libs-dev ; i18n-dev Subject: Re: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b Thanks for the update and redundancy removal.? Looks good to me. What is the recommendation for older releases?? Migrate to vanguard format by backporting recent changes or stay on rearguard forever? On Mon, Aug 5, 2019 at 1:28 AM Ramanand Patil wrote: Hi all, Please review the patch for tzdata2019b integration into jdk project(jdk-14). Webrev: http://cr.openjdk.java.net/~rpatil/8228469/14/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 Summary: ? ? ? ? - This patch uses "vanguard" format tzdata from IANA (instead of rearguard format), as the enhancement bug[1] is fixed now. Many thanks to Naoto for this. ? ? ? ? - As per the latest changes to Palestine zone rules, the hard-coded checks for "Asia/Gaza" and "Asia/Hebron" are no more needed in ZoneInfoFile.java. ? ? ? ? ? Because of those checks test/jdk/sun/util/calendar/zi/TestZoneInfo310.java was failing as mentioned in the bug comment[3]. ? ? ? ? - test/jdk/java/util/TimeZone/TimeZoneTest.java is updated to set ZoneDescriptor.daylight value to "false" for BET zone id. ? ? ? ? - The patch has passed all the related testing including JCK. Notes: - As per the mail from tzdata maintainers[2] there is a possibility that Brazil might not abolish DST. - Since the enhancement bug[1] is not fixed in update releases, jdk13u will still use the rearguard format tzdata. A separate review request will be sent for the same. [1] https://bugs.openjdk.java.net/browse/JDK-8212970 [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html [3] https://bugs.openjdk.java.net/browse/JDK-8228469?focusedCommentId=14281498&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14281498 Regards, Ramanand. From ramanand.patil at oracle.com Tue Aug 6 05:57:47 2019 From: ramanand.patil at oracle.com (Ramanand Patil) Date: Mon, 5 Aug 2019 22:57:47 -0700 (PDT) Subject: [13u]: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b Message-ID: Hi all, Please review the patch for jdk13u backport of tzdata2019b integration into jdk: Webrev: http://cr.openjdk.java.net/~rpatil/8228469/13u/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 The patch is not clean because: It uses "rearguard" format tzdata from IANA (instead of vanguard format), as the enhancement bug[1] is not fixed in jdk13u. The patch has passed all the related testing including JCK. Note: As per the mail from tzdata maintainers[2] there is a possibility that Brazil might not abolish DST. [1] https://bugs.openjdk.java.net/browse/JDK-8212970 [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html Regards, Ramanand. From dl at cs.oswego.edu Tue Aug 6 11:28:03 2019 From: dl at cs.oswego.edu (Doug Lea) Date: Tue, 6 Aug 2019 07:28:03 -0400 Subject: Bug in parallel sorting of float / double In-Reply-To: <004c5e3c-f0f4-172c-6718-bc85667a2b24@oracle.com> References: <1563965581.761373630@f352.i.mail.ru> <1563973099.30911139@f507.i.mail.ru> <004c5e3c-f0f4-172c-6718-bc85667a2b24@oracle.com> Message-ID: <68f00e34-3d90-ad83-5e5d-93caed29b4ec@cs.oswego.edu> It's too bad that floating-point ordering issues that apparently no one cares about (no reports) limit performance, but the solution seems OK. Also: I've been reviewing drafts of this update for a year. They seem OK. (Although they are very much focused on details of existing primitive types; most likely a different approach will work better with value/inline types.) -Doug On 7/24/19 9:15 AM, David Holmes wrote: > Hi Vladimir, > > On 24/07/2019 10:58 pm, Vladimir Yaroslavskiy wrote: >> Hi?David, >> >> Please, see how it works: Arrays.parallelSort(double[]) >> invokes?ArraysParallelSortHelpers.FJDouble.Sorter >> if size is big enough and?ForkJoinPool.getCommonPoolParallelism()) > 1. >> >> FJDouble.Sorter divides given array into 4 parts, sorts them >> recursively in parallel and merges these parts. >> Finally?DualPivotQuicksort is invoked on small parts and only on this >> step NaNs and -0.0s are arranged. >> In other words,?NaNs and -0.0s are?arranged inside each small parts, >> but this action must be >> done once before the first splitting of the array. > > My understanding** was that the merge of the correctly sorted sub-arrays > would correctly cause NaNs to bubble to the end as required, while > zeroes would also group - though I think I can see now that simply using > < would not correctly order NaNs relative to other values, nor order > -0.0 and +0.0 > > ** It's been 7 years since I helped Doug Lea put the parallelising code > into the JDK so I'm a bit rusty on the details :) and I'm surprised such > a bug has not been detected before now. > > Cheers, > David > >> Thank you, >> Vladimir >> >> ??? ?????, 24 ???? 2019, 15:39 +03:00 ?? David Holmes >> ??? : >> >> ??? Hi Vladimir, >> >> ??? On 24/07/2019 8:53 pm, Vladimir Yaroslavskiy wrote: >> ???? > Hi all, >> ???? > >> ???? > I've found bug in parallel sorting of float / double arrays in >> ??? the latest JDK. >> ???? > >> ???? > When float / double values are sorted, additional actions are >> ???? > required: NaNs must be moved to the end and negative zeros >> ???? > must be placed before positive zeros. >> ???? > >> ???? > Current implementation of Arrays.parallelSort(float[] / double []) >> ???? > invokes parallel merge sort from ArraysParallelSortHelpers class, >> ???? > but it doesn't arrange NaNs and -0.0. >> >> ??? It ultimately uses DualPivotQuicksort which AFAICS does have code to >> ??? arrange NaNS: >> >> ???? ?????static void sort(float[] a, int left, int right, >> ???? ??????????????????????float[] work, int workBase, int workLen) { >> ???? ?????????/* >> ???? ??????????* Phase 1: Move NaNs to the end of the array. >> ???? ??????????*/ >> ???? ?????????while (left <= right && Float.isNaN(a[right])) { >> ???? ?????????????--right; >> ???? ?????????} >> >> ??? and also order +/-0 >> >> ???? ??????/* >> ???? ???????* Phase 3: Place negative zeros before positive zeros. >> ???? ???????*/ >> >> ??? where does the bug arise? >> >> ??? Thanks, >> ??? David >> ??? ----- >> >> >> ???? > @Alan, Brent, Laurent >> ???? > Could you please file a bug? >> ???? > >> ???? > New optimized version of DualPivotQuicksort (which is under >> ??? review) works fine and >> ???? > doesn't contain this bug. Please, look at my test case to >> ??? reproduce it. >> ???? > >> ???? > >> ??? >> ---------------------------------------------------------------------------------------------------------------------- >> >> ???? > import java.util.Random; >> ???? > >> ???? > public class FailedFloat { >> ???? > >> ???? > private static final int MAX_N = (1 << 13) /* >> ??? Arrays.MIN_ARRAY_SORT_GRAN */ + 10; >> ???? > >> ???? > public static void main(String[] args) { >> ???? > float[] a = new float[MAX_N]; >> ???? > random(a); >> ???? > java.util.Arrays.parallelSort(a); >> ???? > check(a); >> ???? > System.out.println("PASSED"); >> ???? > } >> ???? > >> ???? > private static void random(float[] a) { >> ???? > Random random = new Random(777); >> ???? > for (int i = 0; i < MAX_N; i++) { >> ???? > a[i] = random.nextBoolean() ? -0.0f : 0.0f; >> ???? > } >> ???? > } >> ???? > >> ???? > private static void check(float[] a) { >> ???? > for (int i = 0; i < a.length - 1; ++i) { >> ???? > if (Float.floatToRawIntBits(a[i]) == 0 && >> ??? Float.floatToRawIntBits(a[i + 1]) < 0) { >> ???? > throw new RuntimeException(a[i] + " goes before "+ a[i + 1] + " >> ??? at position " + i); >> ???? > } >> ???? > } >> ???? > } >> ???? > } >> ???? > >> ??? >> ------------------------------------------------------------------------------------------------------------------------ >> >> ???? > Thank you, >> ???? > Vladimir >> > From adinn at redhat.com Tue Aug 6 12:12:48 2019 From: adinn at redhat.com (Andrew Dinn) Date: Tue, 6 Aug 2019 13:12:48 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> Message-ID: Hi Aleksey/Boris, This is a response to both your last review posts. New webrev link is at the end. On 01/08/2019 12:16, Aleksey Shipilev wrote: > On 7/31/19 12:55 PM, Andrew Dinn wrote: . . . > I am more concerned that the writeback call enters the pre sync stub unnecessarily. The stub? I hope you mean when executing the native call as opposed to the JITted intrinsic? The stub is only called on a cold path when a native call proper happens. By contrast, the intrinsic translation for CacheWBPreSync on AArch64 and x86_64 does not insert any instructions into the generated code (and most especially not a call to the stub). Here it is: instruct cacheWBPreSync() %{ predicate(VM_Version::supports_data_cache_line_flush()); match(CacheWBPreSync); ins_cost(100); format %{"cache wb presync" %} ins_encode %{ __ cache_wbsync(true); %} ins_pipe(pipe_slow); // XXX %} void MacroAssembler::cache_wbsync(bool is_pre) { assert(VM_Version::supports_clflush(), "clflush should be available"); bool optimized = VM_Version::supports_clflushopt(); bool no_evict = VM_Version::supports_clwb(); // pick the correct implementation if (!is_pre && (optimized || no_evict)) { // need an sfence for post flush when using clflushopt or clwb // otherwise no no need for any synchroniaztion sfence(); } } > I had the idea to do this more efficiently, and simplify code at the same time: how about emitting > CacheWBPreSync nodes, but emitting nothing for them in .ad matchers? That would leave generic code > generic, and architectures would then be able to avoid the stub altogether for pre sync code. This > would simplify current stub generators too, I think: you don't need to pass arguments to them. I believe the intrinsic behaviour you are asking for is effectively what is implemented (as shown above). The .ad match rules for the PreSync and PostSync nodes both call MacroAssembler::cache_wbsync. For pre-sync it emits nothing. For post-sync it emits sfence when the writeback is implemented using clwb or clflushopt and nothing if writeback relies on clflush. > This leaves calling via Unsafe. I believe pulling up the isPre choice to the stub generation time > would be beneficial. That is, generate *two* stubs: StubRoutines::data_cache_writeback_pre_sync() > and StubRoutines::data_cache_writeback_post_sync(). If arch does not need the pre_sync, generate nop > version of pre_sync(). I don't really see any point to doing this. We can generate two stubs, one executing a nop and one executing a nop/sfence according to need. Or we can have one stub with a branch on the sync type and branch targets that execute either a nop or a nop/sfence as needed. The difference in performance of the stub is minor and irrelevant. The difference in generation time and memory use is minor and irrelevant. What are you trying to gain here? > This is not a strong requirement from my side. I do believe it would make code a bit more > straight-forward. Am I missing something here? Or did you simply miss that the intrinsic translation inserts no code for the presync? >>> === src/hotspot/cpu/x86/assembler_x86.cpp >>> >>> It feels like these comments are redundant, especially L8630 and L8646 which mention magic values >>> "6" and "7", not present in the code: > > ... > >> 8624 // 0x66 is instruction prefix >> >> 8627 // 0x0f 0xAE is opcode family >> >> 8630 // rdi == 7 is extended opcode byte >> . . . >> >> Given that the code is simply stuffing numbers (whether supplied as >> literals or as symbolic constants) into a byte stream I think these >> comments are a help when it comes to cross-checking each specific >> assembly against the corresponding numbers declared in the Intel >> manuals. So, I don't really want to remove them. Would you prefer me to >> reverse the wording as above? > > I was merely commenting on the style: the rest of the file does not have comments like that. The > positions of prefixes, opcode families, etc is kinda implied by the code shape. Yes, I too noticed that the rest of the file does not have any such comments :-] Given the highly variable shape of x86 machine code, I don't see any reason not to start remedying that omission, even if the remedy is only piecemeal. Commenting may not be a great help to maintainers who know the code and ISA really well but they are not the only audience. Even in that specific case the comments provide a sanity check. >>> === src/hotspot/cpu/x86/macroAssembler_x86.cpp >> // prefer clwb (potentially parallel writeback without evict) >> // otherwise prefer clflushopt (potentially parallel writeback >> // with evict) >> // otherwise fallback on clflush (serial writeback with evict) >> >> In the second case the comment is redundant because the need for an >> sfence is covered by the existing comment inside the if: >> >> // need an sfence for post flush when using clflushopt or clwb >> // otherwise no no need for any synchroniaztion > > Yes, this would be good to add. Ok, done. >>> === src/hotspot/share/opto/c2compiler.cpp >>> >>> Why inject new cases here, instead of at the end of switch? Saves sudden "break": >>> >>> 578 break; >>> 579 case vmIntrinsics::_writeback0: >>> 580 if (!Matcher::match_rule_supported(Op_CacheWB)) return false; >>> 581 break; >>> 582 case vmIntrinsics::_writebackPreSync0: >>> 583 if (!Matcher::match_rule_supported(Op_CacheWBPreSync)) return false; >>> 584 break; >>> 585 case vmIntrinsics::_writebackPostSync0: >>> 586 if (!Matcher::match_rule_supported(Op_CacheWBPostSync)) return false; >>> 587 break; >> >> I placed them here so they were close to the other Unsafe intrinsics. In >> particular they precede _allocateInstance, an ordering which is also the >> case in the declarations in vmSymbols.hpp. >> >> In what sense do you mean that an extra 'break' is saved? That would be >> true as regards the textual layout. It wouldn't affect the logic of >> folding different ranges of values into branching range tests (which is >> only determined by the numeric values of the intrinsics). If you are >> concerned about the former then I would argue that placing the values in >> declaration order seems to me to be the more important concern. > > I don't think we have to follow whatever ordering mess in vmSymbols.hpp. New code cuts into the last > case block in that switch, which is mostly about "we know about these symbols, they are > falling-through to the break". Adding cases with Matcher::match_rule_supported seems odd there. If > anything, those new cases should be moved upwards to other cases, e.g. after vmIntrinsics::_minD. As you wish. I have moved them to immediately preceding the large unbroken block. >>> === src/hotspot/share/prims/unsafe.cpp >>> >>> Do we really need this function pointer mess? >>> >>> 457 void (*wb)(void *); >>> 458 void *a = addr_from_java(line); >>> 459 wb = (void (*)(void *)) StubRoutines::data_cache_writeback(); >>> 460 assert(wb != NULL, "generate writeback stub!"); >>> 461 (*wb)(a); >>> >>> Seems easier to: >>> >>> assert(StubRoutines::data_cache_writeback() != NULL, "sanity"); >>> StubRoutines::data_cache_writeback()(addr_from_java(line)); >> Hmm, "that whole brevity thing" again? Well, I guess you must now call >> me "El Duderino". > > Well, that is, like, your opinion, man. C++ is messy if we allow it to be! > >> Are you sure that all the compilers used to build openJDK will happily >> eat the second line of your replacement? If you can guarantee that I'll >> happily remove the type declarations. > > I think they do: there are uses like that in the same file already, for example: > > if (StubRoutines::unsafe_arraycopy() != NULL) { > StubRoutines::UnsafeArrayCopy_stub()(src, dst, sz); > } else { > Copy::conjoint_memory_atomic(src, dst, sz); > } Hmm, your suggested replacement does not in fact compile. Indeed, the example you cite is comparing apples with pears -- note that the getter employed in call differs from the getter employed in the check. The following macro magic is provided for that example in stubRoutines.hpp: static address unsafe_arraycopy() { return _unsafe_arraycopy; } typedef void (*UnsafeArrayCopyStub)(const void* src, void* dst, size_t count); static UnsafeArrayCopyStub UnsafeArrayCopy_stub() { return CAST_TO_FN_PTR(UnsafeArrayCopyStub, _unsafe_arraycopy); } I have provided similar magic to hide the function pointer details for the writeback and writeback_sync stubs. Latest webrev against current jdk/jdk including changes agreed for the review discussion above fixes for AArch64/x86_32 build issues reported by Boris Ulasevich the new test promised for Boris Ulasevich http://cr.openjdk.java.net/~adinn/8224974/webrev.11 Testing: The x86_32 and aarch64 builds now build and run ok. The pmem-specific tests (PmemTest, MapFail) pass with the expected outcomes on x86_64 and AArch64. PmemTest is skipped on x86_32 (as expected). MapFail passes on x86_32 (it expects the map to be unsupported). I have passed the patch on for more thorough testing on simulated and real NVRAM using our middleware stack. I am still waiting for confirmation of a submit job. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From shade at redhat.com Tue Aug 6 12:44:19 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Tue, 6 Aug 2019 14:44:19 +0200 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> Message-ID: On 8/6/19 2:12 PM, Andrew Dinn wrote: > On 01/08/2019 12:16, Aleksey Shipilev wrote: >> On 7/31/19 12:55 PM, Andrew Dinn wrote: >> I am more concerned that the writeback call enters the pre sync stub unnecessarily. > > The stub? I hope you mean when executing the native call as opposed to > the JITted intrinsic? The stub is only called on a cold path when a > native call proper happens. By contrast, the intrinsic translation for > CacheWBPreSync on AArch64 and x86_64 does not insert any instructions > into the generated code (and most especially not a call to the stub). Ah, that is exactly what I wanted. Good then, scratch the rest of my comments. >> This is not a strong requirement from my side. I do believe it would make code a bit more >> straight-forward. > > Am I missing something here? Or did you simply miss that the intrinsic > translation inserts no code for the presync? I thought that translating two separate (and statically bound) Unsafe calls, hooking them up to separate Unsafe leaf entries, and then suddenly going into a single StubRoutine call with dynamic argument that dispatches at runtime is a bit awkward. I would have expected it to end up with two separate StubRoutines as well. Again, I have no strong opinion about this. >>>> === src/hotspot/share/prims/unsafe.cpp >>>> >>>> Do we really need this function pointer mess? >>>> >>>> 457 void (*wb)(void *); >>>> 458 void *a = addr_from_java(line); >>>> 459 wb = (void (*)(void *)) StubRoutines::data_cache_writeback(); >>>> 460 assert(wb != NULL, "generate writeback stub!"); >>>> 461 (*wb)(a); >>>> >>>> Seems easier to: ... > static address unsafe_arraycopy() { return _unsafe_arraycopy; } > typedef void (*UnsafeArrayCopyStub)(const void* src, void* dst, size_t > count); > static UnsafeArrayCopyStub UnsafeArrayCopy_stub() { return > CAST_TO_FN_PTR(UnsafeArrayCopyStub, _unsafe_arraycopy); } > > I have provided similar magic to hide the function pointer details for > the writeback and writeback_sync stubs. Yes, this looks cleaner. The declarations can be a bit less crowded: static address data_cache_writeback() { return _data_cache_writeback; } static address data_cache_writeback_sync() { return _data_cache_writeback_sync; } typedef void (*DataCacheWritebackStub)(void *); static DataCacheWritebackStub DataCacheWriteback_stub() { return ... typedef void (*DataCacheWritebackSyncStub)(bool); static DataCacheWritebackSyncStub DataCacheWritebackSync_stub() { return ... > http://cr.openjdk.java.net/~adinn/8224974/webrev.11 Looks good. Minor nits (no need for another webrev): *) Not sure if the only copyright line change is needed in src/hotspot/cpu/aarch64/globals_aarch64.hpp. *) Indenting is a bit off at L109 in src/hotspot/cpu/aarch64/vm_version_aarch64.hpp: 108 static int cpu_revision() { return _revision; } 109 static bool supports_dcpop() { return _dcpop; } *) Excess new line added at the end of src/hotspot/os/bsd/os_bsd.cpp? *) Indenting is off in backslashes in src/hotspot/share/runtime/globals.hpp: 2444 \ 2445 develop(bool, TraceMemoryWriteback, false, \ 2446 "Trace memory writeback operations") \ 2447 \ *) Unnecessary newline at L827 in src/hotspot/share/runtime/os.hpp? 826 // support for mapping non-volatile memory using MAP_SYNC 827 828 static bool supports_map_sync(); *) These declarations are too dense in src/java.base/share/classes/jdk/internal/misc/Unsafe.java: 998 /** 999 * primitive operation forcing writeback of a single cache line. 1000 * 1001 * @param address 1002 * the start address of the cache line to be written back 1003 */ 1004 // native used to write back an individual cache line starting at 1005 // the supplied address 1006 @HotSpotIntrinsicCandidate 1007 private native void writeback0(long address); 1008 // native used to serialise writeback operations relative to 1009 // preceding memory writes 1010 @HotSpotIntrinsicCandidate 1011 private native void writebackPreSync0(); 1012 // native used to serialise writeback operations relative to 1013 // following memory writes 1014 @HotSpotIntrinsicCandidate 1015 private native void writebackPostSync0(); Suggestion: /** * Force write back an individual cache line. * * @param address * the start address of the cache line to be written back */ @HotSpotIntrinsicCandidate private native void writeback0(long address); /** * Serialize writeback operations relative to preceding memory writes. */ @HotSpotIntrinsicCandidate private native void writebackPreSync0(); /** * Serialize writeback operations relative to following memory writes. */ @HotSpotIntrinsicCandidate private native void writebackPostSync0(); -- Thanks, -Aleksey From bourges.laurent at gmail.com Tue Aug 6 13:32:35 2019 From: bourges.laurent at gmail.com (=?UTF-8?Q?Laurent_Bourg=C3=A8s?=) Date: Tue, 6 Aug 2019 15:32:35 +0200 Subject: RFR: 8226297: Dual-pivot quicksort improvements In-Reply-To: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> References: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> Message-ID: Hi Brent, Thank you for sponsoring this patch. I tried to compare your webrev against my latest (diff patch files) but it gives me too many changes lines. Do you have another idea to see incremental changes only ? (anyway I can compare raw files) Thanks, Laurent Le lun. 5 ao?t 2019 ? 23:43, Brent Christian a ?crit : > Hi, > > Please review Vladimir Yaroslavskiy's changes to DualPivotQuickSort > (seen earlier[1] on this alias). I will be sponsoring this change. > > I have a webrev against jdk-jdk here: > http://cr.openjdk.java.net/~bchristi/8226297/webrev03-rfr/ > > (Note that I did a little re-ordering, and removed some superfluous > spacing changes, in order to simplify the webrev. I've also included > Vladimir's FailedFloat[2] test case.) > > Information about benchmarking the changes was posted[3] recently. > An automated test run passes cleanly. > > Thanks! > -Brent > -- > 1. > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061363.html > > 2. > https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061513.html > > 3. > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061553.html > From adinn at redhat.com Tue Aug 6 13:57:05 2019 From: adinn at redhat.com (Andrew Dinn) Date: Tue, 6 Aug 2019 14:57:05 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> Message-ID: <67c3888c-9058-9e5c-273e-7810b1c66e29@redhat.com> On 06/08/2019 13:44, Aleksey Shipilev wrote: > Ah, that is exactly what I wanted. Good then, scratch the rest of my comments. > . . . > I thought that translating two separate (and statically bound) Unsafe calls, hooking them up to > separate Unsafe leaf entries, and then suddenly going into a single StubRoutine call with dynamic > argument that dispatches at runtime is a bit awkward. I would have expected it to end up with two > separate StubRoutines as well. Again, I have no strong opinion about this. Ok, thanks for clarifying. Inertia dictates I leave the stubs as is :-) > Yes, this looks cleaner. The declarations can be a bit less crowded: > > static address data_cache_writeback() { return _data_cache_writeback; } > static address data_cache_writeback_sync() { return _data_cache_writeback_sync; } > > typedef void (*DataCacheWritebackStub)(void *); > static DataCacheWritebackStub DataCacheWriteback_stub() { return ... > > typedef void (*DataCacheWritebackSyncStub)(bool); > static DataCacheWritebackSyncStub DataCacheWritebackSync_stub() { return ... > . . . >> http://cr.openjdk.java.net/~adinn/8224974/webrev.11 > > Looks good. Ok, I'll fold this and the other format errors you identified into the next patch. If I could please get a nod from Alan Bateman (and assuming I don't receive further comments from other reviewers) I'll push that next patch. Any more for any more ... ? regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From dmitry.chuyko at bell-sw.com Tue Aug 6 14:25:40 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Tue, 6 Aug 2019 17:25:40 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <67c3888c-9058-9e5c-273e-7810b1c66e29@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> <67c3888c-9058-9e5c-273e-7810b1c66e29@redhat.com> Message-ID: Hi Andrew, One quick question about synchronization in unmappers. One of preliminary steps for Loom was to replace monitor usage by j.u.c locks for I/O to let fibers release carrier threads. For instance see JDK-8222774. Does it make sense to do the same in your new unmappers code? -Dmitry [1] https://bugs.openjdk.java.net/browse/JDK-8222774 On 8/6/19 4:57 PM, Andrew Dinn wrote: > On 06/08/2019 13:44, Aleksey Shipilev wrote: >> Ah, that is exactly what I wanted. Good then, scratch the rest of my comments. >> . . . >> I thought that translating two separate (and statically bound) Unsafe calls, hooking them up to >> separate Unsafe leaf entries, and then suddenly going into a single StubRoutine call with dynamic >> argument that dispatches at runtime is a bit awkward. I would have expected it to end up with two >> separate StubRoutines as well. Again, I have no strong opinion about this. > Ok, thanks for clarifying. Inertia dictates I leave the stubs as is :-) > >> Yes, this looks cleaner. The declarations can be a bit less crowded: >> >> static address data_cache_writeback() { return _data_cache_writeback; } >> static address data_cache_writeback_sync() { return _data_cache_writeback_sync; } >> >> typedef void (*DataCacheWritebackStub)(void *); >> static DataCacheWritebackStub DataCacheWriteback_stub() { return ... >> >> typedef void (*DataCacheWritebackSyncStub)(bool); >> static DataCacheWritebackSyncStub DataCacheWritebackSync_stub() { return ... >> . . . >>> http://cr.openjdk.java.net/~adinn/8224974/webrev.11 >> Looks good. > Ok, I'll fold this and the other format errors you identified into the > next patch. > > > If I could please get a nod from Alan Bateman (and assuming I don't > receive further comments from other reviewers) I'll push that next patch. > > Any more for any more ... ? > > regards, > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From dmitry.chuyko at bell-sw.com Tue Aug 6 14:50:18 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Tue, 6 Aug 2019 17:50:18 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> Message-ID: <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> Hi Andrew, Thanks for previous detailed explanations, and great, there are now checks for exceptions in webrev.11. Let me add just a few comments about that. On 8/1/19 12:49 PM, Andrew Dinn wrote: > Hello Dmitry, > > On 01/08/2019 05:09, Dmitry Chuyko wrote: >> Just a small comment about the tests. As you can see, some of tests in >> jdk/java/nio/channels/FileChannel check various modes, arguments, and >> expected exceptions. E.g. see MapTest, Mode and Args. >> >> I noticed that in your changes for the new map mode there are new >> exceptions thrown in different situations. For example, when the >> required mode is not supported, or it does not fit. In particular, this >> should happen correctly on systems that do not support nvram. Have you >> considered the possibility of extending or adding tests for this behavior? > I agree that these failure cases need better test coverage and > automation. However, that is not to say they have not been tested. All > current success and failure cases can be exercised by the current mmap > test (PmemTest) if run in the correct circumstance. Unfortunately, > automatic testing is not straightforward. New Unsafe.writebackMemory()/checkWritebackMemory()/checkWritebackEnabled() @throws RuntimeException "if memory writeback is not supported...". There is no test that check this behavior of Unsafe class while it seems to be relatively simple as inner check actually operates with a constant value. New MapFail test succeeds if proper IOException or any UnsupportedOperationException was caught but it aren't those situations actually 2 different ones that require distinct checks? If you say that is the situation when results depend on Linux version, it makes sense at least to put a comment in the test because it's really not trivial. Can PmemTest check IOException with message "map with mode MAP_SYNC unsupported" as a part of expected behavior, not just showing a test failure? -Dmitry > > 1) On x86_64 where MAP_SYNC is supported test PMemTest includes > instructions to exercise a successful map from a real or emulated DAX > file system. It can also be used (and has been used) to exercise the > IOException failure path in the case where the file it tries to open > belongs to a non-DAX file system (see line 99). > > Note that testing for success or failure cannot be done automatically > using the test as it currently stands. Testing for a successful map > requires mounting a real or emulated DAX file system at a known mount > point and creating a writable dir to hold the mapped file. Testing for > the IOException failure requires either setting up an equivalent non-DAX > file system mount or editing the test to open the file in a non-DAX file > system dir like, say, /tmp. > > A new, separate test for the IOException failure could be automated on > x86_64 by trying to map a file located in /tmp (on the assumption that > /tmp is not mounted as a DAX file system). Of course, at present this > will only give the IOException result when MAP_SYNC is supported. Given > a suitably old Linux/x86_64, UnsupportedOperationException could also be > thrown. > > 2) On AArch64 where MAP_SYNC is not currently supported PmemTest clearly > cannot be used to exercise the success path. However, it can be used > (and has been used) to exercise the UnsupportedOperationException > failure path. > > A check for the UnsupportedOperationException failure could be automated > on AArch64 by a new test as described above. Of course, once MAP_SYNC > support arrives in a new Linux/AArch64 it would also become for > IOException to be thrown. > > So, to sum up, it would be possible to add a new, automatic test that > checks for one or other failure occurring. I am happy to add such a test > to the next webrev. > > regards, > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander > From sean.coffey at oracle.com Tue Aug 6 15:13:54 2019 From: sean.coffey at oracle.com (=?UTF-8?Q?Se=c3=a1n_Coffey?=) Date: Tue, 6 Aug 2019 16:13:54 +0100 Subject: [13u]: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b In-Reply-To: References: Message-ID: Looks good Ramanand. regards, Sean. On 06/08/2019 06:57, Ramanand Patil wrote: > Hi all, > Please review the patch for jdk13u backport of tzdata2019b integration into jdk: > Webrev: http://cr.openjdk.java.net/~rpatil/8228469/13u/webrev.00/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 > > The patch is not clean because: It uses "rearguard" format tzdata from IANA (instead of vanguard format), as the enhancement bug[1] is not fixed in jdk13u. > The patch has passed all the related testing including JCK. > > Note: As per the mail from tzdata maintainers[2] there is a possibility that Brazil might not abolish DST. > > > [1] https://bugs.openjdk.java.net/browse/JDK-8212970 > [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html > > > Regards, > Ramanand. From naoto.sato at oracle.com Tue Aug 6 15:55:11 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Tue, 6 Aug 2019 08:55:11 -0700 Subject: [13u]: RFR: 8228469: (tz) Upgrade time-zone data to tzdata2019b In-Reply-To: References: Message-ID: <657b66b4-a2f8-0edc-4d7b-37daf6d6a2be@oracle.com> +1 Naoto On 8/6/19 8:13 AM, Se?n Coffey wrote: > Looks good Ramanand. > > regards, > Sean. > > On 06/08/2019 06:57, Ramanand Patil wrote: >> Hi all, >> Please review the patch for jdk13u backport of tzdata2019b integration >> into jdk: >> Webrev: http://cr.openjdk.java.net/~rpatil/8228469/13u/webrev.00/ >> Bug: https://bugs.openjdk.java.net/browse/JDK-8228469 >> >> The patch is not clean because: It uses "rearguard" format tzdata from >> IANA (instead of vanguard format), as the enhancement bug[1] is not >> fixed in jdk13u. >> The patch has passed all the related testing including JCK. >> >> Note: As per the mail from tzdata maintainers[2] there is a >> possibility that Brazil might not abolish DST. >> >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8212970 >> [2] https://mm.icann.org/pipermail/tz/2019-July/028344.html >> >> >> Regards, >> Ramanand. From adinn at redhat.com Tue Aug 6 15:58:57 2019 From: adinn at redhat.com (Andrew Dinn) Date: Tue, 6 Aug 2019 16:58:57 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <36326F5E-12CD-487A-8FE2-1049631FE908@oracle.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> Message-ID: <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> Hello Dmitry, On 06/08/2019 15:50, Dmitry Chuyko wrote: > Thanks for previous detailed explanations, and great, there are now > checks for exceptions in webrev.11. Let me add just a few comments about > that. Sure, no problem. Thank you for looking at the patch. > New > Unsafe.writebackMemory()/checkWritebackMemory()/checkWritebackEnabled() > @throws RuntimeException "if memory writeback is not supported...". > There is no test that check this behavior of Unsafe class while it seems > to be relatively simple as inner check actually operates with a constant > value. No this behaviour is not currently tested. However, the only client at present will never exercise that path so it is not critical to test it now. I'd be happy to address testing of this behaviour as part of a follow-up JIRA issue if you would be so good as to raise it. I say that because I would very much like to get this functionality into a release to simplify more extensive testing by Red Hat's middleware teams. > New MapFail test succeeds if proper IOException or any > UnsupportedOperationException was caught but it aren't those situations > actually 2 different ones that require distinct checks? If you say that > is the situation when results depend on Linux version, it makes sense at > least to put a comment in the test because it's really not trivial. The documentation of the API under test makes it clear that both errors can occur and under what circumstances. However, a note in the test will certainly do no harm. I will insert one before checking in the patch. > Can PmemTest check IOException with message "map with mode MAP_SYNC > unsupported" as a part of expected behavior, not just showing a test > failure? I don't see any need for this now that MapFail has been provided. Wit that alterative in place for checking map failures on non-DAX file syetems PmemTest is now primarily intended to test behaviour with a DAX file system which it expects to have been set up in advance as described in the main comment. So, the scenario you describe is not really an intended usage and I woudl argue that a failure is the right way to signal that. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From adinn at redhat.com Tue Aug 6 16:09:46 2019 From: adinn at redhat.com (Andrew Dinn) Date: Tue, 6 Aug 2019 17:09:46 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> <67c3888c-9058-9e5c-273e-7810b1c66e29@redhat.com> Message-ID: <3fb6e11f-4c95-8d88-3144-0c46c455a5db@redhat.com> Hello Dmitry, On 06/08/2019 15:25, Dmitry Chuyko wrote: > One quick question about synchronization in unmappers. One of > preliminary steps for Loom was to replace monitor usage by j.u.c locks > for I/O to let fibers release carrier threads. For instance see > JDK-8222774. Does it make sense to do the same in your new unmappers code? > . . . > [1] https://bugs.openjdk.java.net/browse/JDK-8222774 The unmapper code is not strictly 'new' as regards its reliance on synchronization. It merely follows and repeats the pattern employed in the prior code that it has generalized (by splitting the original Unmapper into two distinct flavours of subclass). If this poses a problem for Loom then it is a separate issue form the one this JEP addresses. I think you should raise a new issue for that change (just as you would have had to do before this change). I am sure Alan Bateman will be happy to consider your proposal. Indeed, I would be happy to implement it given his approval -- or leave it to you to do so if you prefer. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From patrick.concannon at oracle.com Tue Aug 6 16:20:49 2019 From: patrick.concannon at oracle.com (Patrick Concannon) Date: Tue, 6 Aug 2019 17:20:49 +0100 Subject: [13] (doc-only) RFR: 8228971: Locale API doc has redundant hyphens for some parameters Message-ID: Hi, Would it be possible to have my fix for JDK-8228971 reviewed? The is a trivial doc-only fix which removes redundant hyphens for parameter descriptions for the Locale API doc. The intent is to push this to JDK 13. Further information on this bug can be found here: https://bugs.openjdk.java.net/browse/JDK-8228971 Webrev for fix: http://cr.openjdk.java.net/~dfuchs/pconcann/8228971/webrevs/webrev.1/ Kind regards, Patrick From naoto.sato at oracle.com Tue Aug 6 16:24:21 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Tue, 6 Aug 2019 09:24:21 -0700 Subject: [13] (doc-only) RFR: 8228971: Locale API doc has redundant hyphens for some parameters In-Reply-To: References: Message-ID: Hi Patrick, Looks fine to me. Thanks for fixing the doc. Naoto On 8/6/19 9:20 AM, Patrick Concannon wrote: > Hi, > > Would it be possible to have my fix for JDK-8228971 reviewed? > > The is a trivial doc-only fix which removes redundant hyphens for > parameter descriptions for the Locale API doc. The intent is to push > this to JDK 13. > > Further information on this bug can be found here: > https://bugs.openjdk.java.net/browse/JDK-8228971 > > Webrev for fix: > http://cr.openjdk.java.net/~dfuchs/pconcann/8228971/webrevs/webrev.1/ > > > Kind regards, > > Patrick > From lance.andersen at oracle.com Tue Aug 6 16:25:22 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Tue, 6 Aug 2019 12:25:22 -0400 Subject: [13] (doc-only) RFR: 8228971: Locale API doc has redundant hyphens for some parameters In-Reply-To: References: Message-ID: HI Patrick, I think the change is fine. Not sure it is a must have for 13 but either way good to go > On Aug 6, 2019, at 12:20 PM, Patrick Concannon wrote: > > Hi, > > Would it be possible to have my fix for JDK-8228971 reviewed? > > The is a trivial doc-only fix which removes redundant hyphens for parameter descriptions for the Locale API doc. The intent is to push this to JDK 13. > > Further information on this bug can be found here: https://bugs.openjdk.java.net/browse/JDK-8228971 > > Webrev for fix: http://cr.openjdk.java.net/~dfuchs/pconcann/8228971/webrevs/webrev.1/ > > > Kind regards, > > Patrick > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From brent.christian at oracle.com Tue Aug 6 18:34:53 2019 From: brent.christian at oracle.com (Brent Christian) Date: Tue, 6 Aug 2019 11:34:53 -0700 Subject: RFR: 8226297: Dual-pivot quicksort improvements In-Reply-To: References: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> Message-ID: <64e3ebb1-095e-08c0-ffc1-125346e2c960@oracle.com> Hi, Laurent I'm not sure what exactly is causing the problem, but here's my hunch: In Vladimir's version of Arrays.java: MIN_ARRAY_SORT_GRAN NaturalOrder rangeCheck got moved around, but were unchanged. In the interest of keeping the change as simple as possible, I restored these to their original location, so they don't show up in my changes. That could confuse things when comparing diffs. One idea would be to restore those elements back in their original locations in your version, and re-generate your patch. I don't know if that would be less work than just comparing raw files. Alternatively, if it would be easiest for those familiar with the evolution of this fix to leave things where Vladimir had them, I can do that. Thanks, -Brent On 8/6/19 6:32 AM, Laurent Bourg?s wrote: > Hi Brent, > > Thank you for sponsoring this patch. > > I tried to compare your webrev against my latest (diff patch files) but > it gives me too many changes lines. > > Do you have another idea to see incremental changes only ? > (anyway I can compare raw files) > > Thanks, > Laurent > > Le lun. 5 ao?t 2019 ? 23:43, Brent Christian > a ?crit?: > > Hi, > > Please review Vladimir Yaroslavskiy's changes to DualPivotQuickSort > (seen earlier[1] on this alias).? I will be sponsoring this change. > > I have a webrev against jdk-jdk here: > http://cr.openjdk.java.net/~bchristi/8226297/webrev03-rfr/ > > (Note that I did a little re-ordering, and removed some superfluous > spacing changes, in order to simplify the webrev.? I've also included > Vladimir's FailedFloat[2] test case.) > > Information about benchmarking the changes was posted[3] recently. > An automated test run passes cleanly. > > Thanks! > -Brent > -- > 1. > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061363.html > > 2. > https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061513.html > > 3. > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061553.html > From raffaello.giulietti at gmail.com Tue Aug 6 19:07:39 2019 From: raffaello.giulietti at gmail.com (Raffaello Giulietti) Date: Tue, 6 Aug 2019 21:07:39 +0200 Subject: Are classes generated by LambdaMetafactory special? Message-ID: Hi Mandy, thanks for the deeper explanation: all this makes much sense. Greetings Raffaello >One property of a lambda proxy class is to be in the same nest as the >caller class as it's logically part of the caller class (as it may >access its private member). VM anonymous class is an interim >implementation solution until we provide a way to define a dynamically >generated class as a nestmate of an existing class. > >Second property of proxy classes is that proxy classes are not >symbolically referenced by other class and they are sole implementation >of some methods or some classes/interfaces. Proxy classes can be >defined as ordinary class while it has to ensure that the class name >must be unique in the global VM namespace. There is overhead generating >such a class to the system dictionary (not to mention loader >constraints). OTOH the name of a proxy class is only useful for >troubleshooting but entirely not needed at runtime. > >Mandy > >On 8/5/19 2:51 PM, Raffaello Giulietti wrote: >> Thanks R?mi and Mandy. >> >> I still don't get the full rationale on why lambda classes should be >> treated so specially but at least I now understand the current behavior. >> >> >> Greetings >> Raffaello >> >> >> >> >> On 05/08/2019 23.34, Remi Forax wrote: >>> It is intentional and the implementation details are planned to >>> change in the future >>> (there are already some patches in the valhalla/nestmates branch). >>> >>> The slash in the name is because you can create several classes from >>> the same bytecode by patching it at runtime, >>> the number after the slash is for each patching. >>> >>> Unlike a classical class, the class is not stored by a classloader in >>> order to be garbage collected sooner, hence you can not find it this >>> Class.forName. >>> >>> Intrumentation of a lambda proxy tends to fail because there is no >>> API to get the patched data and because the class name is not >>> resolvable (see above) so the easier solution was to mark those >>> classes as non-modifiable. This may change in the future. >>> >>> R?mi >>> >>> ----- Mail original ----- >>>> De: "raffaello giulietti" >>>> ?: "core-libs-dev" >>>> Envoy?: Lundi 5 Ao?t 2019 23:02:48 >>>> Objet: Are classes generated by LambdaMetafactory special? >>> >>>> Hello, >>>> >>>> experiment suggests that classes generated by >>>> java.lang.invoke.LambdaMetafactory are somewhat special: >>>> >>>> (1) getName() on the class returns a string of the form >>>> Xxx$$Lambda$nn/0xhhh >>>> where Xxx is a fully qualified class name (with periods '.' as package >>>> separators), nn is a decimal integer and hhh is a hex integer. What's >>>> the role of the slash '/' in the name? >>>> >>>> (2) An invocation of Class.forName() with that name fails. >>>> >>>> (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass() >>>> with that class as an argument returns false. >>>> >>>> Is this intentional or is it a bug? >>>> >>>> >>>> Greetings >>>> Raffaello > > From vlv.spb.ru at mail.ru Tue Aug 6 19:47:29 2019 From: vlv.spb.ru at mail.ru (=?UTF-8?B?VmxhZGltaXIgWWFyb3NsYXZza2l5?=) Date: Tue, 06 Aug 2019 22:47:29 +0300 Subject: =?UTF-8?B?UmVbMl06IFJGUjogODIyNjI5NzogRHVhbC1waXZvdCBxdWlja3NvcnQgaW1w?= =?UTF-8?B?cm92ZW1lbnRz?= In-Reply-To: <64e3ebb1-095e-08c0-ffc1-125346e2c960@oracle.com> References: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> <64e3ebb1-095e-08c0-ffc1-125346e2c960@oracle.com> Message-ID: <1565120849.689130733@f473.i.mail.ru> Hi Brent,, I moved Object sorting related stuff after primitives sorting methods to separate functionality logically. The order of methods in my version is: 1. primitives (sequential sorting) - int - long - byte - char - short - float - double 2. primitives (parallel sorting) - int - long - byte - char - short - float - double 3. Object sorting 4. Other methods Thank you, Vladimir >???????, 6 ??????? 2019, 21:35 +03:00 ?? Brent Christian : > >Hi, Laurent > >I'm not sure what exactly is causing the problem, but here's my hunch: > >In Vladimir's version of Arrays.java: >???MIN_ARRAY_SORT_GRAN >???NaturalOrder >???rangeCheck >got moved around, but were unchanged. > >In the interest of keeping the change as simple as possible, I restored >these to their original location, so they don't show up in my changes. >That could confuse things when comparing diffs. > >One idea would be to restore those elements back in their original >locations in your version, and re-generate your patch. I don't know if >that would be less work than just comparing raw files. > >Alternatively, if it would be easiest for those familiar with the >evolution of this fix to leave things where Vladimir had them, I can do >that. > >Thanks, >-Brent > >On 8/6/19 6:32 AM, Laurent Bourg?s wrote: >> Hi Brent, >> >> Thank you for sponsoring this patch. >> >> I tried to compare your webrev against my latest (diff patch files) but >> it gives me too many changes lines. >> >> Do you have another idea to see incremental changes only ? >> (anyway I can compare raw files) >> >> Thanks, >> Laurent >> >> Le lun. 5 ao?t 2019 ? 23:43, Brent Christian < brent.christian at oracle.com >> > a ?crit?: >> >> Hi, >> >> Please review Vladimir Yaroslavskiy's changes to DualPivotQuickSort >> (seen earlier[1] on this alias).? I will be sponsoring this change. >> >> I have a webrev against jdk-jdk here: >> http://cr.openjdk.java.net/~bchristi/8226297/webrev03-rfr/ >> >> (Note that I did a little re-ordering, and removed some superfluous >> spacing changes, in order to simplify the webrev.? I've also included >> Vladimir's FailedFloat[2] test case.) >> >> Information about benchmarking the changes was posted[3] recently. >> An automated test run passes cleanly. >> >> Thanks! >> -Brent >> -- >> 1. >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061363.html >> >> 2. >> https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061513.html >> >> 3. >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061553.html >> -- Vladimir Yaroslavskiy From joe.darcy at oracle.com Tue Aug 6 20:04:38 2019 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 6 Aug 2019 13:04:38 -0700 Subject: JDK 14 RFR of JDK-8202385: Annotation to mark serial-related fields and methods In-Reply-To: References: <83681e03-589b-b033-f0a1-75bfa3bb4114@oracle.com> <69ac9d9d-0fb8-5483-760c-97b3e6495539@oracle.com> Message-ID: Hi Roger, Revised webev ??? http://cr.openjdk.java.net/~darcy/8202385.5/ Diff of last two versions below. To ease review, I elected not to reflow the paragraphs at this time to reduce the number of lines of differences between the two versions. Several platform annotation types start there javadoc with "Indicates..." so I kept that pattern. It is true the serialization-defined fields and methods are accessed reflectively and may not be otherwise accessed. That seems more relevant to emphasize in the serialization spec itself, but it may be helpful to note here so I added one as requested. Cheers, -Joe 31c31 ? * Indicates that an annotated field or method is part of the {@linkplain 37c37,40 ? * validate method overriding. {@code Serializable} classes are encouraged to >? * use @Serial annotations to help a compiler catch >? * mis-declared serialization-related fields and methods, >? * mis-declarations that my otherwise be difficult to detect. 39c42 Specifically, annotations of this type are intended to be --- >? *

Specifically, annotations of this type should be 59c62 ? * Compilers are encouraged to validate that a method or field marked with a 61c64,65 ? * methods or fields declared in a meaningful context and issue a warning >? * if that is not the case. 86a91,94 >? * >? * Note that serialization mechanism accesses its designated fields >? * and methods reflectively and those fields and methods may appear >? * otherwise unused in a {@code Serializable} class. On 8/1/2019 2:40 PM, Roger Riggs wrote: > Hi Joe, > > It would be good to more closely define the semantics of the @Serial > annotation. > > Suggestion for the first sentence: > > "@Serial annotates each field or method specified by the Java > Object Serialization Specification of a {@linkplain > Serializable serializable} class." > > This annotation type is intended to allow compile-time checking of > serialization-related declarations, analogous to the checking enabled > by the {@link java.lang.Override} annotation type to validate method > overriding. > > It would be useful to describe that reflection is used to access and > use the fields and methods and they may? otherwise appear to be unused. > > A recommendation could be added in an @impleNote to apply @Serial to > each serialization defined method or field. > > $02, Roger > > On 7/13/19 1:16 PM, Joe Darcy wrote: >> PS I've uploaded an updated an iteration of the webrev >> >> http://cr.openjdk.java.net/~darcy/8202385.4/ >> >> to address. the syntactic concerns previously raised. I added >> >> ??? ...defined by the? Java Object Serialization >> Specification... >> >> which is the current name of the document and is similar to the style >> of reference made in java.io.Serializable. Offhand, I didn't know of >> the correct idiom to refer to the document as a working hyperlink, >> but would be switch to that idiom. >> >> Cheers, >> >> -Joe >> >> On 7/12/2019 8:19 PM, Joe Darcy wrote: >>> Hi Roger, >>> >>> On 7/12/2019 1:31 PM, Roger Riggs wrote: >>>> Hi Joe, >>>> >>>> As an annotation on a field or method, this is a use site annotation. >>> >>> >>> It is an annotation intended for the declarations of fields and >>> methods of Serializable types. >>> >>> >>>> From the description, the checks that could be added would only be >>>> done >>>> if the annotation was present and the annotation is a tag for existing >>>> fields and methods that are part of the serialization spec. >>> >>> >>> Right; the annotation is semantically only applicable to the fields >>> and methods associated with the serialization system. >>> >>> >>>> >>>> The signatures of the fields and methods can be known to the >>>> compiler independent >>>> of the annotation and produce the same warnings. >>>> So this looks like a case of trying to have belt and suspenders. >>>> >>>> If the checks are not done when the annotation is not present, then >>>> it will still be >>>> the case that incorrect or misused fields and methods will still >>>> escape detection. >>>> >>>> Though the details of the compiler check are outside of the scope >>>> of this annotation, >>>> it seems unclear whether the annotation is necessary. >>> >>> I have a prototype annotation processor to implement checks for >>> >>> ??? JDK-8202056: Expand serial warning to check for bad overloads of >>> serial-related methods and ineffectual fields >>> >>> The current version of the processor does not assume the presence of >>> java.io.Serial. The summarize the existing checking methodology: >>> >>> ??? If a type is Serialiazable and a field or method has a name >>> matching the names of one of the special fields or methods to >>> serialization, check that the field or method has the required >>> modifiers, type, and, the the case of methods, parameter types and >>> exception types. >>> >>> That is all well and good and represents a large fraction of the >>> checking of interest. However, it does not catch a mis-declaration >>> like "readobject" instead of "readObject". One could argue that >>> sufficiently thorough testing should catch that kind of error; >>> however, my impression is that thoroughness of testing is rare in >>> practice. I don't think it would be reasonable for javac to have >>> some kind of Hamming distance >>> (https://en.wikipedia.org/wiki/Hamming_distance) check between the >>> name of fields/methods and the name of the serialization related >>> fields methods to try to catch such mis-declarations. An annotation >>> like java.io.Serial is intended to allow the programmer to indicate >>> "yes, this is supposed to be one of the serialization related fields >>> or methods" and enable the compile to perform checks against that >>> category of error. >>> >>> >>>> >>>> Can the name of the annotation be more descriptive? >>>> Just "Serial" seems a bit too simple and does not have a strong >>>> binding to the Serialization classes and specification. >>>> Alternatives: >>>> ?? SerialMetadata >>>> ?? SerialControl >>>> ?? SerialFunction >>> >>> From the earlier design iterations "Serial" was chosen to be >>> evocative of the "@serial" javadoc tag. >>> >>> Thanks, >>> >>> -Joe >>> >>>> >>>> >>>> 39:? There should be a reference to the serialization specification >>>> for the definition >>>> of the fields and methods to make it clear where the authoritative >>>> identification is spec'd. >>>> >>>> 73-75:? Please align the

    and
tags on separate lines with >>>> matching indentation. >>>> >>>> 77: Extra leading space. >>>> >>>> Regards, Roger >>>> >>>> On 7/9/19 7:14 PM, Joe Darcy wrote: >>>>> Hello, >>>>> >>>>> Returning to some old work [1], please review the addition of a >>>>> java.io.Serial annotation type for JDK 14 to mark serial-related >>>>> fields and methods: >>>>> >>>>> ??? webrev: http://cr.openjdk.java.net/~darcy/8202385.3/ >>>>> ??? CSR: https://bugs.openjdk.java.net/browse/JDK-8217698 >>>>> >>>>> Thanks, >>>>> >>>>> -Joe >>>>> >>>>> [1] Previous review threads: >>>>> >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-May/053055.html >>>>> >>>>> >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054801.html >>>>> >>>>> >>>> > From lance.andersen at oracle.com Tue Aug 6 20:31:41 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Tue, 6 Aug 2019 16:31:41 -0400 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries Message-ID: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> Hi Please review the fix for https://bugs.openjdk.java.net/browse/JDK-8226530 , where ZipFile does not return the correct size from the CEN when the Zip64 Extended Information Extra Field is used to store the entry size The webrev can be found at http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html Mach5 jdk tier1-tier3 all pass Best Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From brent.christian at oracle.com Tue Aug 6 23:33:13 2019 From: brent.christian at oracle.com (Brent Christian) Date: Tue, 6 Aug 2019 16:33:13 -0700 Subject: RFR: 8226297: Dual-pivot quicksort improvements In-Reply-To: <1565120849.689130733@f473.i.mail.ru> References: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> <64e3ebb1-095e-08c0-ffc1-125346e2c960@oracle.com> <1565120849.689130733@f473.i.mail.ru> Message-ID: On 8/6/19 12:47 PM, Vladimir Yaroslavskiy wrote: > > I moved Object sorting related stuff after primitives sorting methods > to separate functionality logically. Sure, fine to keep that all together. I can move that back: http://cr.openjdk.java.net/~bchristi/8226297/webrev04/ > The order of methods in my version is: > > 1. primitives (sequential sorting) > - int > - long > - byte > - char > - short > - float > - double The order for sequential sorting of primitives in Arrays.java checked into the JDK is: - int - long * short * char * byte - float - double It simplifies the webrev for reviewing to keep that ordering, so that's what I've done. Thanks, -Brent > ???????, 6 ??????? 2019, 21:35 +03:00 ?? Brent Christian > : > > Hi, Laurent > > I'm not sure what exactly is causing the problem, but here's my hunch: > > In Vladimir's version of Arrays.java: > ???MIN_ARRAY_SORT_GRAN > ???NaturalOrder > ???rangeCheck > got moved around, but were unchanged. > > In the interest of keeping the change as simple as possible, I restored > these to their original location, so they don't show up in my changes. > That could confuse things when comparing diffs. > > One idea would be to restore those elements back in their original > locations in your version, and re-generate your patch. I don't know if > that would be less work than just comparing raw files. > > Alternatively, if it would be easiest for those familiar with the > evolution of this fix to leave things where Vladimir had them, I can do > that. > > Thanks, > -Brent > > On 8/6/19 6:32 AM, Laurent Bourg?s wrote: > > Hi Brent, > > > > Thank you for sponsoring this patch. > > > > I tried to compare your webrev against my latest (diff patch > files) but > > it gives me too many changes lines. > > > > Do you have another idea to see incremental changes only ? > > (anyway I can compare raw files) > > > > Thanks, > > Laurent > > > > Le lun. 5 ao?t 2019 ? 23:43, Brent Christian > > > > a ?crit?: > > > > Hi, > > > > Please review Vladimir Yaroslavskiy's changes to DualPivotQuickSort > > (seen earlier[1] on this alias).? I will be sponsoring this change. > > > > I have a webrev against jdk-jdk here: > > http://cr.openjdk.java.net/~bchristi/8226297/webrev03-rfr/ > > > > (Note that I did a little re-ordering, and removed some superfluous > > spacing changes, in order to simplify the webrev.? I've also included > > Vladimir's FailedFloat[2] test case.) > > > > Information about benchmarking the changes was posted[3] recently. > > An automated test run passes cleanly. > > > > Thanks! > > -Brent > > -- > > 1. > > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061363.html > > > > 2. > > > https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061513.html > > > > 3. > > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061553.html > > > > > > -- > Vladimir Yaroslavskiy From dmitry.chuyko at bell-sw.com Wed Aug 7 09:31:27 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Wed, 7 Aug 2019 12:31:27 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <8B1A8EDC-F9D7-4085-A34F-69100DBD7D5C@oracle.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> Message-ID: On 8/6/19 6:58 PM, Andrew Dinn wrote: > ...................... > No this behaviour is not currently tested. However, the only client at > present will never exercise that path so it is not critical to test it > now. I'd be happy to address testing of this behaviour as part of a > follow-up JIRA issue if you would be so good as to raise it. I say that > because I would very much like to get this functionality into a release > to simplify more extensive testing by Red Hat's middleware teams. It sounds reasonable, I'll create a tiny RFE after you push the JEP. > >> New MapFail test succeeds if proper IOException or any >> UnsupportedOperationException was caught but it aren't those situations >> actually 2 different ones that require distinct checks? If you say that >> is the situation when results depend on Linux version, it makes sense at >> least to put a comment in the test because it's really not trivial. > The documentation of the API under test makes it clear that both errors > can occur and under what circumstances. However, a note in the test will > certainly do no harm. I will insert one before checking in the patch. > >> Can PmemTest check IOException with message "map with mode MAP_SYNC >> unsupported" as a part of expected behavior, not just showing a test >> failure? > I don't see any need for this now that MapFail has been provided. Wit > that alterative in place for checking map failures on non-DAX file > syetems PmemTest is now primarily intended to test behaviour with a DAX > file system which it expects to have been set up in advance as described > in the main comment. So, the scenario you describe is not really an > intended usage and I woudl argue that a failure is the right way to > signal that. OK, finally got it, thank you. -Dmitry > > regards, > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From dmitry.chuyko at bell-sw.com Wed Aug 7 09:44:51 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Wed, 7 Aug 2019 12:44:51 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <3fb6e11f-4c95-8d88-3144-0c46c455a5db@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> <67c3888c-9058-9e5c-273e-7810b1c66e29@redhat.com> <3fb6e11f-4c95-8d88-3144-0c46c455a5db@redhat.com> Message-ID: <83466f7a-0436-940c-ca87-2a8b4a7c3e7d@bell-sw.com> On 8/6/19 7:09 PM, Andrew Dinn wrote: > Hello Dmitry, > > On 06/08/2019 15:25, Dmitry Chuyko wrote: >> One quick question about synchronization in unmappers. One of >> preliminary steps for Loom was to replace monitor usage by j.u.c locks >> for I/O to let fibers release carrier threads. For instance see >> JDK-8222774. Does it make sense to do the same in your new unmappers code? >> . . . >> [1] https://bugs.openjdk.java.net/browse/JDK-8222774 > The unmapper code is not strictly 'new' as regards its reliance on > synchronization. It merely follows and repeats the pattern employed in > the prior code that it has generalized (by splitting the original > Unmapper into two distinct flavours of subclass). > > If this poses a problem for Loom then it is a separate issue form the > one this JEP addresses. I think you should raise a new issue for that > change (just as you would have had to do before this change). I am sure > Alan Bateman will be happy to consider your proposal. Indeed, I would be > happy to implement it given his approval -- or leave it to you to do so > if you prefer. Agree, Loom has a long road to go. So I suppose such a change will be a part of larger work in sun.nio, and I or one of my colleagues will be happy to participate. Changes will probably be straightforward (e.g. JDK-8222882) but this synchronization is not covered by regression tests so I believe in this case you'll help to retry some of your ad-hoc testing or maybe some application tests you know about. -Dmitry > > regards, > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From Alan.Bateman at oracle.com Wed Aug 7 10:21:31 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 7 Aug 2019 11:21:31 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <3fb6e11f-4c95-8d88-3144-0c46c455a5db@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <3a3f9422-f81d-8ee2-5c07-687f2abe18df@redhat.com> <67c3888c-9058-9e5c-273e-7810b1c66e29@redhat.com> <3fb6e11f-4c95-8d88-3144-0c46c455a5db@redhat.com> Message-ID: On 06/08/2019 09:09, Andrew Dinn wrote: > : > The unmapper code is not strictly 'new' as regards its reliance on > synchronization. It merely follows and repeats the pattern employed in > the prior code that it has generalized (by splitting the original > Unmapper into two distinct flavours of subclass). > > If this poses a problem for Loom then it is a separate issue form the > one this JEP addresses. I think you should raise a new issue for that > change (just as you would have had to do before this change). I am sure > Alan Bateman will be happy to consider your proposal. Indeed, I would be > happy to implement it given his approval -- or leave it to you to do so > if you prefer. > I don't think we need to be concerned with any of this at this time. The unmapper is run by the reference handler thread. Also the synchronization here is for the counters so not the same thing as doing a blocking I/O operation while holding a monitor. At some point we'll examine all the file I/O operations as some of these are candidates for managed blockers, others are candidates for alternative implementations - there are bigger issues to resolve first and we've been trying to avoid carrying too many changes due to the complexity and effort needed to keep them in sync with the main line. -Alan From christoph.langer at sap.com Wed Aug 7 10:24:15 2019 From: christoph.langer at sap.com (Langer, Christoph) Date: Wed, 7 Aug 2019 10:24:15 +0000 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> Message-ID: Hi Lance, this looks good to me. Best regards Christoph > -----Original Message----- > From: core-libs-dev On Behalf > Of Lance Andersen > Sent: Dienstag, 6. August 2019 22:32 > To: core-libs-dev > Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries > > Hi > > Please review the fix for https://bugs.openjdk.java.net/browse/JDK- > 8226530 , where > ZipFile does not return the correct size from the CEN when the Zip64 > Extended Information Extra Field is used to store the entry size > > The webrev can be found at > http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html > > > Mach5 jdk tier1-tier3 all pass > > Best > Lance > > > > > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > From shade at redhat.com Wed Aug 7 10:43:47 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Wed, 7 Aug 2019 12:43:47 +0200 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> Message-ID: On 8/6/19 10:31 PM, Lance Andersen wrote: > The webrev can be found at http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html Looks good to me. I spot-tested my test cases that used to fail, and they all pass with this patch. Thanks! -Aleksey From dmitry.chuyko at bell-sw.com Wed Aug 7 11:02:47 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Wed, 7 Aug 2019 14:02:47 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <5c78b5d7-dc9e-fbbd-41a9-5139ed6ee32c@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> Message-ID: Andrew, New code is buildable and new MapFail test passes on different platforms except it fails on linux i386: ----------System.err:(12/712)---------- java.lang.Exception: unexpected message for IOExceptionInvalid argument ??? at MapFail.main(MapFail.java:60) ??? at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ??? at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ??? at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ??? at java.base/java.lang.reflect.Method.invoke(Method.java:565) ??? at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:246) ??? at java.base/java.lang.Thread.run(Thread.java:830) First there is a problem with the test, and a minor test issue is it would be good to add ": " before actual unexpected message. -Dmitry On 8/7/19 12:31 PM, Dmitry Chuyko wrote: > On 8/6/19 6:58 PM, Andrew Dinn wrote: >> ...................... >> No this behaviour is not currently tested. However, the only client at >> present will never exercise that path so it is not critical to test it >> now. I'd be happy to address testing of this behaviour as part of a >> follow-up JIRA issue if you would be so good as to raise it. I say that >> because I would very much like to get this functionality into a release >> to simplify more extensive testing by Red Hat's middleware teams. > It sounds reasonable, I'll create a tiny RFE after you push the JEP. >> >>> New MapFail test succeeds if proper IOException or any >>> UnsupportedOperationException was caught but it aren't those situations >>> actually 2 different ones that require distinct checks? If you say that >>> is the situation when results depend on Linux version, it makes >>> sense at >>> least to put a comment in the test because it's really not trivial. >> The documentation of the API under test makes it clear that both errors >> can occur and under what circumstances. However, a note in the test will >> certainly do no harm. I will insert one before checking in the patch. >> >>> Can PmemTest check IOException with message "map with mode MAP_SYNC >>> unsupported" as a part of expected behavior, not just showing a test >>> failure? >> I don't see any need for this now that MapFail has been provided. Wit >> that alterative in place for checking map failures on non-DAX file >> syetems PmemTest is now primarily intended to test behaviour with a DAX >> file system which it expects to have been set up in advance as described >> in the main comment. So, the scenario you describe is not really an >> intended usage and I woudl argue that a failure is the right way to >> signal that. > > OK, finally got it, thank you. > > -Dmitry > >> >> regards, >> >> >> Andrew Dinn >> ----------- >> Senior Principal Software Engineer >> Red Hat UK Ltd >> Registered in England and Wales under Company Registration No. 03798903 >> Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From dmitry.chuyko at bell-sw.com Wed Aug 7 12:04:28 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Wed, 7 Aug 2019 15:04:28 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <86d000f3-9eca-6089-5f7e-5698444d99ce@oracle.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> Message-ID: On 8/7/19 2:02 PM, Dmitry Chuyko wrote: > Andrew, > > New code is buildable and new MapFail test passes on different > platforms except it fails on linux i386: Ah, that even was x86_64 (sorry, mixed up results from automated system). I'll try to reproduce it by hand to see if there are any additional details. -Dmitry > > ----------System.err:(12/712)---------- > java.lang.Exception: unexpected message for IOExceptionInvalid argument > ??? at MapFail.main(MapFail.java:60) > ??? at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > ??? at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > ??? at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > ??? at java.base/java.lang.reflect.Method.invoke(Method.java:565) > ??? at > com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:246) > ??? at java.base/java.lang.Thread.run(Thread.java:830) > > First there is a problem with the test, > and a minor test issue is it would be good to add ": " before actual > unexpected message. > > -Dmitry > > On 8/7/19 12:31 PM, Dmitry Chuyko wrote: >> On 8/6/19 6:58 PM, Andrew Dinn wrote: >>> ...................... >>> No this behaviour is not currently tested. However, the only client at >>> present will never exercise that path so it is not critical to test it >>> now. I'd be happy to address testing of this behaviour as part of a >>> follow-up JIRA issue if you would be so good as to raise it. I say that >>> because I would very much like to get this functionality into a release >>> to simplify more extensive testing by Red Hat's middleware teams. >> It sounds reasonable, I'll create a tiny RFE after you push the JEP. >>> >>>> New MapFail test succeeds if proper IOException or any >>>> UnsupportedOperationException was caught but it aren't those >>>> situations >>>> actually 2 different ones that require distinct checks? If you say >>>> that >>>> is the situation when results depend on Linux version, it makes >>>> sense at >>>> least to put a comment in the test because it's really not trivial. >>> The documentation of the API under test makes it clear that both errors >>> can occur and under what circumstances. However, a note in the test >>> will >>> certainly do no harm. I will insert one before checking in the patch. >>> >>>> Can PmemTest check IOException with message "map with mode MAP_SYNC >>>> unsupported" as a part of expected behavior, not just showing a test >>>> failure? >>> I don't see any need for this now that MapFail has been provided. Wit >>> that alterative in place for checking map failures on non-DAX file >>> syetems PmemTest is now primarily intended to test behaviour with a DAX >>> file system which it expects to have been set up in advance as >>> described >>> in the main comment. So, the scenario you describe is not really an >>> intended usage and I woudl argue that a failure is the right way to >>> signal that. >> >> OK, finally got it, thank you. >> >> -Dmitry >> >>> >>> regards, >>> >>> >>> Andrew Dinn >>> ----------- >>> Senior Principal Software Engineer >>> Red Hat UK Ltd >>> Registered in England and Wales under Company Registration No. 03798903 >>> Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From pavel.rappo at oracle.com Wed Aug 7 12:47:40 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 7 Aug 2019 13:47:40 +0100 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection Message-ID: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> Hello, Please review the following change: http://cr.openjdk.java.net/~prappo/8217606/webrev.00/ The original issue seems to be an unintended consequence of JDK-8059009 [1]. The proposed change is based on the private patch by Chris Yin. I skimmed through the history of the `com.sun.jndi.ldap.Connection.useable` flag which dates back to JDK-4532408 [2] - Maintains a flag, 'useable', to indicate whether underlying network connection is useable. A connection starts out useable and becomes unuseable when an IO error is encountered while reading from/writing to it. and I believe that this field is a good fit for what Chris has proposed. Not only does the proposed change fix the issue, it also introduces a reusable test component for mocking/stubbing/faking an LDAP server. Chris and myself took some time in our private correspondence to shape that component such that it would allow to refactor some of the existing LDAP tests, should we decide to do so. As far as mach5 is concerned, the change looks good. Thanks, -Pavel ------------------------------------------------------------------------------- [1] https://bugs.openjdk.java.net/browse/JDK-8059009 [2] https://bugs.openjdk.java.net/browse/JDK-4532408 From adinn at redhat.com Wed Aug 7 13:29:33 2019 From: adinn at redhat.com (Andrew Dinn) Date: Wed, 7 Aug 2019 14:29:33 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> Message-ID: <785b8ac5-b62f-4e7d-eb42-a1532cf43992@redhat.com> On 07/08/2019 13:04, Dmitry Chuyko wrote: > On 8/7/19 2:02 PM, Dmitry Chuyko wrote: >> Andrew, >> >> New code is buildable and new MapFail test passes on different >> platforms except it fails on linux i386: > > Ah, that even was x86_64 (sorry, mixed up results from automated > system). I'll try to reproduce it by hand to see if there are any > additional details. Whew! Thank goodness it is x86_64. You had me very worried when you said this was i386 :-) So, this is indeed a problem with the test. The internal detail message for the IOException will vary according to the Linux kernel release. If MAP_SYNC is not supported by the Linux kernel it will embed the message you saw. If it is supported the message will be the one the test checks for. I think the best thing is for the test not to bother checking for a specific message. The important thing is that we should get either IOException or UnsupportedOperationException. Checking for the message is not really necessary. I will remove this check from the test. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From lance.andersen at oracle.com Wed Aug 7 13:30:30 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 7 Aug 2019 09:30:30 -0400 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> Message-ID: Hi Pavel, The change looks good. Nice job on the tests :-) > On Aug 7, 2019, at 8:47 AM, Pavel Rappo wrote: > > Hello, > > Please review the following change: > > http://cr.openjdk.java.net/~prappo/8217606/webrev.00/ > > The original issue seems to be an unintended consequence of JDK-8059009 [1]. > The proposed change is based on the private patch by Chris Yin. I skimmed > through the history of the `com.sun.jndi.ldap.Connection.useable` flag which > dates back to JDK-4532408 [2] > > - Maintains a flag, 'useable', to indicate whether underlying network > connection is useable. A connection starts out useable and becomes > unuseable when an IO error is encountered while reading from/writing > to it. > > and I believe that this field is a good fit for what Chris has proposed. > > Not only does the proposed change fix the issue, it also introduces a reusable > test component for mocking/stubbing/faking an LDAP server. Chris and myself took > some time in our private correspondence to shape that component such that it > would allow to refactor some of the existing LDAP tests, should we decide to > do so. > > As far as mach5 is concerned, the change looks good. > > Thanks, > -Pavel > > ------------------------------------------------------------------------------- > [1] https://bugs.openjdk.java.net/browse/JDK-8059009 > [2] https://bugs.openjdk.java.net/browse/JDK-4532408 > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From dmitry.chuyko at bell-sw.com Wed Aug 7 13:32:38 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Wed, 7 Aug 2019 16:32:38 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <7fe8d17d-6170-fcc9-b87a-eccfda2bb546@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> Message-ID: <432d6b0c-61ea-2f70-c1d8-e1d6bd89ce02@bell-sw.com> The test fails on some machines but does not fail on others, all 4.x kernels. The possible problem may be when build host and run host are different machines. This seems to be related to map0() implementation in FileChannelImpl.c in case MAP_SYNC and MAP_SHARED_VALIDATE are not defined (or defined). I also recommend to print original ioe stacktrace in the test. Adding such gives us useful information like this: java.io.IOException: Invalid argument at java.base/sun.nio.ch.FileChannelImpl.map0(Native Method) at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:1062) at MapFail.main(MapFail.java:48) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:830) java.lang.Exception: unexpected message for IOExceptionInvalid argument at MapFail.main(MapFail.java:61) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:830) Caused by: java.io.IOException: Invalid argument at java.base/sun.nio.ch.FileChannelImpl.map0(Native Method) at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:1062) at MapFail.main(MapFail.java:48) ... 6 more -Dmitry On 8/7/19 3:04 PM, Dmitry Chuyko wrote: > On 8/7/19 2:02 PM, Dmitry Chuyko wrote: >> Andrew, >> >> New code is buildable and new MapFail test passes on different >> platforms except it fails on linux i386: > > Ah, that even was x86_64 (sorry, mixed up results from automated > system). I'll try to reproduce it by hand to see if there are any > additional details. > > -Dmitry > >> >> ----------System.err:(12/712)---------- >> java.lang.Exception: unexpected message for IOExceptionInvalid argument >> ??? at MapFail.main(MapFail.java:60) >> ??? at >> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> ??? at >> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >> ??? at >> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> ??? at java.base/java.lang.reflect.Method.invoke(Method.java:565) >> ??? at >> com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:246) >> ??? at java.base/java.lang.Thread.run(Thread.java:830) >> >> First there is a problem with the test, >> and a minor test issue is it would be good to add ": " before actual >> unexpected message. >> >> -Dmitry >> >> On 8/7/19 12:31 PM, Dmitry Chuyko wrote: >>> On 8/6/19 6:58 PM, Andrew Dinn wrote: >>>> ...................... >>>> No this behaviour is not currently tested. However, the only client at >>>> present will never exercise that path so it is not critical to test it >>>> now. I'd be happy to address testing of this behaviour as part of a >>>> follow-up JIRA issue if you would be so good as to raise it. I say >>>> that >>>> because I would very much like to get this functionality into a >>>> release >>>> to simplify more extensive testing by Red Hat's middleware teams. >>> It sounds reasonable, I'll create a tiny RFE after you push the JEP. >>>> >>>>> New MapFail test succeeds if proper IOException or any >>>>> UnsupportedOperationException was caught but it aren't those >>>>> situations >>>>> actually 2 different ones that require distinct checks? If you say >>>>> that >>>>> is the situation when results depend on Linux version, it makes >>>>> sense at >>>>> least to put a comment in the test because it's really not trivial. >>>> The documentation of the API under test makes it clear that both >>>> errors >>>> can occur and under what circumstances. However, a note in the test >>>> will >>>> certainly do no harm. I will insert one before checking in the patch. >>>> >>>>> Can PmemTest check IOException with message "map with mode MAP_SYNC >>>>> unsupported" as a part of expected behavior, not just showing a test >>>>> failure? >>>> I don't see any need for this now that MapFail has been provided. Wit >>>> that alterative in place for checking map failures on non-DAX file >>>> syetems PmemTest is now primarily intended to test behaviour with a >>>> DAX >>>> file system which it expects to have been set up in advance as >>>> described >>>> in the main comment. So, the scenario you describe is not really an >>>> intended usage and I woudl argue that a failure is the right way to >>>> signal that. >>> >>> OK, finally got it, thank you. >>> >>> -Dmitry >>> >>>> >>>> regards, >>>> >>>> >>>> Andrew Dinn >>>> ----------- >>>> Senior Principal Software Engineer >>>> Red Hat UK Ltd >>>> Registered in England and Wales under Company Registration No. >>>> 03798903 >>>> Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From dmitry.chuyko at bell-sw.com Wed Aug 7 13:46:57 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Wed, 7 Aug 2019 16:46:57 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <785b8ac5-b62f-4e7d-eb42-a1532cf43992@redhat.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> <785b8ac5-b62f-4e7d-eb42-a1532cf43992@redhat.com> Message-ID: On 8/7/19 4:29 PM, Andrew Dinn wrote: > On 07/08/2019 13:04, Dmitry Chuyko wrote: >> On 8/7/19 2:02 PM, Dmitry Chuyko wrote: >>> Andrew, >>> >>> New code is buildable and new MapFail test passes on different >>> platforms except it fails on linux i386: >> Ah, that even was x86_64 (sorry, mixed up results from automated >> system). I'll try to reproduce it by hand to see if there are any >> additional details. > Whew! Thank goodness it is x86_64. You had me very worried when you said > this was i386 :-) > > So, this is indeed a problem with the test. The internal detail message > for the IOException will vary according to the Linux kernel release. If > MAP_SYNC is not supported by the Linux kernel it will embed the message > you saw. If it is supported the message will be the one the test checks for. > > I think the best thing is for the test not to bother checking for a > specific message. The important thing is that we should get either > IOException or UnsupportedOperationException. Checking for the message > is not really necessary. I will remove this check from the test. Ok, it will reduce complexity and likely let the test pass while still checking the same thing. -Dmitry > > regards, > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From adinn at redhat.com Wed Aug 7 14:06:36 2019 From: adinn at redhat.com (Andrew Dinn) Date: Wed, 7 Aug 2019 15:06:36 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <432d6b0c-61ea-2f70-c1d8-e1d6bd89ce02@bell-sw.com> References: <80da32b2-7acb-7b94-b82c-5dcd5cf95539@redhat.com> <7b39f68d-5698-4079-425c-c86ec161e361@oracle.com> <72810832-eb88-3418-f336-b95af95d9dcc@redhat.com> <20c8bbcb-2cd3-77af-cd40-29f7bd752166@oracle.com> <68566847-de80-82af-a928-d30c75f2b1b2@redhat.com> <892f3b0b-55f1-872d-15f4-5af907fa8437@redhat.com> <8f72d3b5-3a01-a7de-3b09-35571266a87d@redhat.com> <671c7ba1-9597-a990-190b-145d9cb5349e@redhat.com> <81098801-31b2-e3a8-5c25-043ab47c80bc@redhat.com> <023aa8d9-c0f7-9353-536e-3d1a91689cf3@bell-sw.com> <762feb23-763a-6240-4939-5dc663037a36@bell-sw.com> <7852c79b-0507-aefa-beb8-4cb10f874db3@redhat.com> <432d6b0c-61ea-2f70-c1d8-e1d6bd89ce02@bell-sw.com> Message-ID: <766bf750-2582-76f0-82d6-caaf1534ffcc@redhat.com> On 07/08/2019 14:32, Dmitry Chuyko wrote: > The test fails on some machines but does not fail on others, all 4.x > kernels. The possible problem may be when build host and run host are > different machines. This seems to be related to map0() implementation in > FileChannelImpl.c in case MAP_SYNC and MAP_SHARED_VALIDATE are not > defined (or defined). Ah yes, I see what is goign on now. It makes sense that you are seeing IOException: "Invalid argument" when passing MAP_SYNC to mmap on a Linux kernel that does not support those flags. Whereas on a Linux kernel which does support those flags you would expect to see the result i got IOException: "Operation not supported". That's because mmap with MAP_SYNC is not an appropriate operation to request on a non-DAX file. n.b. these messages come out of the relevant errno value. The AArch64 code produces an UnsupportedOperationException because the map with MAP_SYNC is being rejected in the Java code. That happens because I am running on an ARMV8.1 processor which does not support cache writeback to memory (ARMv8.2 chips are not yet generally available). The same applies for i386. It produces UnsupportedOperationException because the map with MAP_SYNC is being rejected in the Java code. The test needs tweaking to remedy this bad result and explain better the expected results. I don't think there is actually any great merit checking for a specific error message in the IOException so I will remove that check. The test should always expect IOException from x86, always expect UnsupportedOperationException from i386 and allow for either from AArch64. I have folded those fixes into the next version. > I also recommend to print original ioe stacktrace in the test. Adding > such gives us useful information like this: I have already done this too :-) regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From Roger.Riggs at oracle.com Wed Aug 7 15:52:49 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 7 Aug 2019 11:52:49 -0400 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> Message-ID: Hi, Nicely structured server framework, some details to cleanup. BaseLdapServer: 100: The new exception should have a message "Unexpected exception" or "server should no be running"... 158: Is printing the stack trace diagnostic or an error?, the exception is not rethrown and no message clarifying the context of the trace is printed. Stack traces should go to the log as well or instead of stderr. 103: plural? "accepting connection" -> "accepting connections" 109: "template method" doesn't describe the method well, the method is private and not overridable. ?? update the javadoc. 154: Handle connection should handle? Throwable and log and error with a printStackTrace. Since it is called in a Executor, otherwise unhandled exceptions will dissappear. 178:? logger() should be final. The subclass has no reason to override.? And it can be "public final". 238: isRunning should be synchronized(lock) to make sure each Thread sees the same value threads that update it in start() and close() LdapMessage: 90:? plural?? byte[] messages implies multiple messages, not just a buffer for a single message. 136: Why make a copy?? Is it expected to be modified?? Be clear in the javadoc about the copy. 230: can the same trick using BigInteger (line 124) be used to extract the length? 184:? hexToBin(ch) -> Character.digit(ch, 16); Reconnect: 54: there is no need for a stylized new Reconnect().run(). Just call a static method and keep the test simple. 105:? Tests that sleep are prone to intermittent failures on slow or delayed systems. It would be more reliable to countdown *after* the Connection was handled. As is, it might report success even if handleRequest failed for some reason. Since the test only needs to know that the connection is made, a CountDownLatch could be used. Await() with a large timeout would complete as soon as the connection was made and still catch the case where it never happened.? If there as some suspecion of too many connections that could be checked after the beforeConnectionHandled called countDown. Since new infra structure is being introduced, it should be considered to leverage TestNG testing facilities and Asserts? Regards, Roger On 8/7/19 9:30 AM, Lance Andersen wrote: > Hi Pavel, > > The change looks good. Nice job on the tests :-) > > >> On Aug 7, 2019, at 8:47 AM, Pavel Rappo wrote: >> >> Hello, >> >> Please review the following change: >> >> http://cr.openjdk.java.net/~prappo/8217606/webrev.00/ >> >> The original issue seems to be an unintended consequence of JDK-8059009 [1]. >> The proposed change is based on the private patch by Chris Yin. I skimmed >> through the history of the `com.sun.jndi.ldap.Connection.useable` flag which >> dates back to JDK-4532408 [2] >> >> - Maintains a flag, 'useable', to indicate whether underlying network >> connection is useable. A connection starts out useable and becomes >> unuseable when an IO error is encountered while reading from/writing >> to it. >> >> and I believe that this field is a good fit for what Chris has proposed. >> >> Not only does the proposed change fix the issue, it also introduces a reusable >> test component for mocking/stubbing/faking an LDAP server. Chris and myself took >> some time in our private correspondence to shape that component such that it >> would allow to refactor some of the existing LDAP tests, should we decide to >> do so. >> >> As far as mach5 is concerned, the change looks good. >> >> Thanks, >> -Pavel >> >> ------------------------------------------------------------------------------- >> [1] https://bugs.openjdk.java.net/browse/JDK-8059009 >> [2] https://bugs.openjdk.java.net/browse/JDK-4532408 >> > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From brian.burkhalter at oracle.com Wed Aug 7 16:21:01 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 7 Aug 2019 09:21:01 -0700 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> Message-ID: <78C1EA57-8BA8-4C90-9AF0-465067E3EB9A@oracle.com> Hi Lance, Looks good. I was wondering whether you might want to delete the files using jdk.test.lib.util.FileUtils.deleteFileIfExistsWithRetry() instead. Brian > On Aug 6, 2019, at 1:31 PM, Lance Andersen wrote: > > Please review the fix for https://bugs.openjdk.java.net/browse/JDK-8226530 >, where ZipFile does not return the correct size from the CEN when the Zip64 Extended Information Extra Field is used to store the entry size > > The webrev can be found at http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html > > > Mach5 jdk tier1-tier3 all pass From lance.andersen at oracle.com Wed Aug 7 16:33:21 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 7 Aug 2019 12:33:21 -0400 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <78C1EA57-8BA8-4C90-9AF0-465067E3EB9A@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> <78C1EA57-8BA8-4C90-9AF0-465067E3EB9A@oracle.com> Message-ID: <8B71F962-D9A5-4891-B69A-E0EE7DA4BA92@oracle.com> Hi Brian, > On Aug 7, 2019, at 12:21 PM, Brian Burkhalter wrote: > > Hi Lance, > > Looks good. thank you > I was wondering whether you might want to delete the files using jdk.test.lib.util.FileUtils.deleteFileIfExistsWithRetry() instead. I thought about it but decided it was not needed at least now given the files are only used by this test and the scratch directory will get cleaned up anyways. If you think I should add the library I can, just did not see it warranted at least for now. Just let me know :-) Thank you for the review > > Brian > >> On Aug 6, 2019, at 1:31 PM, Lance Andersen > wrote: >> >> Please review the fix for https://bugs.openjdk.java.net/browse/JDK-8226530 >, where ZipFile does not return the correct size from the CEN when the Zip64 Extended Information Extra Field is used to store the entry size >> >> The webrev can be found at http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html > >> >> Mach5 jdk tier1-tier3 all pass > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From brian.burkhalter at oracle.com Wed Aug 7 16:39:00 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 7 Aug 2019 09:39:00 -0700 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <8B71F962-D9A5-4891-B69A-E0EE7DA4BA92@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> <78C1EA57-8BA8-4C90-9AF0-465067E3EB9A@oracle.com> <8B71F962-D9A5-4891-B69A-E0EE7DA4BA92@oracle.com> Message-ID: <7A9975A4-F8F2-4494-909C-57B9E9DDA553@oracle.com> Hi Lance, > On Aug 7, 2019, at 9:33 AM, Lance Andersen wrote: > > I thought about it but decided it was not needed at least now given the files are only used by this test and the scratch directory will get cleaned up anyways. I thought that might be the case. > If you think I should add the library I can, just did not see it warranted at least for now. Just let me know :-) I think it?s fine. > Thank you for the review You?re welcome. Brian From alexey.semenyuk at oracle.com Wed Aug 7 16:47:29 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Wed, 7 Aug 2019 12:47:29 -0400 Subject: RFR: JDK-8229252 : Add descriptions to Windows jtreg tests In-Reply-To: <1b44fb45-2eef-cfe3-c5a2-ca1b72bc26d1@oracle.com> References: <1b44fb45-2eef-cfe3-c5a2-ca1b72bc26d1@oracle.com> Message-ID: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - Add comments to Windows jtreg tests to help SQE setup their testing. [1] https://bugs.openjdk.java.net/browse/JDK-8229252 [2] http://cr.openjdk.java.net/~asemenyuk/8229252/webrev.00/ Thanks, Alexey From pavel.rappo at oracle.com Wed Aug 7 17:18:13 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 7 Aug 2019 18:18:13 +0100 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> Message-ID: <015C7EC6-4B92-4356-A0F1-5F1648BB5934@oracle.com> Roger, thank you for looking at this. While we might hear (on some of your questions) from Chris soon, I just have to ask about this one > On 7 Aug 2019, at 16:52, Roger Riggs wrote: > > 238: isRunning should be synchronized(lock) to make sure each Thread sees the same value threads that update it in start() and close() What makes you think they can see something different? Even though the result of this call is immediately outdated, the changes to the state made by start/close should be propagated as per JMM. From Roger.Riggs at oracle.com Wed Aug 7 17:42:20 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 7 Aug 2019 13:42:20 -0400 Subject: ProcessHandle.Info startInstant() drifts with system time on Linux In-Reply-To: <1565177641838.63922@ssi-schaefer.com> References: <1565177641838.63922@ssi-schaefer.com> Message-ID: <3190f880-7a18-e931-cf36-864ed9a10586@oracle.com> Hi Markus, core-libs-dev at openjdk.java.net is the more appropriate list for this question. The ProcessHandle info is based directly on the OS information about a process, there is no separate information stored or kept. If Linux had a stable way to represent the start time it would be reflected in the ProcessHandle info. Changing the clock on any running system is fraught.? So many time related actions depend on linear and/or monotonic progression of time. Re-reading the boot time would be a performance hit and be subject to a race condition with setting time. The process handle also uses the start time to validate a ProcessHandle; since the cached boot time does not change the value is stable for that check. A workaround for your application might be to save the relative start time by reading the boot time directly from /proc or the relative start time from /proc. Roger On 8/7/19 7:34 AM, Duft Markus wrote: > Hey, > > > Just checking in to see whether this is a bug, or by design (and where I should report this if it /is/ a bug :)). > > > We discovered, that ProcessHandle.Info.startInstant() seems to be non-constant for a given long running process when restarting the Java VM. We have a deployment tool (https://bdeploy.io) which monitors processes and tries to recover running process information when starting up. The general process would be: > > > 1) Start BDeploy > > 2) BDeploy starts a child process, records its PID and startInstant to be able to find it again later > > 3) BDeploy is stopped (for whatever reason) and the child process keeps running (we do make sure that this is the case :)). > > 4) BDeploy is started again, tries to find running processes from its previous life to resume monitoring. > > 5) BDeploy reads PID and startInstant from a file, finds a ProcessHandle using the PID and compares the startInstant. This is to avoid finding wrong processes when PIDs wrap. > > > Now we have the problem that this does not work always. Analysis have led us to the point where we identifier NTPD or manual clock setting as the root cause. It seems that a system clock change will change the absolute timestamp of a process start. I had a look at the JDK sources and found that this is actually true :) Here is what I found out and documented on our own bugtracker: > > > The relevant java native method on l??inux does this: > > /* > * Try to stat and then open /proc/%d/stat > */ > snprintf(fn, sizeof fn, "/proc/%d/stat", pid); > > fp = fopen(fn, "r"); > ... > > // Scan the needed fields from status, retaining only ppid(4), > // utime (14), stime(15), starttime(22) > if (4 != sscanf(s, " %*c %d %*d %*d %*d %*d %*d %*u %*u %*u %*u %lu %lu %*d %*d %*d %*d %*d %*d %llu", > &parentPid, &utime, &stime, &start)) { > return 0; // not all values parsed; return error > } > > *totalTime = (utime + stime) * (jlong)(1000000000 / clock_ticks_per_second); > > *startTime = bootTime_ms + ((start * 1000) / clock_ticks_per_second); > ... > > > So the process start time is calculated rela?tive to the system kernel boot time. The boot time is calculated ONCE when starting the java VM like this: > > fp = fopen("/proc/stat", "r"); > ... > > while (getline(&line, &len, fp) != -1) { > if (sscanf(line, "btime %llu", &bootTime) == 1) { > break; > } > } > ... > > return bootTime * 1000; > > > However, the /proc/stat btime field does not seem to be constant. When I manually set the clock 2 minutes ahead, the btime field follows along, and is now two minutes later than before. Thus any system time correction (manual, ntpd, ...) will change the system boot time, which will make the timestamp different, but only after restarting the JVM. > > This is IMHO a bug in the JVM. The btime is a relative timestamp (uptime in nanoseconds if i'm correct). The absolute representation of this timestamp is calculated on the fly when reading /proc/stat from the current date/time (assuming that the current date/time is correct). This is not a problem (and correct!) for a human reader. The field should just never be taken to calculate another absolute timestamp, which java does... > > So we pseudo-have: > bootTime_ms > btime = current-clock-timestamp - kernel-uptime; > > proc-start = btime + process-uptime; > > All three variables are mutable and may (and will) change. If (and only if) kernel-uptime and process-uptime are updated correctly, calculating the absolute start-time will yield a reproducible result only as long as the system clock does not change. > > > I'm pretty sure this qualifies as bug, but not whether it's a java a kernel (or whatever) bug... Any advice, also how to get around this, would be greatly appreciated. I would really like to avoid hard-coding allowed drift ranges or something like this, especially as we'll be running into timezone, summer time, etc. issues AFAICT... > > > Cheers, > > Thanks for ANY help, > > Markus > > SSI Sch?fer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria > Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300 > Commercial Court: Landesgericht f?r Zivilrechtssachen Graz > Unsere Hinweise zum Umgang mit personenbezogenen Daten finden Sie hier. > You can find our information on the handling of personal data here. From Roger.Riggs at oracle.com Wed Aug 7 17:49:04 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 7 Aug 2019 13:49:04 -0400 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <015C7EC6-4B92-4356-A0F1-5F1648BB5934@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <015C7EC6-4B92-4356-A0F1-5F1648BB5934@oracle.com> Message-ID: Hi Pavel, You are correct, state is volatile. It seemed unnecessary/redundant since except for isRunning it is updated inside a synchronize(lock). The synchronized(socketList) is also unnecessary since it is already synchronized on lock. Roger On 8/7/19 1:18 PM, Pavel Rappo wrote: > Roger, thank you for looking at this. While we might hear (on some of your > questions) from Chris soon, I just have to ask about this one > >> On 7 Aug 2019, at 16:52, Roger Riggs wrote: >> >> 238: isRunning should be synchronized(lock) to make sure each Thread sees the same value threads that update it in start() and close() > What makes you think they can see something different? Even though the result of > this call is immediately outdated, the changes to the state made by start/close > should be propagated as per JMM. > > > From martinrb at google.com Wed Aug 7 18:37:42 2019 From: martinrb at google.com (Martin Buchholz) Date: Wed, 7 Aug 2019 11:37:42 -0700 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> Message-ID: Thanks for fixing this. Looks good. The APPNOTE.TXT spec is very confusing and surprising - it is not at all obvious why the size fields are required in the LOC ZIP64 header but not in the CEN ZIP64 header. I might include a reference to the sections in the PKWARE spec - 4.5.3 and 4.4.9 It seems to be related to encryption, which the openjdk implementation does not support. It seems to be still required to store 0xFFFFFFFF in the regular LOC header when the ZIP64 extra field is present, so it looks to me like the LOC and CEN handling can be unified, again assuming no encryption support. On Tue, Aug 6, 2019 at 1:32 PM Lance Andersen wrote: > Hi > > Please review the fix for https://bugs.openjdk.java.net/browse/JDK-8226530 > , where ZipFile does > not return the correct size from the CEN when the Zip64 Extended > Information Extra Field is used to store the entry size > > The webrev can be found at > http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html < > http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html> > > Mach5 jdk tier1-tier3 all pass > > Best > Lance > > > < > http://oracle.com/us/design/oracle-email-sig-198324.gif> > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > > From pavel.rappo at oracle.com Wed Aug 7 18:39:15 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 7 Aug 2019 19:39:15 +0100 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <015C7EC6-4B92-4356-A0F1-5F1648BB5934@oracle.com> Message-ID: > On 7 Aug 2019, at 18:49, Roger Riggs wrote: > > > > It seemed unnecessary/redundant since except for isRunning it is updated inside a synchronize(lock). Pardon, what seemed unnecessary? > The synchronized(socketList) is also unnecessary since it is already synchronized on lock. You are right, this is redundant, albeit harmless. It might be a leftover from one of the design iterations we've had when synchronization was more fine-grained. I'll remove all the synchronization on `socketList`. Thanks. From lance.andersen at oracle.com Wed Aug 7 18:52:05 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 7 Aug 2019 14:52:05 -0400 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> Message-ID: <90B3409F-3B00-46F8-A129-419BEB20C16C@oracle.com> Hi Martin, > On Aug 7, 2019, at 2:37 PM, Martin Buchholz wrote: > > Thanks for fixing this. Looks good. Thank you. > The APPNOTE.TXT spec is very confusing and surprising - it is not at all obvious why the size fields are required in the LOC ZIP64 header but not in the CEN ZIP64 header. > I might include a reference to the sections in the PKWARE spec - 4.5.3 and 4.4.9 > It seems to be related to encryption, which the openjdk implementation does not support. > It seems to be still required to store 0xFFFFFFFF in the regular LOC header when the ZIP64 extra field is present, so it looks to me like the LOC and CEN handling can be unified, again assuming no encryption support. I wanted to be careful as to not tweak this code too much in one pass given its age. So its on my todo list to spend some more time looking at this but moving in small steps to not rock the apple cart :-) Yes, I do find APPNOTE.TXT somewhat confusing along with the references to info-zip; I really want to tread lightly while I continue to become more familiar with this code. Hope that makes sense :-) > > On Tue, Aug 6, 2019 at 1:32 PM Lance Andersen > wrote: > Hi > > Please review the fix for https://bugs.openjdk.java.net/browse/JDK-8226530 >, where ZipFile does not return the correct size from the CEN when the Zip64 Extended Information Extra Field is used to store the entry size > > The webrev can be found at http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html > > > Mach5 jdk tier1-tier3 all pass > > Best > Lance > > > > > > > >Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From alexander.matveev at oracle.com Wed Aug 7 19:08:50 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Wed, 7 Aug 2019 12:08:50 -0700 Subject: RFR: JDK-8229252 : Add descriptions to Windows jtreg tests In-Reply-To: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> References: <1b44fb45-2eef-cfe3-c5a2-ca1b72bc26d1@oracle.com> <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: <238e507a-6a5f-5276-d469-6de9018691f4@oracle.com> Hi Alexey, Looks good. Thanks, Alexander On 8/7/2019 9:47 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Add comments to Windows jtreg tests to help SQE setup their testing. > > [1] https://bugs.openjdk.java.net/browse/JDK-8229252 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229252/webrev.00/ > > Thanks, > Alexey > From martinrb at google.com Wed Aug 7 19:41:28 2019 From: martinrb at google.com (Martin Buchholz) Date: Wed, 7 Aug 2019 12:41:28 -0700 Subject: RFR 8226530: ZipFile reads wrong entry size from ZIP64 entries In-Reply-To: <90B3409F-3B00-46F8-A129-419BEB20C16C@oracle.com> References: <8BDEF87A-B6BF-4335-B646-74EEAA4C10AB@oracle.com> <90B3409F-3B00-46F8-A129-419BEB20C16C@oracle.com> Message-ID: Thanks for joining the small club of zip implementers. No one likes the ZIP file format, but the power of a legacy data interchange format is great. On Wed, Aug 7, 2019 at 11:54 AM Lance Andersen wrote: > Hi Martin, > > On Aug 7, 2019, at 2:37 PM, Martin Buchholz wrote: > > Thanks for fixing this. Looks good. > > > Thank you. > > > The APPNOTE.TXT spec is very confusing and surprising - it is not at all > obvious why the size fields are required in the LOC ZIP64 header but not in > the CEN ZIP64 header. > I might include a reference to the sections in the PKWARE spec - 4.5.3 and > 4.4.9 > It seems to be related to encryption, which the openjdk implementation > does not support. > It seems to be still required to store 0xFFFFFFFF in the regular LOC > header when the ZIP64 extra field is present, so it looks to me like the > LOC and CEN handling can be unified, again assuming no encryption support. > > > I wanted to be careful as to not tweak this code too much in one pass > given its age. So its on my todo list to spend some more time looking at > this but moving in small steps to not rock the apple cart :-) > > Yes, I do find APPNOTE.TXT somewhat confusing along with the references to > info-zip; I really want to tread lightly while I continue to become more > familiar with this code. > > Hope that makes sense :-) > > > > On Tue, Aug 6, 2019 at 1:32 PM Lance Andersen > wrote: > >> Hi >> >> Please review the fix for >> https://bugs.openjdk.java.net/browse/JDK-8226530 < >> https://bugs.openjdk.java.net/browse/JDK-8226530>, where ZipFile does >> not return the correct size from the CEN when the Zip64 Extended >> Information Extra Field is used to store the entry size >> >> The webrev can be found at >> http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html < >> http://cr.openjdk.java.net/~lancea/8226530/webrev.00/index.html> >> >> Mach5 jdk tier1-tier3 all pass >> >> Best >> Lance >> >> >> < >> http://oracle.com/us/design/oracle-email-sig-198324.gif> >> Lance >> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> >> > > > > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > > From naoto.sato at oracle.com Wed Aug 7 20:12:17 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Wed, 7 Aug 2019 13:12:17 -0700 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> Message-ID: Ping. Naoto On 7/31/19 5:57 PM, naoto.sato at oracle.com wrote: > Hi, > > Please review the fix to the following issue: > > https://bugs.openjdk.java.net/browse/JDK-8215181 > > The proposed changeset is located at: > > https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ > > This is to enable "accounting" style currency formatting (negative > values in parentheses) with CLDR. > > Naoto From lance.andersen at oracle.com Wed Aug 7 20:17:26 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 7 Aug 2019 16:17:26 -0400 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> Message-ID: <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> Hi Naoto, I looked over the proposed changes and the bug. They seem reasonable to me. Best Lance > On Aug 7, 2019, at 4:12 PM, naoto.sato at oracle.com wrote: > > Ping. > > Naoto > > On 7/31/19 5:57 PM, naoto.sato at oracle.com wrote: >> Hi, >> Please review the fix to the following issue: >> https://bugs.openjdk.java.net/browse/JDK-8215181 >> The proposed changeset is located at: >> https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ >> This is to enable "accounting" style currency formatting (negative values in parentheses) with CLDR. >> Naoto Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From lance.andersen at oracle.com Wed Aug 7 20:20:52 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 7 Aug 2019 16:20:52 -0400 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> Message-ID: Hi again Naoto, I meant to ask is there a CSR due to the change in the javadoc for NumberFormat? If not, there probably should > On Aug 7, 2019, at 4:17 PM, Lance Andersen wrote: > > Hi Naoto, > > I looked over the proposed changes and the bug. They seem reasonable to me. > > Best > Lance >> On Aug 7, 2019, at 4:12 PM, naoto.sato at oracle.com wrote: >> >> Ping. >> >> Naoto >> >> On 7/31/19 5:57 PM, naoto.sato at oracle.com wrote: >>> Hi, >>> Please review the fix to the following issue: >>> https://bugs.openjdk.java.net/browse/JDK-8215181 >>> The proposed changeset is located at: >>> https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ >>> This is to enable "accounting" style currency formatting (negative values in parentheses) with CLDR. >>> Naoto > > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From naoto.sato at oracle.com Wed Aug 7 20:24:29 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Wed, 7 Aug 2019 13:24:29 -0700 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> Message-ID: <3a190aa4-cf6b-ba1c-4dfb-77bdea5b3712@oracle.com> Thanks for the review, Lance. Yes, CSR is needed and it is already approved: https://bugs.openjdk.java.net/browse/JDK-8218770 Naoto On 8/7/19 1:20 PM, Lance Andersen wrote: > Hi again Naoto, > > I meant to ask is there a CSR due to the change in the javadoc for > NumberFormat? ?If not, there probably should > > >> On Aug 7, 2019, at 4:17 PM, Lance Andersen > > wrote: >> >> Hi Naoto, >> >> I looked over the proposed changes and the bug. ?They seem reasonable >> to me. >> >> Best >> Lance >>> On Aug 7, 2019, at 4:12 PM, naoto.sato at oracle.com >>> wrote: >>> >>> Ping. >>> >>> Naoto >>> >>> On 7/31/19 5:57 PM, naoto.sato at oracle.com >>> wrote: >>>> Hi, >>>> Please review the fix to the following issue: >>>> https://bugs.openjdk.java.net/browse/JDK-8215181 >>>> The proposed changeset is located at: >>>> https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ >>>> This is to enable "accounting" style currency formatting (negative >>>> values in parentheses) with CLDR. >>>> Naoto >> >> >> >> >> Lance >> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> >> > > > > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From lance.andersen at oracle.com Wed Aug 7 20:26:56 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 7 Aug 2019 16:26:56 -0400 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: <3a190aa4-cf6b-ba1c-4dfb-77bdea5b3712@oracle.com> References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> <3a190aa4-cf6b-ba1c-4dfb-77bdea5b3712@oracle.com> Message-ID: awesome, I must have missed it thinking it was a bug when I reviewed the bug itself (long day :-) ) ?. > On Aug 7, 2019, at 4:24 PM, naoto.sato at oracle.com wrote: > > Thanks for the review, Lance. > > Yes, CSR is needed and it is already approved: > > https://bugs.openjdk.java.net/browse/JDK-8218770 > > Naoto > > On 8/7/19 1:20 PM, Lance Andersen wrote: >> Hi again Naoto, >> I meant to ask is there a CSR due to the change in the javadoc for NumberFormat? If not, there probably should >>> On Aug 7, 2019, at 4:17 PM, Lance Andersen > wrote: >>> >>> Hi Naoto, >>> >>> I looked over the proposed changes and the bug. They seem reasonable to me. >>> >>> Best >>> Lance >>>> On Aug 7, 2019, at 4:12 PM, naoto.sato at oracle.com wrote: >>>> >>>> Ping. >>>> >>>> Naoto >>>> >>>> On 7/31/19 5:57 PM, naoto.sato at oracle.com wrote: >>>>> Hi, >>>>> Please review the fix to the following issue: >>>>> https://bugs.openjdk.java.net/browse/JDK-8215181 >>>>> The proposed changeset is located at: >>>>> https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ >>>>> This is to enable "accounting" style currency formatting (negative values in parentheses) with CLDR. >>>>> Naoto >>> >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >>> >>> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From bourges.laurent at gmail.com Wed Aug 7 20:43:42 2019 From: bourges.laurent at gmail.com (=?UTF-8?Q?Laurent_Bourg=C3=A8s?=) Date: Wed, 7 Aug 2019 22:43:42 +0200 Subject: RFR: 8226297: Dual-pivot quicksort improvements In-Reply-To: References: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> <64e3ebb1-095e-08c0-ffc1-125346e2c960@oracle.com> <1565120849.689130733@f473.i.mail.ru> Message-ID: Hi Brent, I made a manual comparison of your webrev.4 and my previous patch. - I noticed plenty of javadoc / comment changes that seem totally appropriate in Arrays class: ok for me. - You also fixed the problem with the ForkJoinPool field: good. - No change in the DualPivotQuickSort class except copyright header: OK (you reverted reordering I suppose) My former question was more about the process: how to produce incremental web revs easily ? it is easier for me to have a quick look, than inspecting the global patch where DPQS class was almost rewritten. Thanks for your help, Laurent Le mer. 7 ao?t 2019 ? 01:33, Brent Christian a ?crit : > On 8/6/19 12:47 PM, Vladimir Yaroslavskiy wrote: > > > > I moved Object sorting related stuff after primitives sorting methods > > to separate functionality logically. > > Sure, fine to keep that all together. I can move that back: > http://cr.openjdk.java.net/~bchristi/8226297/webrev04/ > > > The order of methods in my version is: > > > > 1. primitives (sequential sorting) > > - int > > - long > > - byte > > - char > > - short > > - float > > - double > > The order for sequential sorting of primitives in Arrays.java checked > into the JDK is: > > - int > - long > * short > * char > * byte > - float > - double > > It simplifies the webrev for reviewing to keep that ordering, so that's > what I've done. > > Thanks, > -Brent > > > ???????, 6 ??????? 2019, 21:35 +03:00 ?? Brent Christian > > : > > > > Hi, Laurent > > > > I'm not sure what exactly is causing the problem, but here's my > hunch: > > > > In Vladimir's version of Arrays.java: > > MIN_ARRAY_SORT_GRAN > > NaturalOrder > > rangeCheck > > got moved around, but were unchanged. > > > > In the interest of keeping the change as simple as possible, I > restored > > these to their original location, so they don't show up in my > changes. > > That could confuse things when comparing diffs. > > > > One idea would be to restore those elements back in their original > > locations in your version, and re-generate your patch. I don't know > if > > that would be less work than just comparing raw files. > > > > Alternatively, if it would be easiest for those familiar with the > > evolution of this fix to leave things where Vladimir had them, I can > do > > that. > > > > Thanks, > > -Brent > > > > On 8/6/19 6:32 AM, Laurent Bourg?s wrote: > > > Hi Brent, > > > > > > Thank you for sponsoring this patch. > > > > > > I tried to compare your webrev against my latest (diff patch > > files) but > > > it gives me too many changes lines. > > > > > > Do you have another idea to see incremental changes only ? > > > (anyway I can compare raw files) > > > > > > Thanks, > > > Laurent > > > > > > Le lun. 5 ao?t 2019 ? 23:43, Brent Christian > > > > > > a ?crit : > > > > > > Hi, > > > > > > Please review Vladimir Yaroslavskiy's changes to > DualPivotQuickSort > > > (seen earlier[1] on this alias). I will be sponsoring this > change. > > > > > > I have a webrev against jdk-jdk here: > > > http://cr.openjdk.java.net/~bchristi/8226297/webrev03-rfr/ > > > > > > (Note that I did a little re-ordering, and removed some > superfluous > > > spacing changes, in order to simplify the webrev. I've also > included > > > Vladimir's FailedFloat[2] test case.) > > > > > > Information about benchmarking the changes was posted[3] recently. > > > An automated test run passes cleanly. > > > > > > Thanks! > > > -Brent > > > -- > > > 1. > > > > > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061363.html > > > > > > 2. > > > > > > https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061513.html > > > > > > 3. > > > > > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061553.html > > > > > > > > > > > -- > > Vladimir Yaroslavskiy > -- -- Laurent Bourg?s From Roger.Riggs at oracle.com Wed Aug 7 21:14:30 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 7 Aug 2019 17:14:30 -0400 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> <3a190aa4-cf6b-ba1c-4dfb-77bdea5b3712@oracle.com> Message-ID: +1, Bundle.java:226:? there is a slight preference for String.isEmpty() over? String.length() == 0 Thanks, Roger On 8/7/19 4:26 PM, Lance Andersen wrote: > awesome, I must have missed it thinking it was a bug when I reviewed the bug itself (long day :-) ) ?. > >> On Aug 7, 2019, at 4:24 PM, naoto.sato at oracle.com wrote: >> >> Thanks for the review, Lance. >> >> Yes, CSR is needed and it is already approved: >> >> https://bugs.openjdk.java.net/browse/JDK-8218770 >> >> Naoto >> >> On 8/7/19 1:20 PM, Lance Andersen wrote: >>> Hi again Naoto, >>> I meant to ask is there a CSR due to the change in the javadoc for NumberFormat? If not, there probably should >>>> On Aug 7, 2019, at 4:17 PM, Lance Andersen > wrote: >>>> >>>> Hi Naoto, >>>> >>>> I looked over the proposed changes and the bug. They seem reasonable to me. >>>> >>>> Best >>>> Lance >>>>> On Aug 7, 2019, at 4:12 PM, naoto.sato at oracle.com wrote: >>>>> >>>>> Ping. >>>>> >>>>> Naoto >>>>> >>>>> On 7/31/19 5:57 PM, naoto.sato at oracle.com wrote: >>>>>> Hi, >>>>>> Please review the fix to the following issue: >>>>>> https://bugs.openjdk.java.net/browse/JDK-8215181 >>>>>> The proposed changeset is located at: >>>>>> https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ >>>>>> This is to enable "accounting" style currency formatting (negative values in parentheses) with CLDR. >>>>>> Naoto >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >>>> >>>> >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From naoto.sato at oracle.com Wed Aug 7 21:31:58 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Wed, 7 Aug 2019 14:31:58 -0700 Subject: [14] RFR: 8215181: Accounting currency format support In-Reply-To: References: <9fa22b0e-5d07-964f-d95e-f7c33e924df6@oracle.com> <584A990F-6F64-4C47-86E6-5B1121F0DFF0@oracle.com> <3a190aa4-cf6b-ba1c-4dfb-77bdea5b3712@oracle.com> Message-ID: Thanks, Roger. I will replace the string length check as you suggested before push. Naoto On 8/7/19 2:14 PM, Roger Riggs wrote: > +1, > > Bundle.java:226:? there is a slight preference for String.isEmpty() > over? String.length() == 0 > > Thanks, Roger > > On 8/7/19 4:26 PM, Lance Andersen wrote: >> awesome, I must have missed it thinking it was a bug when I reviewed >> the bug itself (long day :-) ) ?. >> >>> On Aug 7, 2019, at 4:24 PM, naoto.sato at oracle.com wrote: >>> >>> Thanks for the review, Lance. >>> >>> Yes, CSR is needed and it is already approved: >>> >>> https://bugs.openjdk.java.net/browse/JDK-8218770 >>> >>> Naoto >>> >>> On 8/7/19 1:20 PM, Lance Andersen wrote: >>>> Hi again Naoto, >>>> I meant to ask is there a CSR due to the change in the javadoc for >>>> NumberFormat?? If not, there probably should >>>>> On Aug 7, 2019, at 4:17 PM, Lance Andersen >>>>> > wrote: >>>>> >>>>> Hi Naoto, >>>>> >>>>> I looked over the proposed changes and the bug.? They seem >>>>> reasonable to me. >>>>> >>>>> Best >>>>> Lance >>>>>> On Aug 7, 2019, at 4:12 PM, naoto.sato at oracle.com >>>>>> wrote: >>>>>> >>>>>> Ping. >>>>>> >>>>>> Naoto >>>>>> >>>>>> On 7/31/19 5:57 PM, naoto.sato at oracle.com >>>>>> wrote: >>>>>>> Hi, >>>>>>> Please review the fix to the following issue: >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8215181 >>>>>>> The proposed changeset is located at: >>>>>>> https://cr.openjdk.java.net/~naoto/8215181/webrev.00/ >>>>>>> This is to enable "accounting" style currency formatting >>>>>>> (negative values in parentheses) with CLDR. >>>>>>> Naoto >>>>> >>>>> >>>>> >>>>> Lance >>>>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> Lance >>>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >> ? >> ? >> >> ? Lance >> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> > From andy.herrick at oracle.com Wed Aug 7 22:31:30 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Wed, 7 Aug 2019 18:31:30 -0400 Subject: RFR: JDK-8229252 : Add descriptions to Windows jtreg tests In-Reply-To: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> References: <1b44fb45-2eef-cfe3-c5a2-ca1b72bc26d1@oracle.com> <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: <34b032c4-e08d-4a31-1095-cdcec8a4e0b3@oracle.com> this is fine. /Andy On 8/7/2019 12:47 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Add comments to Windows jtreg tests to help SQE setup their testing. > > [1] https://bugs.openjdk.java.net/browse/JDK-8229252 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229252/webrev.00/ > > Thanks, > Alexey > From ivan.gerasimov at oracle.com Thu Aug 8 00:17:49 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 7 Aug 2019 17:17:49 -0700 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information Message-ID: Hello! The exception thrown by substring(int) may look confusing. For example it produces "String index out of range: -1" when the index is length+1. It is proposed to make the error message more clear, similar to what we have for substring(int, int). BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ Would you please help review? -- With kind regards, Ivan Gerasimov From thejasvi.v.voniadka at oracle.com Thu Aug 8 00:55:44 2019 From: thejasvi.v.voniadka at oracle.com (Thejasvi Voniadka) Date: Wed, 7 Aug 2019 17:55:44 -0700 (PDT) Subject: RFR: 8158880: test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale In-Reply-To: References: Message-ID: Hi Naoto, Thank you for the review. This change has now been pushed. -----Original Message----- From: Naoto Sato Sent: Thursday, August 01, 2019 9:43 PM To: Thejasvi Voniadka ; i18n-dev at openjdk.java.net; core-libs-dev at openjdk.java.net Subject: Re: RFR: 8158880: test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale Looks good to me, Thejasvi. Naoto On 8/1/19 6:42 AM, Thejasvi Voniadka wrote: > Hi, > > Request you to please review this change. > > JBS: https://bugs.openjdk.java.net/browse/JDK-8158880 (test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale) > > Description: The test " test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java# test_appendZoneText_parseGenericTimeZonePatterns" fails if run on certain locales (such as "ja"). At present the test does not enforce a specific locale for the DateTimeFormatter, and hence the machine's locale is used as the default. This could cause parsing mismatches when run on non-US locales. The fix is to set the locale explicitly in the test. > > Webrev: http://cr.openjdk.java.net/~vagarwal/8158880/webrev.0 > > > From Markus.Duft at ssi-schaefer.com Thu Aug 8 05:52:23 2019 From: Markus.Duft at ssi-schaefer.com (Duft Markus) Date: Thu, 8 Aug 2019 05:52:23 +0000 Subject: ProcessHandle.Info startInstant() drifts with system time on Linux In-Reply-To: <3190f880-7a18-e931-cf36-864ed9a10586@oracle.com> References: <1565177641838.63922@ssi-schaefer.com>, <3190f880-7a18-e931-cf36-864ed9a10586@oracle.com> Message-ID: <1565243543801.4322@ssi-schaefer.com> Hey, Thanks for the answer and information. OK - I understand that Linux does not provide a stable absolute timestamp per process to read, so the JVM tries to come up with one. Would it be possible somehow to provide the user with another API to uniquely identify a process (just any arbitrary "checksum" like value which identifies a handle even after VM restart)? Linux does have a stable /relative/ timestamp. Together with the PID, this is a (as-good-as-)unique ID (also on Windows (etc.) PID and starttime may it be relative to boot or absolute would be sufficient to identify any process). Right now I ended up with this piece of code: ---------------------- private long internalGetProcessStartTimestampCorrected(long pid, Instant reportedStartTime) { if (OsHelper.getRunningOs() == OperatingSystem.LINUX) { try { // read the single line from /proc/[pid]/stat, field no 22 is the start time. String line = new String(Files.readAllBytes(Paths.get("/proc", String.valueOf(pid), "stat")), StandardCharsets.UTF_8); String[] split = line.split(" "); return Long.valueOf(split[21]); } catch (Exception e) { logger.log(l -> l.warn("Cannot read corrected start time of process, PID = {}.", pid, e)); } } // we (for now) trust the OS to deliver a stable absolute timestamp. return reportedStartTime.toEpochMilli(); } ---------------------- This takes the Instant reported by ProcessHandle.Info and returns a stable value which can be used to later on verify that the PID referrs to the same process still. The value is read from /proc/[pid]/stat in exactly the same way as the JVM does as well, just not adding the boot time here, so the timestamp is relative but stable, which is the important part. I'm aware that there is /some/ potential to get it wrong when rebooting and recovering a process that has the same PID and same offset, but I think the risk is negligible... However this solution feels a little odd. I would prefer to not directly read OS dependent things, but rather have the JVM help me in unique identification. Any Ideas? Comments? I am aware that timekeeping is /always/ a pain, especially when dependent on the clock (timezone, DST, ...). Cheers, Thanks, Markus ________________________________________ From: jdk-dev on behalf of Roger Riggs Sent: Wednesday, August 7, 2019 19:42 To: core-libs-dev Subject: Re: ProcessHandle.Info startInstant() drifts with system time on Linux Hi Markus, core-libs-dev at openjdk.java.net is the more appropriate list for this question. The ProcessHandle info is based directly on the OS information about a process, there is no separate information stored or kept. If Linux had a stable way to represent the start time it would be reflected in the ProcessHandle info. Changing the clock on any running system is fraught. So many time related actions depend on linear and/or monotonic progression of time. Re-reading the boot time would be a performance hit and be subject to a race condition with setting time. The process handle also uses the start time to validate a ProcessHandle; since the cached boot time does not change the value is stable for that check. A workaround for your application might be to save the relative start time by reading the boot time directly from /proc or the relative start time from /proc. Roger On 8/7/19 7:34 AM, Duft Markus wrote: > Hey, > > > Just checking in to see whether this is a bug, or by design (and where I should report this if it /is/ a bug :)). > > > We discovered, that ProcessHandle.Info.startInstant() seems to be non-constant for a given long running process when restarting the Java VM. We have a deployment tool (https://bdeploy.io) which monitors processes and tries to recover running process information when starting up. The general process would be: > > > 1) Start BDeploy > > 2) BDeploy starts a child process, records its PID and startInstant to be able to find it again later > > 3) BDeploy is stopped (for whatever reason) and the child process keeps running (we do make sure that this is the case :)). > > 4) BDeploy is started again, tries to find running processes from its previous life to resume monitoring. > > 5) BDeploy reads PID and startInstant from a file, finds a ProcessHandle using the PID and compares the startInstant. This is to avoid finding wrong processes when PIDs wrap. > > > Now we have the problem that this does not work always. Analysis have led us to the point where we identifier NTPD or manual clock setting as the root cause. It seems that a system clock change will change the absolute timestamp of a process start. I had a look at the JDK sources and found that this is actually true :) Here is what I found out and documented on our own bugtracker: > > > The relevant java native method on l??inux does this: > > /* > * Try to stat and then open /proc/%d/stat > */ > snprintf(fn, sizeof fn, "/proc/%d/stat", pid); > > fp = fopen(fn, "r"); > ... > > // Scan the needed fields from status, retaining only ppid(4), > // utime (14), stime(15), starttime(22) > if (4 != sscanf(s, " %*c %d %*d %*d %*d %*d %*d %*u %*u %*u %*u %lu %lu %*d %*d %*d %*d %*d %*d %llu", > &parentPid, &utime, &stime, &start)) { > return 0; // not all values parsed; return error > } > > *totalTime = (utime + stime) * (jlong)(1000000000 / clock_ticks_per_second); > > *startTime = bootTime_ms + ((start * 1000) / clock_ticks_per_second); > ... > > > So the process start time is calculated rela?tive to the system kernel boot time. The boot time is calculated ONCE when starting the java VM like this: > > fp = fopen("/proc/stat", "r"); > ... > > while (getline(&line, &len, fp) != -1) { > if (sscanf(line, "btime %llu", &bootTime) == 1) { > break; > } > } > ... > > return bootTime * 1000; > > > However, the /proc/stat btime field does not seem to be constant. When I manually set the clock 2 minutes ahead, the btime field follows along, and is now two minutes later than before. Thus any system time correction (manual, ntpd, ...) will change the system boot time, which will make the timestamp different, but only after restarting the JVM. > > This is IMHO a bug in the JVM. The btime is a relative timestamp (uptime in nanoseconds if i'm correct). The absolute representation of this timestamp is calculated on the fly when reading /proc/stat from the current date/time (assuming that the current date/time is correct). This is not a problem (and correct!) for a human reader. The field should just never be taken to calculate another absolute timestamp, which java does... > > So we pseudo-have: > bootTime_ms > btime = current-clock-timestamp - kernel-uptime; > > proc-start = btime + process-uptime; > > All three variables are mutable and may (and will) change. If (and only if) kernel-uptime and process-uptime are updated correctly, calculating the absolute start-time will yield a reproducible result only as long as the system clock does not change. > > > I'm pretty sure this qualifies as bug, but not whether it's a java a kernel (or whatever) bug... Any advice, also how to get around this, would be greatly appreciated. I would really like to avoid hard-coding allowed drift ranges or something like this, especially as we'll be running into timezone, summer time, etc. issues AFAICT... > > > Cheers, > > Thanks for ANY help, > > Markus > > SSI Sch?fer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria > Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300 > Commercial Court: Landesgericht f?r Zivilrechtssachen Graz > Unsere Hinweise zum Umgang mit personenbezogenen Daten finden Sie hier. > You can find our information on the handling of personal data here. SSI Sch?fer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300 Commercial Court: Landesgericht f?r Zivilrechtssachen Graz Unsere Hinweise zum Umgang mit personenbezogenen Daten finden Sie hier. You can find our information on the handling of personal data here. From xu.y.yin at oracle.com Thu Aug 8 06:10:31 2019 From: xu.y.yin at oracle.com (Chris Yin) Date: Thu, 8 Aug 2019 14:10:31 +0800 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <015C7EC6-4B92-4356-A0F1-5F1648BB5934@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <015C7EC6-4B92-4356-A0F1-5F1648BB5934@oracle.com> Message-ID: Many thanks Pavel for the changes, and thanks Lance, Roger for the reviewing. Yep, let me try to handle some questions from Roger > On 7 Aug 2019, at 11:52 PM, Roger Riggs wrote: > > BaseLdapServer: > > 158: Is printing the stack trace diagnostic or an error?, the exception is not rethrown and no message clarifying > the context of the trace is printed. > Stack traces should go to the log as well or instead of stderr. It?s for diagnostic, the ldap server was designed to shadow support ldap tests, it should be a black box to ldap client unless there is intent interaction per test, so in most case the server side exception should not affect test itself, just for diagnostic. Yep, putting stack traces into log sounds good to me > LdapMessage: > > 90: plural? byte[] messages implies multiple messages, not just a buffer for a single message. You are correct, it?s a buffer for a single message, so should be singular, getMessages() should also be rename to getMessage() to avoid confusion > > 136: Why make a copy? Is it expected to be modified? Be clear in the javadoc about the copy. To prevent modification to original LdapMessage, yep, javadoc could be improved to make it clear > > 230: can the same trick using BigInteger (line 124) be used to extract the length? Yes, I believe that should work since we limited the payload length presentation <= 4 bytes Regards, Chris From claes.redestad at oracle.com Thu Aug 8 11:28:17 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 8 Aug 2019 13:28:17 +0200 Subject: RFR: 8229283: StringLatin1 should consistently use CharacterDataLatin1.instance when applicable Message-ID: <20ff4b6f-3f6d-c3b9-7955-f4fe1bd29d98@oracle.com> Hi, in j.l.StringLatin1 we can and do call CharacterDataLatin1 directly in some places, which avoids a few indirections. Doing so has no effect on peak performance, but simplifies the work the JIT needs to do and speeds up a variety of operations during startup and warmup. http://cr.openjdk.java.net/~redestad/8229283/open.00/ https://bugs.openjdk.java.net/browse/JDK-8229283 Pre-existing StringUpperLower microbenchmark sees 1.5-1.9x improvements when run with -Xint or -XX:TieredStopAtLevel=1. Affected operations are very common, so there are tiny but measurable gains across a diverse set of startup tests. Thanks! /Claes From andy.herrick at oracle.com Thu Aug 8 12:31:32 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Thu, 8 Aug 2019 08:31:32 -0400 Subject: RFR: JDK-8224788: jpackage fails on OS X when using --runtime-image Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). JDK-8224788: jpackage fails on OS X when using --runtime-image [1] https://bugs.openjdk.java.net/browse/JDK-8224788 [2] http://cr.openjdk.java.net/~herrick/8224788/webrev.01/ /Andy From Roger.Riggs at oracle.com Thu Aug 8 13:50:41 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Thu, 8 Aug 2019 09:50:41 -0400 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information In-Reply-To: References: Message-ID: <7e23fce1-ecab-e842-eed6-c92fab47c143@oracle.com> Hi Ivan, To be consistent with other checks of the index, can you use the checkIndex(index, length) method? The message it produces would be appropriate for both cases. While you are there can you add a space after the comma in lines 3680 and 3691. Is there an appropriate test?? There should be. Thanks, Roger On 8/7/19 8:17 PM, Ivan Gerasimov wrote: > Hello! > > The exception thrown by substring(int) may look confusing. > For example it produces "String index out of range: -1" when the index > is length+1. > > It is proposed to make the error message more clear, similar to what > we have for substring(int, int). > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 > WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ > > Would you please help review? > From claes.redestad at oracle.com Thu Aug 8 13:56:44 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 8 Aug 2019 15:56:44 +0200 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information In-Reply-To: References: Message-ID: <2510f2a5-7f2b-75b1-c5ec-89cf90e97490@oracle.com> Hi, perhaps a stupid question, but why isn't String::substring(int) calling substring(beginIndex, length())? That'd ensure consistent error messages, but otherwise preserve semantics. /Claes On 2019-08-08 02:17, Ivan Gerasimov wrote: > Hello! > > The exception thrown by substring(int) may look confusing. > For example it produces "String index out of range: -1" when the index > is length+1. > > It is proposed to make the error message more clear, similar to what we > have for substring(int, int). > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 > WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ > > Would you please help review? > From alexey.semenyuk at oracle.com Thu Aug 8 13:59:04 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 8 Aug 2019 09:59:04 -0400 Subject: RFR: JDK-8224788: jpackage fails on OS X when using --runtime-image In-Reply-To: References: Message-ID: Looks good. - Alexey On 8/8/2019 8:31 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > JDK-8224788: jpackage fails on OS X when using --runtime-image > > [1] https://bugs.openjdk.java.net/browse/JDK-8224788 > > [2] http://cr.openjdk.java.net/~herrick/8224788/webrev.01/ > > /Andy > From Roger.Riggs at oracle.com Thu Aug 8 14:13:21 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Thu, 8 Aug 2019 10:13:21 -0400 Subject: JDK 14 RFR of JDK-8202385: Annotation to mark serial-related fields and methods In-Reply-To: References: <83681e03-589b-b033-f0a1-75bfa3bb4114@oracle.com> <69ac9d9d-0fb8-5483-760c-97b3e6495539@oracle.com> Message-ID: Hi Joe, Looks good, thanks for the updates. Roger On 8/6/19 4:04 PM, Joe Darcy wrote: > Hi Roger, > > Revised webev > > ??? http://cr.openjdk.java.net/~darcy/8202385.5/ > > Diff of last two versions below. To ease review, I elected not to > reflow the paragraphs at this time to reduce the number of lines of > differences between the two versions. > > Several platform annotation types start there javadoc with > "Indicates..." so I kept that pattern. > > It is true the serialization-defined fields and methods are accessed > reflectively and may not be otherwise accessed. That seems more > relevant to emphasize in the serialization spec itself, but it may be > helpful to note here so I added one as requested. > > Cheers, > > -Joe > > 31c31 > --- > >? * Indicates that an annotated field or method is part of the > {@linkplain > 37c37,40 > --- > >? * validate method overriding. {@code Serializable} classes are > encouraged to > >? * use @Serial annotations to help a compiler catch > >? * mis-declared serialization-related fields and methods, > >? * mis-declarations that my otherwise be difficult to detect. > 39c42 > Specifically, annotations of this type are intended to be > --- > >? *

Specifically, annotations of this type should be > 59c62 > --- > >? * Compilers are encouraged to validate that a method or field > marked with a > 61c64,65 > --- > >? * methods or fields declared in a meaningful context and issue a > warning > >? * if that is not the case. > 86a91,94 > >? * > >? * Note that serialization mechanism accesses its designated fields > >? * and methods reflectively and those fields and methods may appear > >? * otherwise unused in a {@code Serializable} class. > > On 8/1/2019 2:40 PM, Roger Riggs wrote: >> Hi Joe, >> >> It would be good to more closely define the semantics of the @Serial >> annotation. >> >> Suggestion for the first sentence: >> >> "@Serial annotates each field or method specified by the Java >> Object Serialization Specification of a {@linkplain >> Serializable serializable} class." >> >> This annotation type is intended to allow compile-time checking of >> serialization-related declarations, analogous to the checking enabled >> by the {@link java.lang.Override} annotation type to validate method >> overriding. >> >> It would be useful to describe that reflection is used to access and >> use the fields and methods and they may? otherwise appear to be unused. >> >> A recommendation could be added in an @impleNote to apply @Serial to >> each serialization defined method or field. >> >> $02, Roger >> >> On 7/13/19 1:16 PM, Joe Darcy wrote: >>> PS I've uploaded an updated an iteration of the webrev >>> >>> http://cr.openjdk.java.net/~darcy/8202385.4/ >>> >>> to address. the syntactic concerns previously raised. I added >>> >>> ??? ...defined by the? Java Object Serialization >>> Specification... >>> >>> which is the current name of the document and is similar to the >>> style of reference made in java.io.Serializable. Offhand, I didn't >>> know of the correct idiom to refer to the document as a working >>> hyperlink, but would be switch to that idiom. >>> >>> Cheers, >>> >>> -Joe >>> >>> On 7/12/2019 8:19 PM, Joe Darcy wrote: >>>> Hi Roger, >>>> >>>> On 7/12/2019 1:31 PM, Roger Riggs wrote: >>>>> Hi Joe, >>>>> >>>>> As an annotation on a field or method, this is a use site annotation. >>>> >>>> >>>> It is an annotation intended for the declarations of fields and >>>> methods of Serializable types. >>>> >>>> >>>>> From the description, the checks that could be added would only be >>>>> done >>>>> if the annotation was present and the annotation is a tag for >>>>> existing >>>>> fields and methods that are part of the serialization spec. >>>> >>>> >>>> Right; the annotation is semantically only applicable to the fields >>>> and methods associated with the serialization system. >>>> >>>> >>>>> >>>>> The signatures of the fields and methods can be known to the >>>>> compiler independent >>>>> of the annotation and produce the same warnings. >>>>> So this looks like a case of trying to have belt and suspenders. >>>>> >>>>> If the checks are not done when the annotation is not present, >>>>> then it will still be >>>>> the case that incorrect or misused fields and methods will still >>>>> escape detection. >>>>> >>>>> Though the details of the compiler check are outside of the scope >>>>> of this annotation, >>>>> it seems unclear whether the annotation is necessary. >>>> >>>> I have a prototype annotation processor to implement checks for >>>> >>>> ??? JDK-8202056: Expand serial warning to check for bad overloads >>>> of serial-related methods and ineffectual fields >>>> >>>> The current version of the processor does not assume the presence >>>> of java.io.Serial. The summarize the existing checking methodology: >>>> >>>> ??? If a type is Serialiazable and a field or method has a name >>>> matching the names of one of the special fields or methods to >>>> serialization, check that the field or method has the required >>>> modifiers, type, and, the the case of methods, parameter types and >>>> exception types. >>>> >>>> That is all well and good and represents a large fraction of the >>>> checking of interest. However, it does not catch a mis-declaration >>>> like "readobject" instead of "readObject". One could argue that >>>> sufficiently thorough testing should catch that kind of error; >>>> however, my impression is that thoroughness of testing is rare in >>>> practice. I don't think it would be reasonable for javac to have >>>> some kind of Hamming distance >>>> (https://en.wikipedia.org/wiki/Hamming_distance) check between the >>>> name of fields/methods and the name of the serialization related >>>> fields methods to try to catch such mis-declarations. An annotation >>>> like java.io.Serial is intended to allow the programmer to indicate >>>> "yes, this is supposed to be one of the serialization related >>>> fields or methods" and enable the compile to perform checks against >>>> that category of error. >>>> >>>> >>>>> >>>>> Can the name of the annotation be more descriptive? >>>>> Just "Serial" seems a bit too simple and does not have a strong >>>>> binding to the Serialization classes and specification. >>>>> Alternatives: >>>>> ?? SerialMetadata >>>>> ?? SerialControl >>>>> ?? SerialFunction >>>> >>>> From the earlier design iterations "Serial" was chosen to be >>>> evocative of the "@serial" javadoc tag. >>>> >>>> Thanks, >>>> >>>> -Joe >>>> >>>>> >>>>> >>>>> 39:? There should be a reference to the serialization >>>>> specification for the definition >>>>> of the fields and methods to make it clear where the authoritative >>>>> identification is spec'd. >>>>> >>>>> 73-75:? Please align the

    and
tags on separate lines >>>>> with matching indentation. >>>>> >>>>> 77: Extra leading space. >>>>> >>>>> Regards, Roger >>>>> >>>>> On 7/9/19 7:14 PM, Joe Darcy wrote: >>>>>> Hello, >>>>>> >>>>>> Returning to some old work [1], please review the addition of a >>>>>> java.io.Serial annotation type for JDK 14 to mark serial-related >>>>>> fields and methods: >>>>>> >>>>>> ??? webrev: http://cr.openjdk.java.net/~darcy/8202385.3/ >>>>>> ??? CSR: https://bugs.openjdk.java.net/browse/JDK-8217698 >>>>>> >>>>>> Thanks, >>>>>> >>>>>> -Joe >>>>>> >>>>>> [1] Previous review threads: >>>>>> >>>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-May/053055.html >>>>>> >>>>>> >>>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054801.html >>>>>> >>>>>> >>>>> >> From chris.hegarty at oracle.com Thu Aug 8 14:18:50 2019 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 8 Aug 2019 15:18:50 +0100 Subject: JDK 14 RFR of JDK-8202385: Annotation to mark serial-related fields and methods In-Reply-To: References: <83681e03-589b-b033-f0a1-75bfa3bb4114@oracle.com> <69ac9d9d-0fb8-5483-760c-97b3e6495539@oracle.com> Message-ID: <8F17F31C-B8FB-486D-B209-1311D34EA858@oracle.com> > On 6 Aug 2019, at 21:04, Joe Darcy wrote: > > ... > Revised webev > > http://cr.openjdk.java.net/~darcy/8202385.5/ LGTM. -Chris. From pavel.rappo at oracle.com Thu Aug 8 15:07:51 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Thu, 8 Aug 2019 16:07:51 +0100 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> Message-ID: <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> Roger, answers are inline. > On 7 Aug 2019, at 16:52, Roger Riggs wrote: > > > > BaseLdapServer: > > 100: The new exception should have a message "Unexpected exception" or "server should no be running"... Fixed. > 158: Is printing the stack trace diagnostic or an error?, the exception is not rethrown and no message clarifying > the context of the trace is printed. > Stack traces should go to the log as well or instead of stderr. Chris has answered this one. > 103: plural "accepting connection" -> "accepting connections" Fixed. > 109: "template method" doesn't describe the method well, the method is private and not overridable. > update the javadoc. I can see several questions here. Correct me if I'm wrong. The first one is about the use of the term "Template Method". This is the name of the behavioral pattern that has been applied here. We can try to describe what that method does a bit better, however... here goes the second question. There is no Javadoc generated for classes like this one. So it's very likely that the documentation we are talking about will be read in conjunction with the source code in an editor. Combine that with the fact that this is a test supporting infrastructure and you might see why I think it would be easier to just outline the intent of the method. People will read the source code anyway. Which is not to say that documentation can be avoided altogether, it's just that I wouldn't sweat it. The third question if that method should be overridable. The canonical version [1] of the Template Method pattern says: "...Primitive operations that _must_ be overridden are declared pure virtual. The template method itself should not be overridden..." I don't have a strong opinion about this, only a preference. I prefer that we will make it overridable only if we find out that the required degree of extensibility cannot be achieved by introducing additional extension/hook methods (the ones that the template method calls). Think about it this way. If that method were overridable, then why would that class be called `BaseLdapServer`? That method is responsible for that class' "LDAPness"! > 154: Handle connection should handle Throwable and log and error with a printStackTrace. > Since it is called in a Executor, otherwise unhandled exceptions will dissappear. Fixed. > 178: logger() should be final. The subclass has no reason to override. And it can be "public final". final? Yes. public? I'd rather leave it as it is. I can't think of a case where an *internal* logger should be sticking out of that class. Hence it's not public. It might be required when subclassing though, hence it's not private or of default (package) access. > 238: isRunning should be synchronized(lock) to make sure each Thread sees the same value threads that update it in start() and close() We have already discussed it with you in this thread. The `state` is `volatile` which is enough for visibility in this query-method. > LdapMessage: > > 90: plural? byte[] messages implies multiple messages, not just a buffer for a single message. > > 136: Why make a copy? Is it expected to be modified? Be clear in the javadoc about the copy. > > 230: can the same trick using BigInteger (line 124) be used to extract the length? Chris has answered those ones. > 184: hexToBin(ch) -> Character.digit(ch, 16); Fixed. > Reconnect: > > 54: there is no need for a stylized new Reconnect().run(). > Just call a static method and keep the test simple. Fixed. > 105: Tests that sleep are prone to intermittent failures on slow or delayed systems. True, however, I'm not aware of any general solution of this problem. > It would be more reliable to countdown *after* the Connection was handled. > As is, it might report success even if handleRequest failed for some reason. Hm... Let me think. What we are interested in here is whether the connection is attempted or not. We may do what you are suggesting just to be sure the server is not failing. That is, the client is served successfully. > > > If there as some suspecion of too many connections > that could be checked after the beforeConnectionHandled called countDown. Wouldn't that make problems of its own? If I got you right, a time window for the LDAP client to create more *unwanted* connections could be really small. A hybrid approach might be even better. We wait for the first connection with a generous timeout and then give the client some extra time to create more connections. It really is fine-tuning. You can't shield completely from arbitrarily slow systems. > Since new infra structure is being introduced, it should be considered to leverage TestNG > testing facilities and Asserts? Pardon, where exactly should we use TestNG? Reconnect.java is a plain (psvm-based) test and BaseLdapServer doesn't know anything about TestNG and contains no assertions of its own. Thanks for helping with this! -Pavel --------------------------------------------------- [1] Design patterns: elements of reusable object-oriented software (ISBN-13: 978-0201633610) From alexey.semenyuk at oracle.com Thu Aug 8 15:49:25 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 8 Aug 2019 11:49:25 -0400 Subject: RFR: JDK-8215446: JPackageCreateInstallerInstallDirTest fails on OLE7 In-Reply-To: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - Add all ascending subdirectories of application installation directory to the package. [1] https://bugs.openjdk.java.net/browse/JDK-8215446 [2] http://cr.openjdk.java.net/~asemenyuk/8215446/webrev.00/ Thanks, Alexey From Roger.Riggs at oracle.com Thu Aug 8 17:59:25 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Thu, 8 Aug 2019 13:59:25 -0400 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> Message-ID: Hi Pavel, To your questions... On 8/8/19 11:07 AM, Pavel Rappo wrote: ... >> 109: "template method" doesn't describe the method well, the method is private and not overridable. >> update the javadoc. > I can see several questions here. Correct me if I'm wrong. The first one is about the use of the term "Template Method". This is the name of the behavioral pattern that has been applied here. We can try to describe what that method does a bit better, however... here goes the second question. There is no Javadoc generated for classes like this one. So it's very likely that the documentation we are talking about will be read in conjunction with the source code in an editor. Combine that with the fact that this is a test supporting infrastructure and you might see why I think it would be easier to just outline the intent of the method. People will read the source code anyway. Which is not to say that documentation can be avoided altogether, it's just that I wouldn't sweat it. Since its a private method, it is not a template for anything and the term doesn't apply. > > The third question if that method should be overridable. The canonical version [1] of the Template Method pattern says: > > "...Primitive operations that _must_ be overridden are declared pure virtual. The template method itself should not be overridden..." Refering the 'Template" pattern doesn't make the documentation clearer. > > I don't have a strong opinion about this, only a preference. I prefer that we will make it overridable only if we find out that the required degree of extensibility cannot be achieved by introducing additional extension/hook methods (the ones that the template method calls). Think about it this way. If that method were overridable, then why would that class be called `BaseLdapServer`? That method is responsible for that class' "LDAPness"! Private is fine. ... >> 178: logger() should be final. The subclass has no reason to override. And it can be "public final". > final? Yes. public? I'd rather leave it as it is. I can't think of a case where an *internal* logger should be sticking out of that class. Hence it's not public. It might be required when subclassing though, hence it's not private or of default (package) access. final is enough to avoid hacking around without giving it some thought. > >> 238: isRunning should be synchronized(lock) to make sure each Thread sees the same value threads that update it in start() and close() > We have already discussed it with you in this thread. The `state` is `volatile` which is enough for visibility in this query-method. yes, but there are multiple locking/synchronization constructs that make the code harder to read as unnecessary complexity. ... >> 105: Tests that sleep are prone to intermittent failures on slow or delayed systems. > True, however, I'm not aware of any general solution of this problem. General is not needed, and sleeps waste time time and resources. In this particular test, if there is no possiblity of multiple connections then CountDownLatch is a good mechanism. > >> It would be more reliable to countdown *after* the Connection was handled. >> As is, it might report success even if handleRequest failed for some reason. > Hm... Let me think. What we are interested in here is whether the connection is attempted or not. We may do what you are suggesting just to be sure the server is not failing. That is, the client is served successfully. The test description is not specific about that. And it raises questions about the purpose of the environment setup. Is it all needed.? Is handling Unbind in the switch needed (as different from the default). >> >> >> If there as some suspecion of too many connections >> that could be checked after the beforeConnectionHandled called countDown. > Wouldn't that make problems of its own? If I got you right, a time window for the LDAP client to create more *unwanted* connections could be really small. A hybrid approach might be even better. We wait for the first connection with a generous timeout and then give the client some extra time to create more connections. > > It really is fine-tuning. You can't shield completely from arbitrarily slow systems. That's fine, a Semaphore can be used to wait for the first connection and then check with a different timeout for unexpected connections. > >> Since new infra structure is being introduced, it should be considered to leverage TestNG >> testing facilities and Asserts? > Pardon, where exactly should we use TestNG? Reconnect.java is a plain (psvm-based) test and BaseLdapServer doesn't know anything about TestNG and contains no assertions of its own. TestNG provides a robust set of Assert checks, in many cases they are more convenient to write and clear in their semantics compared to separate tests and throws. It is an opportunity, nothing more. Roger > > Thanks for helping with this! > > -Pavel > > --------------------------------------------------- > [1] Design patterns: elements of reusable object-oriented software (ISBN-13: 978-0201633610) > From ivan.gerasimov at oracle.com Thu Aug 8 18:47:04 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 8 Aug 2019 11:47:04 -0700 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information In-Reply-To: <2510f2a5-7f2b-75b1-c5ec-89cf90e97490@oracle.com> References: <2510f2a5-7f2b-75b1-c5ec-89cf90e97490@oracle.com> Message-ID: <5d867c91-266b-e55d-a381-34bbb77b8e2b@oracle.com> Hi Claes! On 8/8/19 6:56 AM, Claes Redestad wrote: > Hi, > > perhaps a stupid question, but why isn't String::substring(int) > calling substring(beginIndex, length())? That'd ensure consistent error > messages, but otherwise preserve semantics. > It's a good point, actually! I suspect that originally substring(int) had a separate implementation for performance reason. I agree, it would make most sense to implement one via another unless there's a performance penalty. Let me do some measurements, and then I'll report back. With kind regards, Ivan > /Claes > > On 2019-08-08 02:17, Ivan Gerasimov wrote: >> Hello! >> >> The exception thrown by substring(int) may look confusing. >> For example it produces "String index out of range: -1" when the >> index is length+1. >> >> It is proposed to make the error message more clear, similar to what >> we have for substring(int, int). >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ >> >> Would you please help review? >> > -- With kind regards, Ivan Gerasimov From ivan.gerasimov at oracle.com Thu Aug 8 18:49:51 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 8 Aug 2019 11:49:51 -0700 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information In-Reply-To: <7e23fce1-ecab-e842-eed6-c92fab47c143@oracle.com> References: <7e23fce1-ecab-e842-eed6-c92fab47c143@oracle.com> Message-ID: Hi Roger!? Thanks for the comments! On 8/8/19 6:50 AM, Roger Riggs wrote: > Hi Ivan, > > To be consistent with other checks of the index, can you use the > checkIndex(index, length) method? > The message it produces would be appropriate for both cases. > Unfortunately, checkIndex(int, int) wouldn't be appropriate here because it only allows index < length, while we need index <= length here. I think it makes sense to adopt the suggestion from Claes and just delegate to substring(int,int). > While you are there can you add a space after the comma > in lines 3680 and 3691. > Yes, done. > Is there an appropriate test?? There should be. The substring() method is used across many regression tests, so we do have sanity checking. I didn't think it's worth it to check for specific error message. With kind regards, Ivan > > Thanks, Roger > > > On 8/7/19 8:17 PM, Ivan Gerasimov wrote: >> Hello! >> >> The exception thrown by substring(int) may look confusing. >> For example it produces "String index out of range: -1" when the >> index is length+1. >> >> It is proposed to make the error message more clear, similar to what >> we have for substring(int, int). >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ >> >> Would you please help review? >> > > -- With kind regards, Ivan Gerasimov From alexander.matveev at oracle.com Thu Aug 8 21:20:50 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 8 Aug 2019 14:20:50 -0700 Subject: RFR: JDK-8224788: jpackage fails on OS X when using --runtime-image In-Reply-To: References: Message-ID: <5f953760-befc-8020-54db-565095ba5a70@oracle.com> Looks good. On 8/8/2019 5:31 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > JDK-8224788: jpackage fails on OS X when using --runtime-image > > [1] https://bugs.openjdk.java.net/browse/JDK-8224788 > > [2] http://cr.openjdk.java.net/~herrick/8224788/webrev.01/ > > /Andy > From alexander.matveev at oracle.com Thu Aug 8 21:35:15 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 8 Aug 2019 14:35:15 -0700 Subject: RFR: JDK-8215446: JPackageCreateInstallerInstallDirTest fails on OLE7 In-Reply-To: References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: Hi Alexey, Do you know what behavior will be if we have two packages which will install into CompanyName/App1 CompanyName/App2 If App1 is removed will App2 also removed? Thanks, Alexander On 8/8/2019 8:49 AM, Alexey Semenyuk wrote: > > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Add all ascending subdirectories of application installation > directory to the package. > > [1] https://bugs.openjdk.java.net/browse/JDK-8215446 > > [2] http://cr.openjdk.java.net/~asemenyuk/8215446/webrev.00/ > > Thanks, > Alexey > From alexey.semenyuk at oracle.com Thu Aug 8 22:06:15 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 8 Aug 2019 18:06:15 -0400 Subject: RFR: JDK-8215446: JPackageCreateInstallerInstallDirTest fails on OLE7 In-Reply-To: References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: On 8/8/2019 5:35 PM, Alexander Matveev wrote: > Hi Alexey, > > Do you know what behavior will be if we have two packages which will > install into > CompanyName/App1 > CompanyName/App2 > > If App1 is removed will App2 also removed? No, directory structure of App2 will stay intact. With the suggested fix the package will own "/opt" directory if installation directory of the package would be "/opt/a/b". I just verified that uninstalling the package doesn't affect unrelated contents of "/opt" directory. - Alexey > > Thanks, > Alexander > > > On 8/8/2019 8:49 AM, Alexey Semenyuk wrote: >> >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - Add all ascending subdirectories of application installation >> directory to the package. >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8215446 >> >> [2] http://cr.openjdk.java.net/~asemenyuk/8215446/webrev.00/ >> >> Thanks, >> Alexey >> > From alexander.matveev at oracle.com Thu Aug 8 22:08:47 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 8 Aug 2019 15:08:47 -0700 Subject: RFR: JDK-8215446: JPackageCreateInstallerInstallDirTest fails on OLE7 In-Reply-To: References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: <6815900f-a79d-9ecc-7131-31a68f726407@oracle.com> Looks good then. On 8/8/2019 3:06 PM, Alexey Semenyuk wrote: > > > On 8/8/2019 5:35 PM, Alexander Matveev wrote: >> Hi Alexey, >> >> Do you know what behavior will be if we have two packages which will >> install into >> CompanyName/App1 >> CompanyName/App2 >> >> If App1 is removed will App2 also removed? > No, directory structure of App2 will stay intact. With the suggested > fix the package will own "/opt" directory if installation directory of > the package would be "/opt/a/b". I just verified that uninstalling the > package doesn't affect unrelated contents of "/opt" directory. > > - Alexey >> >> Thanks, >> Alexander >> >> >> On 8/8/2019 8:49 AM, Alexey Semenyuk wrote: >>> >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> - Add all ascending subdirectories of application installation >>> directory to the package. >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8215446 >>> >>> [2] http://cr.openjdk.java.net/~asemenyuk/8215446/webrev.00/ >>> >>> Thanks, >>> Alexey >>> >> > From james.laskey at oracle.com Fri Aug 9 00:41:38 2019 From: james.laskey at oracle.com (Jim Laskey) Date: Thu, 8 Aug 2019 21:41:38 -0300 Subject: RFR: 8229283: StringLatin1 should consistently use CharacterDataLatin1.instance when applicable In-Reply-To: <20ff4b6f-3f6d-c3b9-7955-f4fe1bd29d98@oracle.com> References: <20ff4b6f-3f6d-c3b9-7955-f4fe1bd29d98@oracle.com> Message-ID: +1 > On Aug 8, 2019, at 8:28 AM, Claes Redestad wrote: > > Hi, > > in j.l.StringLatin1 we can and do call CharacterDataLatin1 directly in > some places, which avoids a few indirections. Doing so has no effect on peak performance, but simplifies the work the JIT needs to do and speeds > up a variety of operations during startup and warmup. > > http://cr.openjdk.java.net/~redestad/8229283/open.00/ > https://bugs.openjdk.java.net/browse/JDK-8229283 > > Pre-existing StringUpperLower microbenchmark sees 1.5-1.9x > improvements when run with -Xint or -XX:TieredStopAtLevel=1. Affected > operations are very common, so there are tiny but measurable gains > across a diverse set of startup tests. > > Thanks! > > /Claes From alexander.matveev at oracle.com Fri Aug 9 04:26:36 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 8 Aug 2019 21:26:36 -0700 Subject: RFR: JDK-8227641: java-options values with spaces are processed incorrectly Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - There are no know bugs in how we handle java options with spaces. However, it might be complicated to figure out how to provide such options. Added several examples to help to show most common cases. ? --java-options ????????? Options to pass to the Java runtime ????????? This option can be used multiple times. ????????? Example 1: To specify [-DOption1=My Great App] use ?????????? [--java-options "-DOption1=\"My Great App\""] ????????? Example 2: To specify [-DOption2="My Great App in quotes"] use ?????????? [--java-options "-DOption2=\"\\\"My Great App in quotes\\\"\""] ????????? Example 3: To specify [-DOption3=Value "with" quotes] use ?????????? [--java-options "-DOption3=\"Value \\\"with\\\" quotes\""] Application will read them back as: -DOption1=My Great App -DOption2="My Great App in quotes" -DOption3=Value "with" quotes [1] https://bugs.openjdk.java.net/browse/JDK-8227641 [2] http://cr.openjdk.java.net/~almatvee/8227641/webrev.00/ Thanks, Alexander From claes.redestad at oracle.com Fri Aug 9 11:49:57 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Fri, 9 Aug 2019 13:49:57 +0200 Subject: RFR: 8229283: StringLatin1 should consistently use CharacterDataLatin1.instance when applicable In-Reply-To: References: <20ff4b6f-3f6d-c3b9-7955-f4fe1bd29d98@oracle.com> Message-ID: <106ee5d9-d3cd-40cb-d29c-c4fc85a69e00@oracle.com> On 2019-08-09 02:41, Jim Laskey wrote: > +1 Thanks, Jim! /Claes From Roger.Riggs at oracle.com Fri Aug 9 13:25:36 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Fri, 9 Aug 2019 09:25:36 -0400 Subject: RFR: JDK-8227641: java-options values with spaces are processed incorrectly In-Reply-To: References: Message-ID: <40383f24-5556-0fd8-7ede-97cfde5f4fc7@oracle.com> Hi Alexander, I'm not sure we want to get into the business of telling people how use use shell quoting. It does vary from shell to shell and on Windows vs. Linux. I'd pick one simple example that works on Windows as well as Linux. I would have thought that the example in the bug report would be handled correctly since it should be delivered to java intact as a single argument. ('-Dfoo=foo bar') Roger On 8/9/19 12:26 AM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - There are no know bugs in how we handle java options with spaces. > However, it might be complicated to figure out how to provide such > options. Added several examples to help to show most common cases. > > ? --java-options > ????????? Options to pass to the Java runtime > ????????? This option can be used multiple times. > ????????? Example 1: To specify [-DOption1=My Great App] use > ?????????? [--java-options "-DOption1=\"My Great App\""] > ????????? Example 2: To specify [-DOption2="My Great App in quotes"] use > ?????????? [--java-options "-DOption2=\"\\\"My Great App in > quotes\\\"\""] > ????????? Example 3: To specify [-DOption3=Value "with" quotes] use > ?????????? [--java-options "-DOption3=\"Value \\\"with\\\" quotes\""] > > Application will read them back as: > -DOption1=My Great App > -DOption2="My Great App in quotes" > -DOption3=Value "with" quotes > > [1] https://bugs.openjdk.java.net/browse/JDK-8227641 > > [2] http://cr.openjdk.java.net/~almatvee/8227641/webrev.00/ > > Thanks, > Alexander > From andy.herrick at oracle.com Fri Aug 9 13:47:41 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 9 Aug 2019 09:47:41 -0400 Subject: RFR: JDK-8227641: java-options values with spaces are processed incorrectly In-Reply-To: References: Message-ID: I don't think we should put these examples in help text of --java-options, and that we we should just close this bug as "not a bug". The necessity of escaping option values with spaces and embedded quotes applies to many other jpackage options as well. The examples here don't really require escaping (could be accomplished by using both forms of quoting) but more complex forms would require escaping. Any description or examples of how and when to do it belongs in the user documentation (which does not yet exist). There are "Additional Notes" in the CSR (https://bugs.openjdk.java.net/browse/JDK-8213087) where we previously put explanations that eventually need to be in user documentation. /Andy On 8/9/2019 12:26 AM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - There are no know bugs in how we handle java options with spaces. > However, it might be complicated to figure out how to provide such > options. Added several examples to help to show most common cases. > > ? --java-options > ????????? Options to pass to the Java runtime > ????????? This option can be used multiple times. > ????????? Example 1: To specify [-DOption1=My Great App] use > ?????????? [--java-options "-DOption1=\"My Great App\""] > ????????? Example 2: To specify [-DOption2="My Great App in quotes"] use > ?????????? [--java-options "-DOption2=\"\\\"My Great App in > quotes\\\"\""] > ????????? Example 3: To specify [-DOption3=Value "with" quotes] use > ?????????? [--java-options "-DOption3=\"Value \\\"with\\\" quotes\""] > > Application will read them back as: > -DOption1=My Great App > -DOption2="My Great App in quotes" > -DOption3=Value "with" quotes > > [1] https://bugs.openjdk.java.net/browse/JDK-8227641 > > [2] http://cr.openjdk.java.net/~almatvee/8227641/webrev.00/ > > Thanks, > Alexander > From andy.herrick at oracle.com Fri Aug 9 14:12:27 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 9 Aug 2019 10:12:27 -0400 Subject: RFR: JDK-8227641: java-options values with spaces are processed incorrectly In-Reply-To: <40383f24-5556-0fd8-7ede-97cfde5f4fc7@oracle.com> References: <40383f24-5556-0fd8-7ede-97cfde5f4fc7@oracle.com> Message-ID: <36b6b0ca-df11-f472-a946-8fe01b1afb87@oracle.com> On 8/9/2019 9:25 AM, Roger Riggs wrote: > Hi Alexander, > > I'm not sure we want to get into the business of telling people how > use use shell quoting. > It does vary from shell to shell and on Windows vs. Linux. > > I'd pick one simple example that works on Windows as well as Linux. > > I would have thought that the example in the bug report would be > handled correctly > since it should be delivered to java intact as a single argument. > ('-Dfoo=foo bar') The problem with the original example was that the value of the --java-options is a space separated list of java arguments, not a single java argument. We don't know if the "bar" is a second option, or part of the value of the first options without additional quoting like "-Dfoo='foo bar'" vs "-Dfoo='foo' bar", or escaping. Since the confusion could occur in several jpackage options, I do not think it appropriate to address in the help text, but rather should be explained more fully in user documentation. /Andy > > Roger > > > On 8/9/19 12:26 AM, Alexander Matveev wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - There are no know bugs in how we handle java options with spaces. >> However, it might be complicated to figure out how to provide such >> options. Added several examples to help to show most common cases. >> >> ? --java-options >> ????????? Options to pass to the Java runtime >> ????????? This option can be used multiple times. >> ????????? Example 1: To specify [-DOption1=My Great App] use >> ?????????? [--java-options "-DOption1=\"My Great App\""] >> ????????? Example 2: To specify [-DOption2="My Great App in quotes"] use >> ?????????? [--java-options "-DOption2=\"\\\"My Great App in >> quotes\\\"\""] >> ????????? Example 3: To specify [-DOption3=Value "with" quotes] use >> ?????????? [--java-options "-DOption3=\"Value \\\"with\\\" quotes\""] >> >> Application will read them back as: >> -DOption1=My Great App >> -DOption2="My Great App in quotes" >> -DOption3=Value "with" quotes >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8227641 >> >> [2] http://cr.openjdk.java.net/~almatvee/8227641/webrev.00/ >> >> Thanks, >> Alexander >> > From alexey.semenyuk at oracle.com Fri Aug 9 16:31:52 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 9 Aug 2019 12:31:52 -0400 Subject: RFR: JDK-8229334: JPackager .exe packages cannot be executed due to missing DLL In-Reply-To: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - Add build flag to statically link exe wrapper for msi files with MS runtime lib. [1] https://bugs.openjdk.java.net/browse/JDK-8229334 [2] http://cr.openjdk.java.net/~asemenyuk/8229334/webrev.00/ Thanks, Alexey From andy.herrick at oracle.com Fri Aug 9 16:36:07 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 9 Aug 2019 12:36:07 -0400 Subject: RFR: JDK-8229334: JPackager .exe packages cannot be executed due to missing DLL In-Reply-To: References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: looks good. /Andy On 8/9/19 12:31 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Add build flag to statically link exe wrapper for msi files with MS > runtime lib. > > [1] https://bugs.openjdk.java.net/browse/JDK-8229334 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229334/webrev.00/ > > Thanks, > Alexey > From alexander.matveev at oracle.com Fri Aug 9 19:50:24 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Fri, 9 Aug 2019 12:50:24 -0700 Subject: RFR: JDK-8229334: JPackager .exe packages cannot be executed due to missing DLL In-Reply-To: References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: <85f7fe24-087e-a964-eed7-077006a781a3@oracle.com> Looks good. On 8/9/2019 9:31 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Add build flag to statically link exe wrapper for msi files with MS > runtime lib. > > [1] https://bugs.openjdk.java.net/browse/JDK-8229334 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229334/webrev.00/ > > Thanks, > Alexey > From mandy.chung at oracle.com Fri Aug 9 20:19:39 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 9 Aug 2019 13:19:39 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 Message-ID: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> An earlier version of this patch was reviewed [1] but I didn't get back to explore the other approach.? I rebase the patch and take out the hotspot change which will be covered by JDK-8229375: http://cr.openjdk.java.net/~mchung/jdk14//8193325/webrev.01 David - can you re-review it? thanks Mandy [1] https://mail.openjdk.java.net/pipermail/core-libs-dev/2017-December/050590.html From brent.christian at oracle.com Fri Aug 9 23:22:38 2019 From: brent.christian at oracle.com (Brent Christian) Date: Fri, 9 Aug 2019 16:22:38 -0700 Subject: RFR: 8229283: StringLatin1 should consistently use CharacterDataLatin1.instance when applicable In-Reply-To: <20ff4b6f-3f6d-c3b9-7955-f4fe1bd29d98@oracle.com> References: <20ff4b6f-3f6d-c3b9-7955-f4fe1bd29d98@oracle.com> Message-ID: Hi Claes, Some observations: 394 int u1 = CharacterDataLatin1.instance.toUpperCase(c1); 395 int u2 = CharacterDataLatin1.instance.toUpperCase(c2); Changing u1 & u2 from char -> int, L399 now calls toLowerCase(int) instead of toLowerCase(char). Should be fine, though. Speaking of: 399 if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) { Should/could this line also be changed? 421 if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) { Similarly, maybe Character.toLowerCase(u1) -> CharacterDataLatin1.instance.toUpperCase(u1) ? 477 lowerChar = CharacterDataLatin1.instance.toLowerCase(srcChar); ... Initially I was nervous about the lower/upper case changes, but I've convinced myself that StringLatin1 handles these cases correctly. FWIW, the changes from Character.toUpperCaseEx() (e.g. L512) now skip: assert isValidCodePoint(codePoint); and changes from Character.toUpperCaseCharArray() (e.g. L562) now skip: assert isBmpCodePoint(codePoint); in Character.java. Thanks, -Brent From shade at redhat.com Sat Aug 10 07:30:52 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Sat, 10 Aug 2019 09:30:52 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> Message-ID: <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> On 8/9/19 10:19 PM, Mandy Chung wrote: > An earlier version of this patch was reviewed [1] but I > didn't get back to explore the other approach.? I rebase > the patch and take out the hotspot change which will be > covered by JDK-8229375: > > http://cr.openjdk.java.net/~mchung/jdk14//8193325/webrev.01 I wonder if bci=-1 is meaningful, and should be returned when BCI is not available. After this patch, it would be converted to 65536? Anyhow, I am looking at current field layout of StackFrameInfo and wonder why not expand bci to the proper int, which would avoid both this and JDK-8229375? There seems to be the non-taken 2-byte gap before oop fields that bci can extend into without increasing the object size. java.lang.StackFrameInfo object internals: OFFSET SIZE TYPE DESCRIPTION VALUE 0 12 (object header) N/A 12 2 short StackFrameInfo.bci N/A 14 2 (actually, injected "version"?) 16 1 byte StackFrameInfo.flags N/A 17 3 (alignment/padding gap) 20 4 java.lang.Object StackFrameInfo.memberName N/A 24 4 java.lang.StackTraceElement StackFrameInfo.ste N/A 28 4 (loss due to the next object alignment) Instance size: 32 bytes Space losses: 5 bytes internal + 4 bytes external = 9 bytes total -- Thanks, -Aleksey From andy.herrick at oracle.com Sat Aug 10 10:44:33 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Sat, 10 Aug 2019 06:44:33 -0400 Subject: RFR: JDK-8227172: revert JDK-8225569 on windows Message-ID: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). This change will remove the "bin" directory on windows and revert to putting the executable(s) directly in output root dir. (/) [1] https://bugs.openjdk.java.net/browse/JDK-8227172 [2] http://cr.openjdk.java.net/~herrick/8227172/webrev.01/ /Andy From kevin.rushforth at oracle.com Sat Aug 10 13:15:48 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Sat, 10 Aug 2019 06:15:48 -0700 Subject: RFR: JDK-8227172: revert JDK-8225569 on windows In-Reply-To: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> References: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> Message-ID: <2736a8c9-ae52-f83d-7f61-6decc2edeb48@oracle.com> Looks good. -- Kevin On 8/10/2019 3:44 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > This change will remove the "bin" directory on windows and revert to > putting the executable(s) directly in output root dir. ( dir>/) > > [1] https://bugs.openjdk.java.net/browse/JDK-8227172 > > [2] http://cr.openjdk.java.net/~herrick/8227172/webrev.01/ > > /Andy > From openjdk at icemanx.nl Sat Aug 10 16:00:16 2019 From: openjdk at icemanx.nl (Rob Spoor) Date: Sat, 10 Aug 2019 18:00:16 +0200 Subject: RFE: annotation for resource wrapper methods Message-ID: <9669a578-52ce-63e5-a0ed-a3e1e0081feb@icemanx.nl> Hi, When you wrap a resource (InputStream, etc) using a class constructor (e.g. new BufferedInputStream(...)), compilers usually don't complain. If you do the exact same thing using a utility method, compilers aren't that smart anymore. For instance, the following produces a warning that the FileInputStream may not be closed, even though the wrap method returns a new InputStream that closes the FileInputStream if it's closed itself: try (InputStream decoded = Base64.getDecoder().wrap(new FileInputStream("filename"))) { ... } It would be nice if there were some annotation that we could use to mark a method as being resource-safe, because they either close the resource, or return a wrapper around it. It would be a bit like @SafeVarargs but for resources. Methods like wrap would then be annotated with this new annotation, and compilers shouldn't complain anymore. The alternative is a lot more verbose: try (@SuppressWarnings("resource") InputStream decoded = Base64.getDecoder().wrap(new FileInputStream(""))) { .... } (I don't know if this is the right mailing list, but I couldn't find a better one.) Kind regards, Rob From forax at univ-mlv.fr Sat Aug 10 17:00:19 2019 From: forax at univ-mlv.fr (Remi Forax) Date: Sat, 10 Aug 2019 19:00:19 +0200 (CEST) Subject: RFE: annotation for resource wrapper methods In-Reply-To: <9669a578-52ce-63e5-a0ed-a3e1e0081feb@icemanx.nl> References: <9669a578-52ce-63e5-a0ed-a3e1e0081feb@icemanx.nl> Message-ID: <1816803679.671532.1565456419705.JavaMail.zimbra@u-pem.fr> Hi Rob, the problem is that if wrap() raises an exception before the wrapper is created and returned, the resource will be never closed. The correct way to fix the issue is to use several assignments in the try-with-resources try (FileInputStream fileInputStream = new FileInputStream("filename"); InputStream decoded = Base64.getDecoder().wrap(fileInputStream)) { ... } regards, R?mi ----- Mail original ----- > De: "Rob Spoor" > ?: "core-libs-dev" > Envoy?: Samedi 10 Ao?t 2019 18:00:16 > Objet: RFE: annotation for resource wrapper methods > Hi, > > When you wrap a resource (InputStream, etc) using a class constructor > (e.g. new BufferedInputStream(...)), compilers usually don't complain. > If you do the exact same thing using a utility method, compilers aren't > that smart anymore. For instance, the following produces a warning that > the FileInputStream may not be closed, even though the wrap method > returns a new InputStream that closes the FileInputStream if it's closed > itself: > > try (InputStream decoded = Base64.getDecoder().wrap(new > FileInputStream("filename"))) { > ... > } > > It would be nice if there were some annotation that we could use to mark > a method as being resource-safe, because they either close the resource, > or return a wrapper around it. It would be a bit like @SafeVarargs but > for resources. Methods like wrap would then be annotated with this new > annotation, and compilers shouldn't complain anymore. The alternative is > a lot more verbose: > > try (@SuppressWarnings("resource") InputStream decoded = > Base64.getDecoder().wrap(new FileInputStream(""))) { > .... > } > > > (I don't know if this is the right mailing list, but I couldn't find a > better one.) > > > Kind regards, > > Rob From mandy.chung at oracle.com Sun Aug 11 04:50:58 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Sat, 10 Aug 2019 21:50:58 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> Message-ID: On 8/10/19 12:30 AM, Aleksey Shipilev wrote: > On 8/9/19 10:19 PM, Mandy Chung wrote: >> An earlier version of this patch was reviewed [1] but I >> didn't get back to explore the other approach.? I rebase >> the patch and take out the hotspot change which will be >> covered by JDK-8229375: >> >> http://cr.openjdk.java.net/~mchung/jdk14//8193325/webrev.01 > I wonder if bci=-1 is meaningful, and should be returned when BCI is not available. After this patch, it would be converted to 65536? I'm including Coleen to confirm. If the stack frame is in a Java method, should BCI always be a valid index to the Code attribute? If it's in a native method, StackFrameInfo::getByteCodeIndex returns -1 and bci field is ignored. Mandy From david.holmes at oracle.com Mon Aug 12 04:49:28 2019 From: david.holmes at oracle.com (David Holmes) Date: Mon, 12 Aug 2019 14:49:28 +1000 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> Message-ID: On 11/08/2019 2:50 pm, Mandy Chung wrote: > On 8/10/19 12:30 AM, Aleksey Shipilev wrote: >> On 8/9/19 10:19 PM, Mandy Chung wrote: >>> An earlier version of this patch was reviewed [1] but I >>> didn't get back to explore the other approach.? I rebase >>> the patch and take out the hotspot change which will be >>> covered by JDK-8229375: >>> >>> http://cr.openjdk.java.net/~mchung/jdk14//8193325/webrev.01 >> I wonder if bci=-1 is meaningful, and should be returned when BCI is >> not available. After this patch, it would be converted to 65536? This is my query as well. It is not obvious to me that the VM will never set a BCI of -1 David ----- > I'm including Coleen to confirm. > > If the stack frame is in a Java method, should BCI always be a valid > index to the Code attribute? > > If it's in a native method, StackFrameInfo::getByteCodeIndex returns -1 > and bci field is ignored. > > Mandy From claes.redestad at oracle.com Mon Aug 12 10:13:01 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 12 Aug 2019 12:13:01 +0200 Subject: RFR(XS): 8229407: Avoid ConcurrentHashMap resizes during bootstrap Message-ID: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> Hi core-libs, analysis shows that a handful of small ConcurrentHashMaps used during bootstrap is subject to some amount of resizing. Initializing these to slightly larger values improves startup metrics measurably on default images without regressing performance on minimal images. Bug: https://bugs.openjdk.java.net/browse/JDK-8229407 Webrev: http://cr.openjdk.java.net/~redestad/8229407/webrev.00/ Thanks! /Claes From Alan.Bateman at oracle.com Mon Aug 12 10:44:28 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 12 Aug 2019 11:44:28 +0100 Subject: RFR(XS): 8229407: Avoid ConcurrentHashMap resizes during bootstrap In-Reply-To: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> References: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> Message-ID: On 12/08/2019 11:13, Claes Redestad wrote: > Hi core-libs, > > analysis shows that a handful of small ConcurrentHashMaps used during > bootstrap is subject to some amount of resizing. Initializing these to > slightly larger values improves startup metrics measurably on default > images without regressing performance on minimal images. > > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229407 > Webrev: http://cr.openjdk.java.net/~redestad/8229407/webrev.00/ This looks okay. -Alan From shade at redhat.com Mon Aug 12 10:49:01 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Mon, 12 Aug 2019 12:49:01 +0200 Subject: RFR(XS): 8229407: Avoid ConcurrentHashMap resizes during bootstrap In-Reply-To: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> References: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> Message-ID: On 8/12/19 12:13 PM, Claes Redestad wrote: > Hi core-libs, > > analysis shows that a handful of small ConcurrentHashMaps used during > bootstrap is subject to some amount of resizing. Initializing these to > slightly larger values improves startup metrics measurably on default > images without regressing performance on minimal images. > > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229407 > Webrev: http://cr.openjdk.java.net/~redestad/8229407/webrev.00/ Looks fine. -Aleksey From daniel.fuchs at oracle.com Mon Aug 12 11:03:34 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 12 Aug 2019 12:03:34 +0100 Subject: RFR(XS): 8229407: Avoid ConcurrentHashMap resizes during bootstrap In-Reply-To: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> References: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> Message-ID: <0686c54f-6de5-74e9-7f3c-883214b4c637@oracle.com> Hi Claes, I'd suggest adding a comment such as: // sized to 32 to avoid resizing during bootstrap best regards (and no need for a new review if you decide to take in my suggestion). -- daniel On 12/08/2019 11:13, Claes Redestad wrote: > Hi core-libs, > > analysis shows that a handful of small ConcurrentHashMaps used during > bootstrap is subject to some amount of resizing. Initializing these to > slightly larger values improves startup metrics measurably on default > images without regressing performance on minimal images. > > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229407 > Webrev: http://cr.openjdk.java.net/~redestad/8229407/webrev.00/ > > Thanks! > > /Claes From claes.redestad at oracle.com Mon Aug 12 11:33:32 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 12 Aug 2019 13:33:32 +0200 Subject: RFR(XS): 8229407: Avoid ConcurrentHashMap resizes during bootstrap In-Reply-To: <0686c54f-6de5-74e9-7f3c-883214b4c637@oracle.com> References: <59912ad2-9c1b-a866-5463-e0e11d140221@oracle.com> <0686c54f-6de5-74e9-7f3c-883214b4c637@oracle.com> Message-ID: Alan, Aleksey, Daniel, thanks for your reviews! On 2019-08-12 13:03, Daniel Fuchs wrote: > Hi Claes, > > I'd suggest adding a comment such as: > > // sized to 32 to avoid resizing during bootstrap I think this would be superfluous, so unless there is popular demand I'll leave it as is. Thanks! /Claes From alexey.semenyuk at oracle.com Mon Aug 12 16:34:23 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 12 Aug 2019 12:34:23 -0400 Subject: RFR: JDK-8227172: revert JDK-8225569 on windows In-Reply-To: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> References: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> Message-ID: Looks good. - Alexey On 8/10/2019 6:44 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > This change will remove the "bin" directory on windows and revert to > putting the executable(s) directly in output root dir. ( dir>/) > > [1] https://bugs.openjdk.java.net/browse/JDK-8227172 > > [2] http://cr.openjdk.java.net/~herrick/8227172/webrev.01/ > > /Andy > From pavel.rappo at oracle.com Mon Aug 12 17:41:12 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 12 Aug 2019 18:41:12 +0100 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> Message-ID: <9BD09475-83E7-4E8A-A125-B694668055FA@oracle.com> Comments are inline. > On 8 Aug 2019, at 18:59, Roger Riggs wrote: > > Hi Pavel, > > To your questions... > > > On 8/8/19 11:07 AM, Pavel Rappo wrote: > ... >>> 109: "template method" doesn't describe the method well, the method is private and not overridable. >>> update the javadoc. >>> >> I can see several questions here. Correct me if I'm wrong. The first one is about the use of the term "Template Method". This is the name of the behavioral pattern that has been applied here. We can try to describe what that method does a bit better, however... here goes the second question. There is no Javadoc generated for classes like this one. So it's very likely that the documentation we are talking about will be read in conjunction with the source code in an editor. Combine that with the fact that this is a test supporting infrastructure and you might see why I think it would be easier to just outline the intent of the method. People will read the source code anyway. Which is not to say that documentation can be avoided altogether, it's just that I wouldn't sweat it. > Since its a private method, it is not a template for anything and the term doesn't apply. >> The third question if that method should be overridable. The canonical version [1] of the Template Method pattern says: >> >> "...Primitive operations that _must_ be overridden are declared pure virtual. The template method itself should not be overridden..." >> > Refering the 'Template" pattern doesn't make the documentation clearer. >> I don't have a strong opinion about this, only a preference. I prefer that we will make it overridable only if we find out that the required degree of extensibility cannot be achieved by introducing additional extension/hook methods (the ones that the template method calls). Think about it this way. If that method were overridable, then why would that class be called `BaseLdapServer`? That method is responsible for that class' "LDAPness"! > Private is fine. > > ... >>> 178: logger() should be final. The subclass has no reason to override. And it can be "public final". >>> >> final? Yes. public? I'd rather leave it as it is. I can't think of a case where an *internal* logger should be sticking out of that class. Hence it's not public. It might be required when subclassing though, hence it's not private or of default (package) access. > final is enough to avoid hacking around without giving it some thought. I will update the documentation accordingly. >>> 238: isRunning should be synchronized(lock) to make sure each Thread sees the same value threads that update it in start() and close() >>> >> We have already discussed it with you in this thread. The `state` is `volatile` which is enough for visibility in this query-method. > yes, but there are multiple locking/synchronization constructs that make the code harder to read > as unnecessary complexity. Fine. I will remove `volatile` and synchronize on `lock` in the `isRunning` method. >>> 105: Tests that sleep are prone to intermittent failures on slow or delayed systems. >>> >> True, however, I'm not aware of any general solution of this problem. > General is not needed, and sleeps waste time time and resources. > In this particular test, if there is no possiblity of multiple connections then CountDownLatch is a good mechanism. I would prefer to test for a particular number of connections. >>> It would be more reliable to countdown *after* the Connection was handled. >>> As is, it might report success even if handleRequest failed for some reason. >>> >> Hm... Let me think. What we are interested in here is whether the connection is attempted or not. We may do what you are suggesting just to be sure the server is not failing. That is, the client is served successfully. > The test description is not specific about that. > And it raises questions about the purpose of the environment setup. > Is it all needed. I will update the documentation. > Is handling Unbind in the switch needed (as different from the default). Chris might want to answer that. >>> >>> >>> If there as some suspecion of too many connections >>> that could be checked after the beforeConnectionHandled called countDown. >>> >> Wouldn't that make problems of its own? If I got you right, a time window for the LDAP client to create more *unwanted* connections could be really small. A hybrid approach might be even better. We wait for the first connection with a generous timeout and then give the client some extra time to create more connections. >> >> It really is fine-tuning. You can't shield completely from arbitrarily slow systems. >> > That's fine, a Semaphore can be used to wait for the first connection and then check with a different timeout for unexpected connections. I've sketched some possible implementations of the hybrid check we talked about. Even though the "Semaphore option" looks the most concise, it simultaneously looks the most "off-label" and counterintuitive (to my liking). However, I'm fine with it. -Pavel // -------------------------------------------------- import java.util.concurrent.CountDownLatch; import java.util.concurrent.Phaser; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; public class TwoPhase { public static void main(String[] args) throws InterruptedException { final Option opt = new OptionA(); // final Option opt = new OptionB(); // final Option opt = new OptionC(); opt.acceptConnection(); opt.acceptConnection(); opt.checkConnections(); } private interface Option { void acceptConnection(); void checkConnections() throws InterruptedException; } private static class OptionA implements Option { private final CountDownLatch firstConnection = new CountDownLatch(1); private final AtomicInteger connectionsCount = new AtomicInteger(); private final CountDownLatch otherConnections = new CountDownLatch(1); @Override public void acceptConnection() { if (connectionsCount.incrementAndGet() == 1) { firstConnection.countDown(); } else { otherConnections.countDown(); } } @Override public void checkConnections() throws InterruptedException { if (!firstConnection.await(60L, TimeUnit.SECONDS)) { throw new RuntimeException("Failed"); } if (otherConnections.await(5L, TimeUnit.SECONDS)) { throw new RuntimeException("Unexpected connections: " + connectionsCount.get()); } } } private static class OptionB implements Option { private final Semaphore s = new Semaphore(0); @Override public void acceptConnection() { s.release(1); } @Override public void checkConnections() throws InterruptedException { if (!s.tryAcquire(60L, TimeUnit.SECONDS)) { throw new RuntimeException("Failed"); } if (s.tryAcquire(5L, TimeUnit.SECONDS)) { throw new RuntimeException("Unexpected connections: " + (s.availablePermits() + 2)); } } } private static class OptionC implements Option { private final Phaser p = new Phaser(1); @Override public void acceptConnection() { p.arrive(); } @Override public void checkConnections() throws InterruptedException { try { p.awaitAdvanceInterruptibly(0, 60L, TimeUnit.SECONDS); } catch (TimeoutException e) { throw new RuntimeException("Failed"); } try { p.awaitAdvanceInterruptibly(1, 5L, TimeUnit.SECONDS); } catch (TimeoutException e) { return; /* expected */ } throw new RuntimeException("Unexpected connections: " + p.getPhase()); } } } // -------------------------------------------------- From mandy.chung at oracle.com Mon Aug 12 18:12:53 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 12 Aug 2019 11:12:53 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> Message-ID: On 8/11/19 9:49 PM, David Holmes wrote: > On 11/08/2019 2:50 pm, Mandy Chung wrote: >> On 8/10/19 12:30 AM, Aleksey Shipilev wrote: >>> On 8/9/19 10:19 PM, Mandy Chung wrote: >>>> An earlier version of this patch was reviewed [1] but I >>>> didn't get back to explore the other approach.? I rebase >>>> the patch and take out the hotspot change which will be >>>> covered by JDK-8229375: >>>> >>>> http://cr.openjdk.java.net/~mchung/jdk14//8193325/webrev.01 >>> I wonder if bci=-1 is meaningful, and should be returned when BCI is >>> not available. After this patch, it would be converted to 65536? > > This is my query as well. It is not obvious to me that the VM will > never set a BCI of -1 > Frederic adds an assert to ensure that bci is a valid value [1] in the fix for JDK-8229375.? This would help catching the odd case with invalid BCI. Alternatively, we can make bci an int (as Alekey suggests) that does not increase the object size: ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.02/ This means that this will replace Frederic's proposed patch for JDK-8229375. What do you think? Mandy [1] https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2019-August/035596.html From daniel.fuchs at oracle.com Mon Aug 12 18:25:44 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 12 Aug 2019 19:25:44 +0100 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> Message-ID: <28f83dc3-8e58-7abc-a9b0-7f92dc15a828@oracle.com> Hi Mandy, I thought the contract for @Stable was that the value would not change after it's been assigned a non default value. And the default for int is '0', not '-1'. In view of that - isn't using 'final' a better alternative, even though it's also lying? best regards, -- daniel On 12/08/2019 19:12, Mandy Chung wrote: > Alternatively, we can make bci an int (as Alekey suggests) that does not > increase the object size: > > ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.02/ > > This means that this will replace Frederic's proposed patch for > JDK-8229375. > > What do you think? > > Mandy > [1] > https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2019-August/035596.html > From shade at redhat.com Mon Aug 12 18:33:57 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Mon, 12 Aug 2019 20:33:57 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> Message-ID: <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> On 8/12/19 8:12 PM, Mandy Chung wrote: > On 8/11/19 9:49 PM, David Holmes wrote: >> On 11/08/2019 2:50 pm, Mandy Chung wrote: >>> On 8/10/19 12:30 AM, Aleksey Shipilev wrote: >>>> I wonder if bci=-1 is meaningful, and should be returned when BCI is not available. After this >>>> patch, it would be converted to 65536? >> >> This is my query as well. It is not obvious to me that the VM will never set a BCI of -1 > > Frederic adds an assert to ensure that bci is a valid value [1] in the fix for JDK-8229375.? This > would help catching the odd case with invalid BCI. But the initializing value from Java code is still -1, so 65535 would be printed if BCI is not initialized by VM on some path? > Alternatively, we can make bci an int (as Alekey suggests) that does not increase the object size: > > ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.02/ @Stable seems meaningless here, for the reasons Daniel points out. I believe "final int bci" is just as good and clean. -- Thanks, -Aleksey From mandy.chung at oracle.com Mon Aug 12 19:01:36 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 12 Aug 2019 12:01:36 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> Message-ID: <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> On 8/12/19 11:33 AM, Aleksey Shipilev wrote: >> Alternatively, we can make bci an int (as Alekey suggests) that does not increase the object size: >> >> ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.02/ > @Stable seems meaningless here, for the reasons Daniel points out. I believe "final int bci" is just as good and clean. I am happy to keep it final field and the comment already indicates that the field is set by the VM.? It's initialized to -1 in case any accident change that VM didn't set this field. diff --git a/src/java.base/share/classes/java/lang/StackFrameInfo.java b/src/java.base/share/classes/java/lang/StackFrameInfo.java --- a/src/java.base/share/classes/java/lang/StackFrameInfo.java +++ b/src/java.base/share/classes/java/lang/StackFrameInfo.java @@ -1,5 +1,5 @@ ?/* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. ? * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ? * ? * This code is free software; you can redistribute it and/or modify it @@ -26,28 +26,31 @@ ?import jdk.internal.access.JavaLangInvokeAccess; ?import jdk.internal.access.SharedSecrets; +import jdk.internal.vm.annotation.Stable; ?import java.lang.StackWalker.StackFrame; ?import java.lang.invoke.MethodType; ?class StackFrameInfo implements StackFrame { -??? private final byte RETAIN_CLASS_REF = 0x01; +??? private final static byte RETAIN_CLASS_REF = 0x01; ???? private final static JavaLangInvokeAccess JLIA = ???????? SharedSecrets.getJavaLangInvokeAccess(); ???? private final byte flags; -??? private final Object memberName; -??? private final short bci; +??? private final Object memberName;??? // MemberName initialized by VM +??? private final int bci = -1;???????? // BCI set by VM ???? private volatile StackTraceElement ste; ???? /* -???? * Create StackFrameInfo for StackFrameTraverser and LiveStackFrameTraverser -???? * to use +???? * Construct an empty StackFrameInfo object that will be filled by the VM +???? * during stack walking. +???? * +???? * @see StackStreamFactory.AbstractStackWalker#callStackWalk +???? * @see StackStreamFactory.AbstractStackWalker#fetchStackFrames ????? */ ???? StackFrameInfo(StackWalker walker) { ???????? this.flags = walker.retainClassRef ? RETAIN_CLASS_REF : 0; -??????? this.bci = -1; ???????? this.memberName = JLIA.newMemberName(); ???? } From shade at redhat.com Mon Aug 12 19:06:08 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Mon, 12 Aug 2019 21:06:08 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> Message-ID: <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> On 8/12/19 9:01 PM, Mandy Chung wrote: > ?import jdk.internal.access.JavaLangInvokeAccess; > ?import jdk.internal.access.SharedSecrets; > +import jdk.internal.vm.annotation.Stable; Not needed anymore. > +??? private final int bci = -1;???????? // BCI set by VM AFAIU, this sets up the field to be "constant variable", which does run afoul the later VM injection. See for example: https://shipilev.net/jvm/anatomy-quarks/14-constant-variables/ > ???? StackFrameInfo(StackWalker walker) { > ???????? this.flags = walker.retainClassRef ? RETAIN_CLASS_REF : 0; > -??????? this.bci = -1; I'd keep initialization here instead of the field, see above why. -- Thanks, -Aleksey From mandy.chung at oracle.com Mon Aug 12 20:24:52 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 12 Aug 2019 13:24:52 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: Having a second thought, I'm keeping @Stable bci field while zero indicates an invalid BCI that makes it obvious that this field will be updated.? VM will set StackFrameInfo::bci to value+1. http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.03/ Mandy From naoto.sato at oracle.com Mon Aug 12 20:43:37 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Mon, 12 Aug 2019 13:43:37 -0700 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates Message-ID: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> Hello, Please review the fix to the following issue: https://bugs.openjdk.java.net/browse/JDK-8211990 The proposed changeset is located at: https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ The DateTimeException was thrown due to unconditional conversion beyond the valid range of the internal LocalDateTime value. If it happens, normalize two instants with the offset of "start" instant. The same kind of exception is observed with ZonedDateTime.until(), which is also fixed in this changeset. Naoto From scolebourne at joda.org Mon Aug 12 21:32:16 2019 From: scolebourne at joda.org (Stephen Colebourne) Date: Mon, 12 Aug 2019 22:32:16 +0100 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> Message-ID: +1 On Mon, 12 Aug 2019 at 21:44, wrote: > > Hello, > > Please review the fix to the following issue: > > https://bugs.openjdk.java.net/browse/JDK-8211990 > > The proposed changeset is located at: > > https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ > > The DateTimeException was thrown due to unconditional conversion beyond > the valid range of the internal LocalDateTime value. If it happens, > normalize two instants with the offset of "start" instant. The same kind > of exception is observed with ZonedDateTime.until(), which is also fixed > in this changeset. > > Naoto From lance.andersen at oracle.com Mon Aug 12 21:37:45 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Mon, 12 Aug 2019 17:37:45 -0400 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> Message-ID: <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> Looks good Naoto. One question I had which is not relevant to your fix, but should the tests as we modify them include the JTReg tags such as @bug, @summary?. etc? just for consistency?. Best Lance > On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com wrote: > > Hello, > > Please review the fix to the following issue: > > https://bugs.openjdk.java.net/browse/JDK-8211990 > > The proposed changeset is located at: > > https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ > > The DateTimeException was thrown due to unconditional conversion beyond the valid range of the internal LocalDateTime value. If it happens, normalize two instants with the offset of "start" instant. The same kind of exception is observed with ZonedDateTime.until(), which is also fixed in this changeset. > > Naoto Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From alexander.matveev at oracle.com Mon Aug 12 21:46:09 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Mon, 12 Aug 2019 14:46:09 -0700 Subject: RFR: JDK-8227172: revert JDK-8225569 on windows In-Reply-To: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> References: <1c4260e2-a931-5f8a-f223-8b7bb3d08e92@oracle.com> Message-ID: <4bc08bb2-ee18-c4d9-7958-c2691d580bbf@oracle.com> Looks good. On 8/10/2019 3:44 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > This change will remove the "bin" directory on windows and revert to > putting the executable(s) directly in output root dir. ( dir>/) > > [1] https://bugs.openjdk.java.net/browse/JDK-8227172 > > [2] http://cr.openjdk.java.net/~herrick/8227172/webrev.01/ > > /Andy > From naoto.sato at oracle.com Mon Aug 12 22:01:34 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Mon, 12 Aug 2019 15:01:34 -0700 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> Message-ID: Thank you for the review, Lance. On 8/12/19 2:37 PM, Lance Andersen wrote: > Looks good Naoto. > > One question I had which is not relevant to your fix, but should the > tests as we modify them include the JTReg tags such as @bug, @summary?. > etc? ?just for consistency?. I put @bug tags to each of the modified test, but not @summary, et.al. It seems that each test file corresponds to the java.time class, so adding @summary for this bug might not fit. I could add @summary to existing "Tests XXXX" statement, but keep it consistent with other java.time test case files. Naoto > > Best > Lance >> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com >> wrote: >> >> Hello, >> >> Please review the fix to the following issue: >> >> https://bugs.openjdk.java.net/browse/JDK-8211990 >> >> The proposed changeset is located at: >> >> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >> >> The DateTimeException was thrown due to unconditional conversion >> beyond the valid range of the internal LocalDateTime value. If it >> happens, normalize two instants with the offset of "start" instant. >> The same kind of exception is observed with ZonedDateTime.until(), >> which is also fixed in this changeset. >> >> Naoto > > > > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From lance.andersen at oracle.com Mon Aug 12 22:17:18 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Mon, 12 Aug 2019 18:17:18 -0400 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> Message-ID: <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> Hi Naoto, > On Aug 12, 2019, at 6:01 PM, naoto.sato at oracle.com wrote: > > Thank you for the review, Lance. > > On 8/12/19 2:37 PM, Lance Andersen wrote: >> Looks good Naoto. >> One question I had which is not relevant to your fix, but should the tests as we modify them include the JTReg tags such as @bug, @summary?. etc? just for consistency?. > > I put @bug tags to each of the modified test, but not @summary, et.al. It seems that each test file corresponds to the java.time class, so adding @summary for this bug might not fit. I could add @summary to existing "Tests XXXX" statement, but keep it consistent with other java.time test case files. I was thinking more similar to: open/test/jdk/jdk/nio/zipfs/TestPosix.java or open/test/jdk/java/nio/file/Files/StreamTest.java ?????? /* @test * @bug 8006884 8019526 8132539 * @library .. * @build PassThroughFileSystem FaultyFileSystem * @run testng StreamTest * @summary Unit test for java.nio.file.Files methods that return a Stream */ ???????? You won?t need the @run for these tests but each test is for a specific class such as OffsetDateTime and ZonedOffSetDateTime and all of the bugs are listed at the top of the file. I am not sure we have agreed to standardize this historically, but I tend to when I update a test if applicable. Anyways, just a suggestion? Feel free to ignore ;-) Have a good rest of your evening :-) > > Naoto > >> Best >> Lance >>> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com wrote: >>> >>> Hello, >>> >>> Please review the fix to the following issue: >>> >>> https://bugs.openjdk.java.net/browse/JDK-8211990 >>> >>> The proposed changeset is located at: >>> >>> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >>> >>> The DateTimeException was thrown due to unconditional conversion beyond the valid range of the internal LocalDateTime value. If it happens, normalize two instants with the offset of "start" instant. The same kind of exception is observed with ZonedDateTime.until(), which is also fixed in this changeset. >>> >>> Naoto >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From david.holmes at oracle.com Mon Aug 12 22:28:32 2019 From: david.holmes at oracle.com (David Holmes) Date: Tue, 13 Aug 2019 08:28:32 +1000 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: <3048d9fe-2a78-df8f-b799-380a1b885034@oracle.com> Hi Mandy, On 13/08/2019 6:24 am, Mandy Chung wrote: > Having a second thought, I'm keeping @Stable bci field while zero > indicates an invalid BCI that makes it obvious that this field will be > updated.? VM will set StackFrameInfo::bci to value+1. I don't know this code but why have the VM set the value one too many and then have the Java code subtract one again. ??? David > > http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.03/ > > Mandy From naoto.sato at oracle.com Mon Aug 12 22:34:51 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Mon, 12 Aug 2019 15:34:51 -0700 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> Message-ID: Hi Lance, Yes, I would like the style, but AFAIK, all java.time tests are testng, and controlled with the java/time/{test/tck}/TEST.properties file so that each test file won't need jtreg tags (it cannot override them either). Naoto On 8/12/19 3:17 PM, Lance Andersen wrote: > Hi Naoto, >> On Aug 12, 2019, at 6:01 PM, naoto.sato at oracle.com >> wrote: >> >> Thank you for the review, Lance. >> >> On 8/12/19 2:37 PM, Lance Andersen wrote: >>> Looks good Naoto. >>> One question I had which is not relevant to your fix, but should the >>> tests as we modify them include the JTReg tags such as @bug, >>> @summary?. etc? ?just for consistency?. >> >> I put @bug tags to each of the modified test, but not @summary, et.al. >> It seems that each test file corresponds to the java.time class, so >> adding @summary for this bug might not fit. I could add @summary to >> existing "Tests XXXX" statement, but keep it consistent with other >> java.time test case files. > > I was thinking more similar to: > > open/test/jdk/jdk/nio/zipfs/TestPosix.java or > open/test/jdk/java/nio/file/Files/StreamTest.java > > ?????? > > /* @test > * @bug 8006884 8019526 8132539 > * @library .. > * @build PassThroughFileSystem FaultyFileSystem > * @run testng StreamTest > * @summary Unit test for java.nio.file.Files methods that return a Stream > */ > > ???????? > > You won?t need the @run for these tests but each test is for a specific > class such as OffsetDateTime and ZonedOffSetDateTime and all of the bugs > are listed at the top of the file. > > I am not sure we have agreed to standardize this historically, but I > tend to when I update a test if applicable. > > Anyways, just a suggestion? Feel free to ignore ;-) > > Have a good rest of your evening :-) > >> >> Naoto >> >>> Best >>> Lance >>>> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com >>>> wrote: >>>> >>>> Hello, >>>> >>>> Please review the fix to the following issue: >>>> >>>> https://bugs.openjdk.java.net/browse/JDK-8211990 >>>> >>>> The proposed changeset is located at: >>>> >>>> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >>>> >>>> The DateTimeException was thrown due to unconditional conversion >>>> beyond the valid range of the internal LocalDateTime value. If it >>>> happens, normalize two instants with the offset of "start" instant. >>>> The same kind of exception is observed with ZonedDateTime.until(), >>>> which is also fixed in this changeset. >>>> >>>> Naoto >>> >>> >>> Lance >>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle?Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> > > > > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From lance.andersen at oracle.com Mon Aug 12 22:46:55 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Mon, 12 Aug 2019 18:46:55 -0400 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> Message-ID: <982B6A20-747F-4C0B-B9AA-51D9F436C0CA@oracle.com> Hi Naoto > On Aug 12, 2019, at 6:34 PM, naoto.sato at oracle.com wrote: > > Hi Lance, > > Yes, I would like the style, but AFAIK, all java.time tests are testng, and controlled with the java/time/{test/tck}/TEST.properties file so that each test file won't need jtreg tags (it cannot override them either). Yes the @build, at run, @library would be handled via the TEST.properties and are not needed for the test because of TEST.properties. The other tags are informational and do not impact the running of the test such as @test, @bug, @summary?. Anyways, no big deal either way, just thought I would ask. have a good evening Best lance > > Naoto > > On 8/12/19 3:17 PM, Lance Andersen wrote: >> Hi Naoto, >>> On Aug 12, 2019, at 6:01 PM, naoto.sato at oracle.com wrote: >>> >>> Thank you for the review, Lance. >>> >>> On 8/12/19 2:37 PM, Lance Andersen wrote: >>>> Looks good Naoto. >>>> One question I had which is not relevant to your fix, but should the tests as we modify them include the JTReg tags such as @bug, @summary?. etc? just for consistency?. >>> >>> I put @bug tags to each of the modified test, but not @summary, et.al. It seems that each test file corresponds to the java.time class, so adding @summary for this bug might not fit. I could add @summary to existing "Tests XXXX" statement, but keep it consistent with other java.time test case files. >> I was thinking more similar to: >> open/test/jdk/jdk/nio/zipfs/TestPosix.java or open/test/jdk/java/nio/file/Files/StreamTest.java >> ?????? >> /* @test >> * @bug 8006884 8019526 8132539 >> * @library .. >> * @build PassThroughFileSystem FaultyFileSystem >> * @run testng StreamTest >> * @summary Unit test for java.nio.file.Files methods that return a Stream >> */ >> ???????? >> You won?t need the @run for these tests but each test is for a specific class such as OffsetDateTime and ZonedOffSetDateTime and all of the bugs are listed at the top of the file. >> I am not sure we have agreed to standardize this historically, but I tend to when I update a test if applicable. >> Anyways, just a suggestion? Feel free to ignore ;-) >> Have a good rest of your evening :-) >>> >>> Naoto >>> >>>> Best >>>> Lance >>>>> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com wrote: >>>>> >>>>> Hello, >>>>> >>>>> Please review the fix to the following issue: >>>>> >>>>> https://bugs.openjdk.java.net/browse/JDK-8211990 >>>>> >>>>> The proposed changeset is located at: >>>>> >>>>> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >>>>> >>>>> The DateTimeException was thrown due to unconditional conversion beyond the valid range of the internal LocalDateTime value. If it happens, normalize two instants with the offset of "start" instant. The same kind of exception is observed with ZonedDateTime.until(), which is also fixed in this changeset. >>>>> >>>>> Naoto >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mandy.chung at oracle.com Mon Aug 12 22:55:20 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 12 Aug 2019 15:55:20 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <3048d9fe-2a78-df8f-b799-380a1b885034@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <3048d9fe-2a78-df8f-b799-380a1b885034@oracle.com> Message-ID: <5ffe8378-f3ad-aaf8-4d92-31dbf0cfa654@oracle.com> On 8/12/19 3:28 PM, David Holmes wrote: > Hi Mandy, > > On 13/08/2019 6:24 am, Mandy Chung wrote: >> Having a second thought, I'm keeping @Stable bci field while zero >> indicates an invalid BCI that makes it obvious that this field will >> be updated.? VM will set StackFrameInfo::bci to value+1. > > I don't know this code but why have the VM set the value one too many > and then have the Java code subtract one again. ??? I keep it as @Stable field be initialized once by VM and it means that 0 indicates an invalid bci.?? It could be made as final field but initialized in the constructor to -1 and then set by VM.? I opt for webrev.03 to make it clear it's initialized later by the VM once. Mandy From david.holmes at oracle.com Mon Aug 12 23:30:43 2019 From: david.holmes at oracle.com (David Holmes) Date: Tue, 13 Aug 2019 09:30:43 +1000 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <5ffe8378-f3ad-aaf8-4d92-31dbf0cfa654@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <3048d9fe-2a78-df8f-b799-380a1b885034@oracle.com> <5ffe8378-f3ad-aaf8-4d92-31dbf0cfa654@oracle.com> Message-ID: <33ff537c-27ef-e5ac-0869-c8b145f8b7c0@oracle.com> On 13/08/2019 8:55 am, Mandy Chung wrote: > On 8/12/19 3:28 PM, David Holmes wrote: >> Hi Mandy, >> >> On 13/08/2019 6:24 am, Mandy Chung wrote: >>> Having a second thought, I'm keeping @Stable bci field while zero >>> indicates an invalid BCI that makes it obvious that this field will >>> be updated.? VM will set StackFrameInfo::bci to value+1. >> >> I don't know this code but why have the VM set the value one too many >> and then have the Java code subtract one again. ??? > > I keep it as @Stable field be initialized once by VM and it means that 0 > indicates an invalid bci.?? It could be made as final field but > initialized in the constructor to -1 and then set by VM.? I opt for > webrev.03 to make it clear it's initialized later by the VM once. I see, so the zero is a constraint of it being @Stable. So we offset by 1 at both ends so that we return -1 when not set. Otherwise we'd need to special-case for zero. Okay I get it. Thanks. Not a review though as I do not know this code. David > Mandy From brent.christian at oracle.com Mon Aug 12 23:46:48 2019 From: brent.christian at oracle.com (Brent Christian) Date: Mon, 12 Aug 2019 16:46:48 -0700 Subject: RFR: 8226297: Dual-pivot quicksort improvements In-Reply-To: References: <0bb235c8-a39c-addb-485a-d10664b3653b@oracle.com> <64e3ebb1-095e-08c0-ffc1-125346e2c960@oracle.com> <1565120849.689130733@f473.i.mail.ru> Message-ID: <392719f4-d67c-f900-0f2d-6c9f826a5392@oracle.com> Hi, I received an update from Vladimir: ----------------------------------- "I investigated approach with adaptive threshold for mixed insertion sort and have the following results. New version shows the same gain for large arrays and has few percents of speed up for small arrays: total gain: size = 150, char, was: 0.10 -> new: 0.17 size = 150, int, was: 0.15 -> new: 0.18 size = 150, short, was: 0.14 -> new: 0.16 See new version in attachment. The changes are simple and safety: initial threshold for insertion sort was increased from 41 to 44, initial threshold for mixed insertion sort was decreased from 114 to 65, but the size is compared with adaptive threshold if (size < MAX_MIXED_INSERTION_SORT_SIZE + bits && .... (was: if (size < MAX_MIXED_INSERTION_SORT_SIZE && ....) Variable bits is increased by 6 instead of 2." ----------------------------------- I've incorporated this change in an updated webrev, here: http://cr.openjdk.java.net/~bchristi/8226297/webrev05-adaptive/webrev/ For convenience, I made .diffs from the previous version (webrev04) for DualPivotQuickSort.java[1] and Arrays.java[2 - change to trailing white-space, only]. -Brent 1. http://cr.openjdk.java.net/~bchristi/8226297/webrev05-adaptive/DualPivotQuicksort.java.diff 2. http://cr.openjdk.java.net/~bchristi/8226297/webrev05-adaptive/Arrays.java.diff From frederic.parain at oracle.com Tue Aug 13 00:13:22 2019 From: frederic.parain at oracle.com (Frederic Parain) Date: Mon, 12 Aug 2019 20:13:22 -0400 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: This looks good to me, with two comments: I don?t like the static final RETAIN_CLASS_REF for the same reasons as Aleksey, but I can live with that. The protocol between the JVM and the Java class is well explained on the JVM side (javaClasses.cpp:4227). I think it would be valuable to provide the same description on the Java side, the comment in StackFrameInfo.java:42 describes only part of the protocol. No need for another review from me. Regards, Fred > On Aug 12, 2019, at 16:24, Mandy Chung wrote: > > Having a second thought, I'm keeping @Stable bci field while zero indicates an invalid BCI that makes it obvious that this field will be updated. VM will set StackFrameInfo::bci to value+1. > > http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.03/ > > Mandy From alexander.matveev at oracle.com Tue Aug 13 00:38:04 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Mon, 12 Aug 2019 17:38:04 -0700 Subject: RFR: JDK-8226534: combination of windows options cause exception in MsiBundler Message-ID: <9ce9d804-879b-924a-0ec5-78d59afeebc4@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - Fixed by adding --install-dir folders to RemoveFile table as per Wixs requirements. [1] https://bugs.openjdk.java.net/browse/JDK-8226534 [2] http://cr.openjdk.java.net/~almatvee/8226534/webrev.00/ Thanks, Alexander From andy.herrick at oracle.com Tue Aug 13 01:22:52 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 12 Aug 2019 21:22:52 -0400 Subject: RFR: JDK-8226534: combination of windows options cause exception in MsiBundler In-Reply-To: <9ce9d804-879b-924a-0ec5-78d59afeebc4@oracle.com> References: <9ce9d804-879b-924a-0ec5-78d59afeebc4@oracle.com> Message-ID: <930aa003-9fa3-c783-bbd9-3487073c2fe0@oracle.com> looks good. /Andy On 8/12/2019 8:38 PM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Fixed by adding --install-dir folders to RemoveFile table as per > Wixs requirements. > > [1] https://bugs.openjdk.java.net/browse/JDK-8226534 > > [2] http://cr.openjdk.java.net/~almatvee/8226534/webrev.00/ > > Thanks, > Alexander From mandy.chung at oracle.com Tue Aug 13 01:33:34 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 12 Aug 2019 18:33:34 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: On 8/12/19 5:13 PM, Frederic Parain wrote: > This looks good to me, with two comments: > > I don?t like the static final RETAIN_CLASS_REF for the same > reasons as Aleksey, but I can live with that. I didn't see Aleksey's comment about RETAIN_CLASS_REF (what is it?).? Now that it draws my attention.?? Since there is no other flag at the moment, we can simplify it and rename the flags field to a boolean retainClassRef field. > The protocol between the JVM and the Java class is well explained > on the JVM side (javaClasses.cpp:4227). I think it would be valuable > to provide the same description on the Java side, the comment in > StackFrameInfo.java:42 describes only part of the protocol. Good suggestion.? Added: 96 // VM adds 1 to the code index to StackFrameInfo::bci field such that 97 // zero (and negative values) indicates invalid BCI. So substract 1. http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.04/ Mandy > No need for another review from me. > > Regards, > > Fred > > >> On Aug 12, 2019, at 16:24, Mandy Chung wrote: >> >> Having a second thought, I'm keeping @Stable bci field while zero indicates an invalid BCI that makes it obvious that this field will be updated. VM will set StackFrameInfo::bci to value+1. >> >> http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.03/ >> >> Mandy From xu.y.yin at oracle.com Tue Aug 13 02:01:38 2019 From: xu.y.yin at oracle.com (Chris Yin) Date: Tue, 13 Aug 2019 10:01:38 +0800 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection Message-ID: <8989EF67-D636-4AFF-9A9A-2596C33B10CE@oracle.com> > On 9 Aug 2019, at 1:59 AM, Roger Riggs wrote: > > ... > Is handling Unbind in the switch needed (as different from the default). Sorry, I forgot this, it?s a placeholder to handle UNBIND_REQUEST further, per ldap protocol, server will close the connection when received unbind request from client (no response required), since the test will shutdown server shortly and we don?t have special intention for unbind, so it?s ok to remove unbind in switch. Thanks, Chris From daniel.fuchs at oracle.com Tue Aug 13 09:02:58 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 13 Aug 2019 10:02:58 +0100 Subject: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works In-Reply-To: <94fc96c4-84bb-7425-25c2-f55f3c3a844b@oracle.com> References: <8a3743fc-5ac3-0f79-2ee5-9814de6444e7@oracle.com> <6c13f13b-e08f-af91-f583-8acf48ee7182@oracle.com> <4b7cae81-2066-1b66-9f44-085b29bd5215@oracle.com> <94fc96c4-84bb-7425-25c2-f55f3c3a844b@oracle.com> Message-ID: <90042e06-a9c3-c2b9-fc79-f6ee227aee30@oracle.com> Hi Mandy, This looks good to me. best regards, -- daniel On 31/07/2019 21:59, Mandy Chung wrote: > Hi Peter, Daniel [...] > This is correct when this class is a subclass of C.?? A slight > clarification to indicate that aMethod's declaring class is C might > help.? I also fixed another typo: > > --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java > +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java > @@ -334,7 +334,7 @@ > * > * > * {@link java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)} > - * {@code static}
{@code FT f;}{@code (T) C.f;} > + * {@code static}
{@code FT f;}{@code (FT) C.f;} > * > * > * {@link java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)} > @@ -377,8 +377,8 @@ > * {@code C(A*);}{@code (C) aConstructor.newInstance(arg*);} > * > * > - * {@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)} > - * ({@code static})?
{@code T m(A*);}{@code (T) aMethod.invoke(thisOrNull, arg*);} > + * {@link java.lang.invoke.MethodHandles.Lookup#unreflectSpecial lookup.unreflectSpecial(aMethod,this.class)} > + * {@code T m(A*);}{@code (T) super.m(arg*);} > * > * > * {@link java.lang.invoke.MethodHandles.Lookup#findClass lookup.findClass("C")} > @@ -403,7 +403,7 @@ > * stands for a null reference if the accessed method or field is static, > * and {@code this} otherwise. > * The names {@code aMethod}, {@code aField}, and {@code aConstructor} stand > - * for reflective objects corresponding to the given members. > + * for reflective objects corresponding to the given members declared in type {@code C}. > *

> * The bytecode behavior for a {@code findClass} operation is a load of a constant class, > * as if by {@code ldc CONSTANT_Class}. > > > Thanks. > Mandy From peter.levart at gmail.com Tue Aug 13 09:17:59 2019 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 13 Aug 2019 11:17:59 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: <5bac430a-3bb8-dec8-b47c-43208401ddd0@gmail.com> Hi Mandy, Just a question... On 8/12/19 10:24 PM, Mandy Chung wrote: > Having a second thought, I'm keeping @Stable bci field while zero > indicates an invalid BCI that makes it obvious that this field will be > updated.? VM will set StackFrameInfo::bci to value+1. > > http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.03/ > > Mandy What are you trying to achieve with @Stable annotation? If you were hoping for eventual optimization by JIT (i.e. constant folding) then this would only be effective if JIT could prove that the reference to the StackFrameInfo instance can also be constant folded. This is very unlikely considering the use cases of StackFrameInfo objects (results returned by StackWalker API). There are currently no other optimizations that I know of that would pertain to @Stable annotation. If you were hoping to achieve some kind of "safer" publication of StackFrameInfo instances (like for example when the fields are final and initialized in the constructor) then @Stable is not a replacement for final. Even if you declared bci as final, its effective value is assigned in the VM after constructor is finished. So the JMM rules for final fields can not apply here. So it is my belief that neither placing @Stable nor final on the bci has any desirable effect. I would just leave it as plain instance field. I do like the zero default value of it and corresponding +/-1 offset computations in the getter and initialization code. If there is a data race when publishing StackFrameInfo objects unsafely to other threads, let there be only two values that are observable instead of three. BTW the unsafe publication applies not only to bci value but to the whole instance referenced by the 'memberName' field. The field is final and initialized in the constructor, but the MemberName instance is modified afterwards... So let's not pretend publishing StackFrameInfo via data race is safe (like for example String objects). And I think it is not critical to be safe - no security decisions are being made on the StackFrameInfo objects' content, right? Regards, Peter From julia.boes at oracle.com Tue Aug 13 13:33:11 2019 From: julia.boes at oracle.com (Julia Boes) Date: Tue, 13 Aug 2019 14:33:11 +0100 Subject: Fwd: Re: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods In-Reply-To: <9eb74cb1-7f86-4068-52e1-ff79b669671f@oracle.com> References: <9eb74cb1-7f86-4068-52e1-ff79b669671f@oracle.com> Message-ID: <692662b5-b232-309f-e062-9596d6aea6c7@oracle.com> Forwarding this thread to the right list! -------- Forwarded Message -------- Subject: Re: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods Date: Tue, 13 Aug 2019 13:51:02 +0100 From: Julia Boes To: Lance Andersen CC: jdk-dev at openjdk.java.net Hi Lance, Thanks for your suggestions. I incorporated them, except for the change of the compatibility risk because that Jira doesn't accept the option 'None' for this field :( Best, Julia On 13/08/2019 12:55, Lance Andersen wrote: > Hi Julia, > > I added myself as a reviewer. > > A couple of suggestions to consider: > > Update: > > ?????? > A minor fix of the javadoc in java.lang.Math. The methods > decrementExact(), incrementExact(), and negateExact() ?declare they > throw a ArithmeticException, and as such should be included in the > list of operations that can detect overflow in the class-level javadoc. > ???????? > > to > > ??? > Clarify the javadoc class summary for java.lang.Math class ?to > indicate that the methods s decrementExact(), incrementExact() and > negateExact() ? throw a ArithmeticException when the results overflow > ???? > > For compatibility risk it ?would be none (there is no behavioral change); > > For the compatibility description ?I would also clarify that thereis > no behavioral change > > Compatibility kind is probably best as behavioral given you are > clarifying what actually can happen for the methods. > > > You are good to go and you can finalize as this will be an easy > (famous last words) review/approval :-) > > HTH > > Best > Lance > >> On Aug 13, 2019, at 7:32 AM, Julia Boes > > wrote: >> >> Hi Lance, >> >> Thanks for the info. >> >> CSR: https://bugs.openjdk.java.net/browse/JDK-8229473 >> >> Best, >> >> Julia >> >> On 13/08/2019 11:25, Lance Andersen wrote: >>> Hi Julia, >>> >>> I think this looks OK. ?I would create a CSR as the changes while >>> minor should get tracked and a final approval via a CSR. >>> >>> Best >>> Lance >>>> On Aug 13, 2019, at 6:16 AM, Julia Boes >>> > wrote: >>>> >>>> Hi, >>>> >>>> This is a minor fix of the javadoc in java.lang.Math. The methods >>>> decrementExact(), incrementExact() and negateExact()? declare they >>>> throw a ArithmeticException, and as such should be included in the >>>> list of operations that can detect overflow in the class-level javadoc. >>>> >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8229337 >>>> Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229337/webrev.00/ >>>> >>>> Is a CSR request needed? >>>> >>>> Thanks, >>>> Julia >>>> >>>> >>> >>> >>> >>> >>> Lance >>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle?Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >>> >>> > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From Roger.Riggs at oracle.com Tue Aug 13 13:48:16 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 13 Aug 2019 09:48:16 -0400 Subject: Fwd: Re: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods In-Reply-To: <692662b5-b232-309f-e062-9596d6aea6c7@oracle.com> References: <9eb74cb1-7f86-4068-52e1-ff79b669671f@oracle.com> <692662b5-b232-309f-e062-9596d6aea6c7@oracle.com> Message-ID: Hi Julia, Looks good. In the compatibility description, I would lead with the "No behavioral change". Since this is part of the specification, the code (implementation) is not relevant to the change. Thanks, Roger On 8/13/19 9:33 AM, Julia Boes wrote: > Forwarding this thread to the right list! > > > > -------- Forwarded Message -------- > Subject:???? Re: RFR: 8229337: java.lang.Math class doc should be > adjusted regarding -Exact methods > Date:???? Tue, 13 Aug 2019 13:51:02 +0100 > From:???? Julia Boes > To:???? Lance Andersen > CC:???? jdk-dev at openjdk.java.net > > > > Hi Lance, > > Thanks for your suggestions. I incorporated them, except for the > change of the compatibility risk because that Jira doesn't accept the > option 'None' for this field :( > > Best, > > Julia > > On 13/08/2019 12:55, Lance Andersen wrote: >> Hi Julia, >> >> I added myself as a reviewer. >> >> A couple of suggestions to consider: >> >> Update: >> >> ?????? >> A minor fix of the javadoc in java.lang.Math. The methods >> decrementExact(), incrementExact(), and negateExact() ?declare they >> throw a ArithmeticException, and as such should be included in the >> list of operations that can detect overflow in the class-level javadoc. >> ???????? >> >> to >> >> ??? >> Clarify the javadoc class summary for java.lang.Math class ?to >> indicate that the methods s decrementExact(), incrementExact() and >> negateExact() ? throw a ArithmeticException when the results overflow >> ???? >> >> For compatibility risk it ?would be none (there is no behavioral >> change); >> >> For the compatibility description ?I would also clarify that thereis >> no behavioral change >> >> Compatibility kind is probably best as behavioral given you are >> clarifying what actually can happen for the methods. >> >> >> You are good to go and you can finalize as this will be an easy >> (famous last words) review/approval :-) >> >> HTH >> >> Best >> Lance >> >>> On Aug 13, 2019, at 7:32 AM, Julia Boes >> > wrote: >>> >>> Hi Lance, >>> >>> Thanks for the info. >>> >>> CSR: https://bugs.openjdk.java.net/browse/JDK-8229473 >>> >>> Best, >>> >>> Julia >>> >>> On 13/08/2019 11:25, Lance Andersen wrote: >>>> Hi Julia, >>>> >>>> I think this looks OK. ?I would create a CSR as the changes while >>>> minor should get tracked and a final approval via a CSR. >>>> >>>> Best >>>> Lance >>>>> On Aug 13, 2019, at 6:16 AM, Julia Boes >>>> > wrote: >>>>> >>>>> Hi, >>>>> >>>>> This is a minor fix of the javadoc in java.lang.Math. The methods >>>>> decrementExact(), incrementExact() and negateExact()? declare they >>>>> throw a ArithmeticException, and as such should be included in the >>>>> list of operations that can detect overflow in the class-level >>>>> javadoc. >>>>> >>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8229337 >>>>> Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229337/webrev.00/ >>>>> >>>>> Is a CSR request needed? >>>>> >>>>> Thanks, >>>>> Julia >>>>> >>>>> >>>> >>>> >>>> >>>> >>>> >>>> Lance >>>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle?Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >>>> >>>> >> >> >> >> >> Lance >> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle?Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> From julia.boes at oracle.com Tue Aug 13 13:54:09 2019 From: julia.boes at oracle.com (Julia Boes) Date: Tue, 13 Aug 2019 14:54:09 +0100 Subject: Fwd: Re: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods In-Reply-To: References: <9eb74cb1-7f86-4068-52e1-ff79b669671f@oracle.com> <692662b5-b232-309f-e062-9596d6aea6c7@oracle.com> Message-ID: <13dbe87a-94bd-08e8-61cc-6311d4076912@oracle.com> Hi Roger, Changed - Thanks for reviewing! Cheers, Julia On 13/08/2019 14:48, Roger Riggs wrote: > Hi Julia, > > Looks good. > > In the compatibility description, I would lead with the "No behavioral > change". > Since this is part of the specification, the code (implementation) is > not relevant to the change. > > Thanks, Roger > > > On 8/13/19 9:33 AM, Julia Boes wrote: >> Forwarding this thread to the right list! >> >> >> >> -------- Forwarded Message -------- >> Subject:???? Re: RFR: 8229337: java.lang.Math class doc should be >> adjusted regarding -Exact methods >> Date:???? Tue, 13 Aug 2019 13:51:02 +0100 >> From:???? Julia Boes >> To:???? Lance Andersen >> CC:???? jdk-dev at openjdk.java.net >> >> >> >> Hi Lance, >> >> Thanks for your suggestions. I incorporated them, except for the >> change of the compatibility risk because that Jira doesn't accept the >> option 'None' for this field :( >> >> Best, >> >> Julia >> >> On 13/08/2019 12:55, Lance Andersen wrote: >>> Hi Julia, >>> >>> I added myself as a reviewer. >>> >>> A couple of suggestions to consider: >>> >>> Update: >>> >>> ?????? >>> A minor fix of the javadoc in java.lang.Math. The methods >>> decrementExact(), incrementExact(), and negateExact() ?declare they >>> throw a ArithmeticException, and as such should be included in the >>> list of operations that can detect overflow in the class-level javadoc. >>> ???????? >>> >>> to >>> >>> ??? >>> Clarify the javadoc class summary for java.lang.Math class ?to >>> indicate that the methods s decrementExact(), incrementExact() and >>> negateExact() ? throw a ArithmeticException when the results overflow >>> ???? >>> >>> For compatibility risk it ?would be none (there is no behavioral >>> change); >>> >>> For the compatibility description ?I would also clarify that thereis >>> no behavioral change >>> >>> Compatibility kind is probably best as behavioral given you are >>> clarifying what actually can happen for the methods. >>> >>> >>> You are good to go and you can finalize as this will be an easy >>> (famous last words) review/approval :-) >>> >>> HTH >>> >>> Best >>> Lance >>> >>>> On Aug 13, 2019, at 7:32 AM, Julia Boes >>> > wrote: >>>> >>>> Hi Lance, >>>> >>>> Thanks for the info. >>>> >>>> CSR: https://bugs.openjdk.java.net/browse/JDK-8229473 >>>> >>>> Best, >>>> >>>> Julia >>>> >>>> On 13/08/2019 11:25, Lance Andersen wrote: >>>>> Hi Julia, >>>>> >>>>> I think this looks OK. ?I would create a CSR as the changes while >>>>> minor should get tracked and a final approval via a CSR. >>>>> >>>>> Best >>>>> Lance >>>>>> On Aug 13, 2019, at 6:16 AM, Julia Boes >>>>> > wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> This is a minor fix of the javadoc in java.lang.Math. The methods >>>>>> decrementExact(), incrementExact() and negateExact()? declare >>>>>> they throw a ArithmeticException, and as such should be included >>>>>> in the list of operations that can detect overflow in the >>>>>> class-level javadoc. >>>>>> >>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8229337 >>>>>> Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229337/webrev.00/ >>>>>> >>>>>> Is a CSR request needed? >>>>>> >>>>>> Thanks, >>>>>> Julia >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Lance >>>>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle?Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>>>> >>>>> >>>>> >>> >>> >>> >>> >>> Lance >>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle?Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >>> >>> > From shade at redhat.com Tue Aug 13 13:57:00 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Tue, 13 Aug 2019 15:57:00 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: On 8/13/19 3:33 AM, Mandy Chung wrote: > On 8/12/19 5:13 PM, Frederic Parain wrote: > 96 // VM adds 1 to the code index to StackFrameInfo::bci field such that > 97 // zero (and negative values) indicates invalid BCI. So substract 1. > > http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.04/ I still do not understand the purpose of @Stable here. It seems to complicate the whole thing, and for what, exactly? Why can't we be happy with just "final int bci"? -Aleksey From brian.burkhalter at oracle.com Tue Aug 13 14:43:28 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 13 Aug 2019 07:43:28 -0700 Subject: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods In-Reply-To: <764b3be1-f820-4289-610e-fa4887512dc0@oracle.com> References: <764b3be1-f820-4289-610e-fa4887512dc0@oracle.com> Message-ID: <99CC3090-7A14-496E-A861-0EDCD3939F4C@oracle.com> Hi Julia, I think this looks OK but I would consider expanding the scope to add the three methods to StrictMath as well. Either that or file a separate issue for that purpose. Thanks, Brian > On Aug 13, 2019, at 3:16 AM, Julia Boes wrote: > > This is a minor fix of the javadoc in java.lang.Math. The methods decrementExact(), incrementExact() and negateExact() declare they throw a ArithmeticException, and as such should be included in the list of operations that can detect overflow in the class-level javadoc. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229337 > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229337/webrev.00/ From naoto.sato at oracle.com Tue Aug 13 15:06:41 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Tue, 13 Aug 2019 08:06:41 -0700 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <982B6A20-747F-4C0B-B9AA-51D9F436C0CA@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> <982B6A20-747F-4C0B-B9AA-51D9F436C0CA@oracle.com> Message-ID: <4b4e4dd4-defc-f13b-c881-681dd759f51b@oracle.com> Hi Lance, I modified the headers of those two test cases as follows: http://cr.openjdk.java.net/~naoto/8211990/webrev.01/ Didn't bother changing others :-) Naoto On 8/12/19 3:46 PM, Lance Andersen wrote: > Hi Naoto >> On Aug 12, 2019, at 6:34 PM, naoto.sato at oracle.com >> wrote: >> >> Hi Lance, >> >> Yes, I would like the style, but AFAIK, all java.time tests are >> testng, and controlled with the java/time/{test/tck}/TEST.properties >> file so that each test file won't need jtreg tags (it cannot override >> them either). > > Yes the @build, at run, @library would be handled via the TEST.properties > and are not needed for the test because of TEST.properties. > > The other tags are informational and do not impact the running of the > test such as @test, @bug, @summary?. > > Anyways, no big deal either way, just thought I would ask. > > have a good evening > > Best > lance >> >> Naoto >> >> On 8/12/19 3:17 PM, Lance Andersen wrote: >>> Hi Naoto, >>>> On Aug 12, 2019, at 6:01 PM, naoto.sato at oracle.com >>>> wrote: >>>> >>>> Thank you for the review, Lance. >>>> >>>> On 8/12/19 2:37 PM, Lance Andersen wrote: >>>>> Looks good Naoto. >>>>> One question I had which is not relevant to your fix, but should >>>>> the tests as we modify them include the JTReg tags such as @bug, >>>>> @summary?. etc? ?just for consistency?. >>>> >>>> I put @bug tags to each of the modified test, but not @summary, >>>> et.al. It seems that each test file corresponds to the java.time >>>> class, so adding @summary for this bug might not fit. I could add >>>> @summary to existing "Tests XXXX" statement, but keep it consistent >>>> with other java.time test case files. >>> I was thinking more similar to: >>> open/test/jdk/jdk/nio/zipfs/TestPosix.java or >>> open/test/jdk/java/nio/file/Files/StreamTest.java >>> ?????? >>> /* @test >>> * @bug 8006884 8019526 8132539 >>> * @library .. >>> * @build PassThroughFileSystem FaultyFileSystem >>> * @run testng StreamTest >>> * @summary Unit test for java.nio.file.Files methods that return a Stream >>> */ >>> ???????? >>> You won?t need the @run for these tests but each test is for a >>> specific class such as OffsetDateTime and ZonedOffSetDateTime and all >>> of the bugs are listed at the top of the file. >>> I am not sure we have agreed to standardize this historically, but I >>> tend to when I update a test if applicable. >>> Anyways, just a suggestion? Feel free to ignore ;-) >>> Have a good rest of your evening :-) >>>> >>>> Naoto >>>> >>>>> Best >>>>> Lance >>>>>> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com >>>>>> >>>>>> wrote: >>>>>> >>>>>> Hello, >>>>>> >>>>>> Please review the fix to the following issue: >>>>>> >>>>>> https://bugs.openjdk.java.net/browse/JDK-8211990 >>>>>> >>>>>> The proposed changeset is located at: >>>>>> >>>>>> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >>>>>> >>>>>> The DateTimeException was thrown due to unconditional conversion >>>>>> beyond the valid range of the internal LocalDateTime value. If it >>>>>> happens, normalize two instants with the offset of "start" >>>>>> instant. The same kind of exception is observed with >>>>>> ZonedDateTime.until(), which is also fixed in this changeset. >>>>>> >>>>>> Naoto >>>>> >>>>> >>>>> Lance >>>>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle?Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>>>> >>> >>> >>> Lance >>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle?Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> > > > > Lance Andersen| > Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From mandy.chung at oracle.com Tue Aug 13 15:48:07 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 13 Aug 2019 08:48:07 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <5bac430a-3bb8-dec8-b47c-43208401ddd0@gmail.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <5bac430a-3bb8-dec8-b47c-43208401ddd0@gmail.com> Message-ID: Peter, Aleksey, On 8/13/19 2:17 AM, Peter Levart wrote: > What are you trying to achieve with @Stable annotation? > I chose the path of using it for at least documentation purpose that it is initialized once after :)? This field is not final as it's modified by the VM but it's a stable variable that can benefit from JIT optimization while it's unlikely a hot path with the current usage. > If you were hoping for eventual optimization by JIT (i.e. constant > folding) then this would only be effective if JIT could prove that the > reference to the StackFrameInfo instance can also be constant folded. > This is very unlikely considering the use cases of StackFrameInfo > objects (results returned by StackWalker API). There are currently no > other optimizations that I know of that would pertain to @Stable > annotation. > > If you were hoping to achieve some kind of "safer" publication of > StackFrameInfo instances (like for example when the fields are final > and initialized in the constructor) then @Stable is not a replacement > for final. Even if you declared bci as final, its effective value is > assigned in the VM after constructor is finished. So the JMM rules for > final fields can not apply here. So it is my belief that neither > placing @Stable nor final on the bci has any desirable effect. I would > just leave it as plain instance field. There is no existing way to annotate a stable variable besides comments.? It's fair to wait until we have data to show performance benefit to add @Stable.?? None of the choices (int, final int, @Stable int) is ideal.?? I'll drop @Stable in webrev.04 and move on if that's okay with you. > I do like the zero default value of it and corresponding +/-1 offset > computations in the getter and initialization code. If there is a data > race when publishing StackFrameInfo objects unsafely to other threads, > let there be only two values that are observable instead of three. BTW > the unsafe publication applies not only to bci value but to the whole > instance referenced by the 'memberName' field. The field is final and > initialized in the constructor, but the MemberName instance is > modified afterwards... > True. > So let's not pretend publishing StackFrameInfo via data race is safe > (like for example String objects). And I think it is not critical to > be safe - no security decisions are being made on the StackFrameInfo > objects' content, right? > Right. Mandy > Regards, Peter > From lance.andersen at oracle.com Tue Aug 13 15:49:09 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Tue, 13 Aug 2019 11:49:09 -0400 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <4b4e4dd4-defc-f13b-c881-681dd759f51b@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> <982B6A20-747F-4C0B-B9AA-51D9F436C0CA@oracle.com> <4b4e4dd4-defc-f13b-c881-681dd759f51b@oracle.com> Message-ID: <3B02DAE6-F460-463A-B6C1-B7E01EAAEFC7@oracle.com> Hi Naoto, Thank you for adding the heading. you rock :-) > On Aug 13, 2019, at 11:06 AM, naoto.sato at oracle.com wrote: > > Hi Lance, > > I modified the headers of those two test cases as follows: > > http://cr.openjdk.java.net/~naoto/8211990/webrev.01/ > > Didn't bother changing others :-) > > Naoto > > On 8/12/19 3:46 PM, Lance Andersen wrote: >> Hi Naoto >>> On Aug 12, 2019, at 6:34 PM, naoto.sato at oracle.com wrote: >>> >>> Hi Lance, >>> >>> Yes, I would like the style, but AFAIK, all java.time tests are testng, and controlled with the java/time/{test/tck}/TEST.properties file so that each test file won't need jtreg tags (it cannot override them either). >> Yes the @build, at run, @library would be handled via the TEST.properties and are not needed for the test because of TEST.properties. >> The other tags are informational and do not impact the running of the test such as @test, @bug, @summary?. >> Anyways, no big deal either way, just thought I would ask. >> have a good evening >> Best >> lance >>> >>> Naoto >>> >>> On 8/12/19 3:17 PM, Lance Andersen wrote: >>>> Hi Naoto, >>>>> On Aug 12, 2019, at 6:01 PM, naoto.sato at oracle.com wrote: >>>>> >>>>> Thank you for the review, Lance. >>>>> >>>>> On 8/12/19 2:37 PM, Lance Andersen wrote: >>>>>> Looks good Naoto. >>>>>> One question I had which is not relevant to your fix, but should the tests as we modify them include the JTReg tags such as @bug, @summary?. etc? just for consistency?. >>>>> >>>>> I put @bug tags to each of the modified test, but not @summary, et.al. It seems that each test file corresponds to the java.time class, so adding @summary for this bug might not fit. I could add @summary to existing "Tests XXXX" statement, but keep it consistent with other java.time test case files. >>>> I was thinking more similar to: >>>> open/test/jdk/jdk/nio/zipfs/TestPosix.java or open/test/jdk/java/nio/file/Files/StreamTest.java >>>> ?????? >>>> /* @test >>>> * @bug 8006884 8019526 8132539 >>>> * @library .. >>>> * @build PassThroughFileSystem FaultyFileSystem >>>> * @run testng StreamTest >>>> * @summary Unit test for java.nio.file.Files methods that return a Stream >>>> */ >>>> ???????? >>>> You won?t need the @run for these tests but each test is for a specific class such as OffsetDateTime and ZonedOffSetDateTime and all of the bugs are listed at the top of the file. >>>> I am not sure we have agreed to standardize this historically, but I tend to when I update a test if applicable. >>>> Anyways, just a suggestion? Feel free to ignore ;-) >>>> Have a good rest of your evening :-) >>>>> >>>>> Naoto >>>>> >>>>>> Best >>>>>> Lance >>>>>>> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com wrote: >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Please review the fix to the following issue: >>>>>>> >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8211990 >>>>>>> >>>>>>> The proposed changeset is located at: >>>>>>> >>>>>>> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >>>>>>> >>>>>>> The DateTimeException was thrown due to unconditional conversion beyond the valid range of the internal LocalDateTime value. If it happens, normalize two instants with the offset of "start" instant. The same kind of exception is observed with ZonedDateTime.until(), which is also fixed in this changeset. >>>>>>> >>>>>>> Naoto >>>>>> >>>>>> >>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>>> Oracle Java Engineering >>>>>> 1 Network Drive >>>>>> Burlington, MA 01803 >>>>>> Lance.Andersen at oracle.com >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From Roger.Riggs at oracle.com Tue Aug 13 15:53:32 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 13 Aug 2019 11:53:32 -0400 Subject: RFR: 8211990: DateTimeException thrown when calculating duration between certain dates In-Reply-To: <3B02DAE6-F460-463A-B6C1-B7E01EAAEFC7@oracle.com> References: <4232fb0d-82d0-7980-d406-1fa79d8855a1@oracle.com> <0524C3BC-4457-430F-99B0-74A58A50C517@oracle.com> <0AF22AB2-A435-4664-AB47-8E20A4C55675@oracle.com> <982B6A20-747F-4C0B-B9AA-51D9F436C0CA@oracle.com> <4b4e4dd4-defc-f13b-c881-681dd759f51b@oracle.com> <3B02DAE6-F460-463A-B6C1-B7E01EAAEFC7@oracle.com> Message-ID: <9631fc6c-cdda-d216-6756-8f1efe1fe6ea@oracle.com> +1 on the bug fix. (I wouldn't spend time changing a bunch of tests that have a consistent style of their own. Having a few that look different is inconsistent and 'wrong'.? And I wouldn't fix even one of them. No one is mechanically looking for @summary in these tests and its just make-work.) Roger On 8/13/19 11:49 AM, Lance Andersen wrote: > Hi Naoto, > > Thank you for adding the heading. you rock :-) > > >> On Aug 13, 2019, at 11:06 AM, naoto.sato at oracle.com wrote: >> >> Hi Lance, >> >> I modified the headers of those two test cases as follows: >> >> http://cr.openjdk.java.net/~naoto/8211990/webrev.01/ >> >> Didn't bother changing others :-) >> >> Naoto >> >> On 8/12/19 3:46 PM, Lance Andersen wrote: >>> Hi Naoto >>>> On Aug 12, 2019, at 6:34 PM, naoto.sato at oracle.com wrote: >>>> >>>> Hi Lance, >>>> >>>> Yes, I would like the style, but AFAIK, all java.time tests are testng, and controlled with the java/time/{test/tck}/TEST.properties file so that each test file won't need jtreg tags (it cannot override them either). >>> Yes the @build, at run, @library would be handled via the TEST.properties and are not needed for the test because of TEST.properties. >>> The other tags are informational and do not impact the running of the test such as @test, @bug, @summary?. >>> Anyways, no big deal either way, just thought I would ask. >>> have a good evening >>> Best >>> lance >>>> Naoto >>>> >>>> On 8/12/19 3:17 PM, Lance Andersen wrote: >>>>> Hi Naoto, >>>>>> On Aug 12, 2019, at 6:01 PM, naoto.sato at oracle.com wrote: >>>>>> >>>>>> Thank you for the review, Lance. >>>>>> >>>>>> On 8/12/19 2:37 PM, Lance Andersen wrote: >>>>>>> Looks good Naoto. >>>>>>> One question I had which is not relevant to your fix, but should the tests as we modify them include the JTReg tags such as @bug, @summary?. etc? just for consistency?. >>>>>> I put @bug tags to each of the modified test, but not @summary, et.al. It seems that each test file corresponds to the java.time class, so adding @summary for this bug might not fit. I could add @summary to existing "Tests XXXX" statement, but keep it consistent with other java.time test case files. >>>>> I was thinking more similar to: >>>>> open/test/jdk/jdk/nio/zipfs/TestPosix.java or open/test/jdk/java/nio/file/Files/StreamTest.java >>>>> ?????? >>>>> /* @test >>>>> * @bug 8006884 8019526 8132539 >>>>> * @library .. >>>>> * @build PassThroughFileSystem FaultyFileSystem >>>>> * @run testng StreamTest >>>>> * @summary Unit test for java.nio.file.Files methods that return a Stream >>>>> */ >>>>> ???????? >>>>> You won?t need the @run for these tests but each test is for a specific class such as OffsetDateTime and ZonedOffSetDateTime and all of the bugs are listed at the top of the file. >>>>> I am not sure we have agreed to standardize this historically, but I tend to when I update a test if applicable. >>>>> Anyways, just a suggestion? Feel free to ignore ;-) >>>>> Have a good rest of your evening :-) >>>>>> Naoto >>>>>> >>>>>>> Best >>>>>>> Lance >>>>>>>> On Aug 12, 2019, at 4:43 PM, naoto.sato at oracle.com wrote: >>>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> Please review the fix to the following issue: >>>>>>>> >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8211990 >>>>>>>> >>>>>>>> The proposed changeset is located at: >>>>>>>> >>>>>>>> https://cr.openjdk.java.net/~naoto/8211990/webrev.00/ >>>>>>>> >>>>>>>> The DateTimeException was thrown due to unconditional conversion beyond the valid range of the internal LocalDateTime value. If it happens, normalize two instants with the offset of "start" instant. The same kind of exception is observed with ZonedDateTime.until(), which is also fixed in this changeset. >>>>>>>> >>>>>>>> Naoto >>>>>>> >>>>>>> >>>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>>>> Oracle Java Engineering >>>>>>> 1 Network Drive >>>>>>> Burlington, MA 01803 >>>>>>> Lance.Andersen at oracle.com >>>>> >>>>> >>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From Roger.Riggs at oracle.com Tue Aug 13 15:58:21 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 13 Aug 2019 11:58:21 -0400 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <9BD09475-83E7-4E8A-A125-B694668055FA@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> <9BD09475-83E7-4E8A-A125-B694668055FA@oracle.com> Message-ID: <445cb56e-12a3-315c-c30d-51f07c807bf0@oracle.com> Hi Pavel, On 8/12/19 1:41 PM, Pavel Rappo wrote: > Comments are inline. > >> On 8 Aug 2019, at 18:59, Roger Riggs wrote: ... >> That's fine, a Semaphore can be used to wait for the first connection and then check with a different timeout for unexpected connections. > I've sketched some possible implementations of the hybrid check we talked about. Even though the "Semaphore option" looks the most concise, it simultaneously looks the most "off-label" and counterintuitive (to my liking). However, I'm fine with it. The Semaphore implementation is the least complex.? Looks fine to me. Thanks for the prototypes. Roger > > -Pavel > > // -------------------------------------------------- > > import java.util.concurrent.CountDownLatch; > import java.util.concurrent.Phaser; > import java.util.concurrent.Semaphore; > import java.util.concurrent.TimeUnit; > import java.util.concurrent.TimeoutException; > import java.util.concurrent.atomic.AtomicInteger; > > public class TwoPhase { > > public static void main(String[] args) throws InterruptedException { > final Option opt = new OptionA(); > // final Option opt = new OptionB(); > // final Option opt = new OptionC(); > opt.acceptConnection(); > opt.accep >>>> 105: Tests that sleep are prone to intermittent failures on slow or delayed systems. >>>> >>> True, however, I'm not aware of any general solution of this problem. >> General is not needed, and sleeps waste time time and resources. >> In this particular test, if there is no possiblity of multiple connections then CountDownLatch is a good mechanism. > I would prefer to test for a particular number of connections. >>>> It would be more reliable to countdown *after* the Connection was handled. >>>> As is, it might report success even if handleRequest failed for some reason. >>>> >>> Hm... Let me think. What we are interested in here is whether the connection is attempted or not. We may do what you are suggesting just to be sure the server is not failing. That is, the client is served successfully. >> The test description is not specific about that. >> And it raises questions about the purpose of the environment setup. >> Is it all needed. > I will update the documentation. >> Is handling Unbind in the switch needed (as different from the default). > Chris might want to answer that. >>>> >>>> >>>> If there as some suspecion of too many connections >>>> that could be checked after the beforeConnectionHandled called countDown. >>>> >>> Wouldn't that make problems of its own? If I got you right, a time window for the LDAP client to create more *unwanted* connections could be really small. A hybrid approach might be even better. We wait for the first connection with a generous timeout and then give the client some extra time to create more connections. >>> >>> It really is fine-tuning. You can't shield completely from arbitrarily slow systems. >>> > tConnection(); > opt.checkConnections(); > } > > private interface Option { > > void acceptConnection(); > > void checkConnections() throws InterruptedException; > } > > private static class OptionA implements Option { > > private final CountDownLatch firstConnection = new CountDownLatch(1); > private final AtomicInteger connectionsCount = new AtomicInteger(); > private final CountDownLatch otherConnections = new CountDownLatch(1); > > @Override > public void acceptConnection() { > if (connectionsCount.incrementAndGet() == 1) { > firstConnection.countDown(); > } else { > otherConnections.countDown(); > } > } > > @Override > public void checkConnections() throws InterruptedException { > if (!firstConnection.await(60L, TimeUnit.SECONDS)) { > throw new RuntimeException("Failed"); > } > if (otherConnections.await(5L, TimeUnit.SECONDS)) { > throw new RuntimeException("Unexpected connections: " > + connectionsCount.get()); > } > } > } > > private static class OptionB implements Option { > > private final Semaphore s = new Semaphore(0); > > @Override > public void acceptConnection() { > s.release(1); > } > > @Override > public void checkConnections() throws InterruptedException { > if (!s.tryAcquire(60L, TimeUnit.SECONDS)) { > throw new RuntimeException("Failed"); > } > if (s.tryAcquire(5L, TimeUnit.SECONDS)) { > throw new RuntimeException("Unexpected connections: " > + (s.availablePermits() + 2)); > } > } > } > > private static class OptionC implements Option { > > private final Phaser p = new Phaser(1); > > @Override > public void acceptConnection() { > p.arrive(); > } > > @Override > public void checkConnections() throws InterruptedException { > try { > p.awaitAdvanceInterruptibly(0, 60L, TimeUnit.SECONDS); > } catch (TimeoutException e) { > throw new RuntimeException("Failed"); > } > try { > p.awaitAdvanceInterruptibly(1, 5L, TimeUnit.SECONDS); > } catch (TimeoutException e) { > return; /* expected */ > } > throw new RuntimeException("Unexpected connections: " > + p.getPhase()); > } > } > } > > // -------------------------------------------------- > > From julia.boes at oracle.com Tue Aug 13 16:12:39 2019 From: julia.boes at oracle.com (Julia Boes) Date: Tue, 13 Aug 2019 17:12:39 +0100 Subject: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods In-Reply-To: <99CC3090-7A14-496E-A861-0EDCD3939F4C@oracle.com> References: <764b3be1-f820-4289-610e-fa4887512dc0@oracle.com> <99CC3090-7A14-496E-A861-0EDCD3939F4C@oracle.com> Message-ID: <5cefeb00-d3be-8200-84ee-95a5dc0f2875@oracle.com> Hi Brian, That's right, I created a separate issue for that (separate RFR to follow). Thanks, Julia On 13/08/2019 15:43, Brian Burkhalter wrote: > Hi Julia, > > I think this looks OK but I would consider expanding the scope to add > the three methods to StrictMath as well. Either that or file a > separate issue for that purpose. > > Thanks, > > Brian > >> On Aug 13, 2019, at 3:16 AM, Julia Boes > > wrote: >> >> This is a minor fix of the javadoc in java.lang.Math. The methods >> decrementExact(), incrementExact() and negateExact()? declare they >> throw a ArithmeticException, and as such should be included in the >> list of operations that can detect overflow in the class-level javadoc. >> >> Bug:https://bugs.openjdk.java.net/browse/JDK-8229337 >> Webrev:http://cr.openjdk.java.net/~dfuchs/jboes/8229337/webrev.00/ > From brian.burkhalter at oracle.com Tue Aug 13 16:16:58 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 13 Aug 2019 09:16:58 -0700 Subject: RFR: 8229337: java.lang.Math class doc should be adjusted regarding -Exact methods In-Reply-To: <5cefeb00-d3be-8200-84ee-95a5dc0f2875@oracle.com> References: <764b3be1-f820-4289-610e-fa4887512dc0@oracle.com> <99CC3090-7A14-496E-A861-0EDCD3939F4C@oracle.com> <5cefeb00-d3be-8200-84ee-95a5dc0f2875@oracle.com> Message-ID: <10CF228F-1D23-46C7-923B-4DBB77878FE7@oracle.com> Hi Julia, Great, thanks. Brian > On Aug 13, 2019, at 9:12 AM, Julia Boes wrote: > > That's right, I created a separate issue for that (separate RFR to follow). > > Thanks, > > Julia > > On 13/08/2019 15:43, Brian Burkhalter wrote: >> Hi Julia, >> >> I think this looks OK but I would consider expanding the scope to add the three methods to StrictMath as well. Either that or file a separate issue for that purpose. From alexey.semenyuk at oracle.com Tue Aug 13 16:15:27 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Tue, 13 Aug 2019 12:15:27 -0400 Subject: RFR: JDK-8226534: combination of windows options cause exception in MsiBundler In-Reply-To: <9ce9d804-879b-924a-0ec5-78d59afeebc4@oracle.com> References: <9ce9d804-879b-924a-0ec5-78d59afeebc4@oracle.com> Message-ID: <7fbc1bf1-4b2c-fc44-c622-430f94aaa048@oracle.com> Looks good. - Alexey On 8/12/2019 8:38 PM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Fixed by adding --install-dir folders to RemoveFile table as per > Wixs requirements. > > [1] https://bugs.openjdk.java.net/browse/JDK-8226534 > > [2] http://cr.openjdk.java.net/~almatvee/8226534/webrev.00/ > > Thanks, > Alexander From peter.levart at gmail.com Tue Aug 13 16:30:20 2019 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 13 Aug 2019 18:30:20 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> Message-ID: <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> On 8/13/19 3:57 PM, Aleksey Shipilev wrote: > On 8/13/19 3:33 AM, Mandy Chung wrote: >> On 8/12/19 5:13 PM, Frederic Parain wrote: >> 96 // VM adds 1 to the code index to StackFrameInfo::bci field such that >> 97 // zero (and negative values) indicates invalid BCI. So substract 1. >> >> http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.04/ > I still do not understand the purpose of @Stable here. It seems to complicate the whole thing, and > for what, exactly? Why can't we be happy with just "final int bci"? final IMO is least correct here. Because with final, two lies are told: - the field is not final, because it is later modified from native code - the final modifier's JMM effects are not effective as the field is modified after constructor is finished (*) The field *is* written to only once and with non-default value. So it qualifies for @Stable. Unfortunately the optimization effects of @Stable do not apply here as the references to StackFrameInfo objects are usually not stable. I would be surprised to ever see code like the following: static final StackFrameInfo info = ... or class SomeClass { ??? static @Stable StackFrameInfo[] infos; ??? static { ??? ??? ... ??? ??? infos = ... ??? } ... Usually the StackFrameInfo(s) are consumed as soon as they are returned from StackWalker API and never assigned to @Stable field. So there's no purpose of @Stable for bci field use. Except documentation. But documentation can be specified in the form of comments too. Regards, Peter (*) You may argue that it is a standard practice to modify final fields after constructor is finished in the de-serialization, for example. It is, yes. But, deserialization does not even run the constructor and deserialization uses explicit memory fences that simulate those in the constructor. There's no such fences in the StackWalker code. They could be added though, if it was desirable to make StackFrameInfo objects safe to be published via data race. There's an appropriate place in code where such fence could be added: in the java.lang.StackStreamFactory.AbstractStackWalker#fetchStackFrames(int) method, just after the native fetchStackFrames method returns. This would be coarse-grained and would not hurt performance much. > > -Aleksey > From Roger.Riggs at oracle.com Tue Aug 13 17:43:28 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 13 Aug 2019 13:43:28 -0400 Subject: jdk.serial filter is not working for restricting depth of treemap in java In-Reply-To: References: Message-ID: <8e002222-f98f-63d8-3d6a-4fa4800eeb81@oracle.com> Hi Kumar, The other limits on the number of references (maxref) and size of the stream (maxbytes) cover the similar potential cases. The maxarray limit is targeted at limiting the size of arrays, different considerations apply to other data structures. Thanks, Roger On 7/29/19 11:07 PM, Kumar Gaurav wrote: > Hi All, > > I'm mailing here for the first time and I am unaware of any rules for > mailing here. If there is any mistake please let me know. Below is my > question > > JEP 290 solves the problem of > deserialization vulnerabilities except some collection classes which > includes TreeMap and LinkedList. > > Can we have any solution or any work around to counter that? > > In our RMI interface we are accepting Objects which may have TreeMap and > since there's no check on the size of treemap it is vulnerable to DDos > Attack. We have solution for ArrayList, Hashmap etc, Can we have something > similar for TreeMap and LinkedList as well? > > > Regards, > > Kumar Gaurav From mandy.chung at oracle.com Tue Aug 13 17:49:32 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 13 Aug 2019 10:49:32 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> Message-ID: <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> On 8/13/19 9:30 AM, Peter Levart wrote: > Usually the StackFrameInfo(s) are consumed as soon as they are > returned from StackWalker API and never assigned to @Stable field. So > there's no purpose of @Stable for bci field use. Except documentation. > But documentation can be specified in the form of comments too. > There are several JDK classes whose fields are filled by VM and comment is the form of documentation.? Until new use of StackFrame in the future shows performance benefit, it's okay to stick with @Stable original intent and keep the comment: +??? private int bci;??????????????????? // zero and negative values represent invalid BCI Please also review CSR: ?? https://bugs.openjdk.java.net/browse/JDK-8229487 Mandy From pavel.rappo at oracle.com Tue Aug 13 18:21:35 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 13 Aug 2019 19:21:35 +0100 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <445cb56e-12a3-315c-c30d-51f07c807bf0@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> <9BD09475-83E7-4E8A-A125-B694668055FA@oracle.com> <445cb56e-12a3-315c-c30d-51f07c807bf0@oracle.com> Message-ID: <49ADF27D-5F27-42B4-9D5E-B16278B53B5F@oracle.com> > On 13 Aug 2019, at 16:58, Roger Riggs wrote: > > > > The Semaphore implementation is the least complex. Looks fine to me. Updated: http://cr.openjdk.java.net/~prappo/8217606/webrev.01/ -Pavel From alexey.semenyuk at oracle.com Tue Aug 13 19:10:22 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Tue, 13 Aug 2019 15:10:22 -0400 Subject: RFR: JDK-8215447: Investigate if current implementation of --license-file is correct for RPM packagesI In-Reply-To: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> Message-ID: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - Install license file in the correct location in stead of the app's installation directory, update corresponding jtreg tests. [1] https://bugs.openjdk.java.net/browse/JDK-8215447 [2] http://cr.openjdk.java.net/~asemenyuk/8215447/webrev.00/ Thanks, Alexey From andy.herrick at oracle.com Tue Aug 13 19:53:34 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Tue, 13 Aug 2019 15:53:34 -0400 Subject: RFR: JDK-8215447: Investigate if current implementation of --license-file is correct for RPM packagesI In-Reply-To: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> Message-ID: <3add19bf-a21a-e8ee-d667-1c1f82dcb12a@oracle.com> looks good /Andy On 8/13/2019 3:10 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Install license file in the correct location in stead of the app's > installation directory, update corresponding jtreg tests. > > [1] https://bugs.openjdk.java.net/browse/JDK-8215447 > > [2] http://cr.openjdk.java.net/~asemenyuk/8215447/webrev.00/ > > Thanks, > Alexey > From ivan.gerasimov at oracle.com Tue Aug 13 19:55:07 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 13 Aug 2019 12:55:07 -0700 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information In-Reply-To: <2510f2a5-7f2b-75b1-c5ec-89cf90e97490@oracle.com> References: <2510f2a5-7f2b-75b1-c5ec-89cf90e97490@oracle.com> Message-ID: <5f3ea03a-9d43-0234-6df5-eaea1a96e408@oracle.com> Hello! A simple benchmark did not detect any negative impact of delegating substring(int) to substring(int, int): Before fix: Benchmark???????????????????? Mode? Cnt?? Score?? Error Units StringSubstring.from26toEnd0? avgt?? 12? 20.279 ? 0.306 ns/op StringSubstring.from26toEnd1? avgt?? 12? 20.677 ? 1.924 ns/op After fix: Benchmark???????????????????? Mode? Cnt?? Score?? Error Units StringSubstring.from26toEnd0? avgt?? 12? 19.835 ? 0.135 ns/op StringSubstring.from26toEnd1? avgt?? 12? 20.784 ? 1.791 ns/op So here's the updated webrev: http://cr.openjdk.java.net/~igerasim/8221307/01/webrev/ Will you approve it to go? With kind regards, Ivan On 8/8/19 6:56 AM, Claes Redestad wrote: > Hi, > > perhaps a stupid question, but why isn't String::substring(int) > calling substring(beginIndex, length())? That'd ensure consistent error > messages, but otherwise preserve semantics. > > /Claes > > On 2019-08-08 02:17, Ivan Gerasimov wrote: >> Hello! >> >> The exception thrown by substring(int) may look confusing. >> For example it produces "String index out of range: -1" when the >> index is length+1. >> >> It is proposed to make the error message more clear, similar to what >> we have for substring(int, int). >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ >> >> Would you please help review? >> > -- With kind regards, Ivan Gerasimov From andy.herrick at oracle.com Tue Aug 13 19:56:47 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Tue, 13 Aug 2019 15:56:47 -0400 Subject: RFR: JDK-8229138: Add --linux-app-release option for DEB and RPM packages Message-ID: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8229138?filter=-1 [2] http://cr.openjdk.java.net/~herrick/8229138/webrev.01/ Thanks, Andy From andy.herrick at oracle.com Tue Aug 13 19:59:38 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Tue, 13 Aug 2019 15:59:38 -0400 Subject: RFR: JDK-8229138: Add --linux-app-release option for DEB and RPM packages In-Reply-To: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> References: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> Message-ID: <0f56befd-b99c-e7ec-a745-e7a7d105fa9d@oracle.com> please excuse the filter on the bug's url, make that: [1] https://bugs.openjdk.java.net/browse/JDK-8229138 /Andy On 8/13/2019 3:56 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229138?filter=-1 > > [2] http://cr.openjdk.java.net/~herrick/8229138/webrev.01/ > > > Thanks, > > Andy > From Roger.Riggs at oracle.com Tue Aug 13 20:09:44 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 13 Aug 2019 16:09:44 -0400 Subject: RFR (XS) 8221307 : String.substring() OOB exception on start index reports improper information In-Reply-To: <5f3ea03a-9d43-0234-6df5-eaea1a96e408@oracle.com> References: <2510f2a5-7f2b-75b1-c5ec-89cf90e97490@oracle.com> <5f3ea03a-9d43-0234-6df5-eaea1a96e408@oracle.com> Message-ID: <02c2bc69-74e8-9a45-6563-14a9b0e777a6@oracle.com> Hi Ivan, Looks good. Thanks, Roger On 8/13/19 3:55 PM, Ivan Gerasimov wrote: > Hello! > > A simple benchmark did not detect any negative impact of delegating > substring(int) to substring(int, int): > > Before fix: > Benchmark???????????????????? Mode? Cnt?? Score?? Error Units > StringSubstring.from26toEnd0? avgt?? 12? 20.279 ? 0.306 ns/op > StringSubstring.from26toEnd1? avgt?? 12? 20.677 ? 1.924 ns/op > > After fix: > Benchmark???????????????????? Mode? Cnt?? Score?? Error Units > StringSubstring.from26toEnd0? avgt?? 12? 19.835 ? 0.135 ns/op > StringSubstring.from26toEnd1? avgt?? 12? 20.784 ? 1.791 ns/op > > > So here's the updated webrev: > http://cr.openjdk.java.net/~igerasim/8221307/01/webrev/ > > Will you approve it to go? > > With kind regards, > > Ivan > > > On 8/8/19 6:56 AM, Claes Redestad wrote: >> Hi, >> >> perhaps a stupid question, but why isn't String::substring(int) >> calling substring(beginIndex, length())? That'd ensure consistent error >> messages, but otherwise preserve semantics. >> >> /Claes >> >> On 2019-08-08 02:17, Ivan Gerasimov wrote: >>> Hello! >>> >>> The exception thrown by substring(int) may look confusing. >>> For example it produces "String index out of range: -1" when the >>> index is length+1. >>> >>> It is proposed to make the error message more clear, similar to what >>> we have for substring(int, int). >>> >>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8221307 >>> WEBREV: http://cr.openjdk.java.net/~igerasim/8221307/00/webrev/ >>> >>> Would you please help review? >>> >> From alexey.semenyuk at oracle.com Tue Aug 13 20:13:15 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Tue, 13 Aug 2019 16:13:15 -0400 Subject: RFR: JDK-8229138: Add --linux-app-release option for DEB and RPM packages In-Reply-To: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> References: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> Message-ID: <1d796246-aecd-aa9f-fa21-a265c2d87301@oracle.com> Looks good. - Alexey On 8/13/2019 3:56 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229138?filter=-1 > > [2] http://cr.openjdk.java.net/~herrick/8229138/webrev.01/ > > > Thanks, > > Andy > From Roger.Riggs at oracle.com Tue Aug 13 20:12:48 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 13 Aug 2019 16:12:48 -0400 Subject: RFR [14] 8217606: LdapContext#reconnect always opens a new connection In-Reply-To: <49ADF27D-5F27-42B4-9D5E-B16278B53B5F@oracle.com> References: <8F91C8DB-30C0-4EDF-9933-EAFB5FE34D8D@oracle.com> <6E1DB802-A402-43AE-B493-B14BC267764D@oracle.com> <9BD09475-83E7-4E8A-A125-B694668055FA@oracle.com> <445cb56e-12a3-315c-c30d-51f07c807bf0@oracle.com> <49ADF27D-5F27-42B4-9D5E-B16278B53B5F@oracle.com> Message-ID: <763c5efc-1feb-5998-2529-ff442305c86c@oracle.com> Hi Pavel, Chris, Looks good, Thanks for the improvements and cleanup as well as fixing the bug. Roger On 8/13/19 2:21 PM, Pavel Rappo wrote: >> On 13 Aug 2019, at 16:58, Roger Riggs wrote: >> >> >> >> The Semaphore implementation is the least complex. Looks fine to me. > Updated: > > http://cr.openjdk.java.net/~prappo/8217606/webrev.01/ > > -Pavel > From alexander.matveev at oracle.com Tue Aug 13 21:23:47 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Tue, 13 Aug 2019 14:23:47 -0700 Subject: RFR: JDK-8215447: Investigate if current implementation of --license-file is correct for RPM packagesI In-Reply-To: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> References: <78fa6a8a-a929-82db-042e-36571a97aa84@oracle.com> <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> Message-ID: Looks good. On 8/13/2019 12:10 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Install license file in the correct location in stead of the app's > installation directory, update corresponding jtreg tests. > > [1] https://bugs.openjdk.java.net/browse/JDK-8215447 > > [2] http://cr.openjdk.java.net/~asemenyuk/8215447/webrev.00/ > > Thanks, > Alexey > From brian.burkhalter at oracle.com Tue Aug 13 21:28:58 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 13 Aug 2019 14:28:58 -0700 Subject: 8187898: PrintStream should override FilterOutputStream#write(byte[]) with a method that has no throws clause In-Reply-To: References: <86A0C35F-93C1-4F45-8723-72B723024B39@oracle.com> <2d6a465b-8f1d-6365-42f7-446381197474@oracle.com> <71C745EA-D0C0-44FE-BBF8-0F9119078AD5@oracle.com> <714892D5-194F-4856-95F1-E38C6D7FF714@oracle.com> <91BF9F6F-5969-40AF-8E51-92D5E045F6D9@oracle.com> <532398EA-B7F8-4803-A038-A0F54DCD460F@oracle.com> <426428C0-F710-4262-9E5A-247D0D267059@oracle.com> <3B543968-6426-4FDC-AF27-D3962BA4814E@oracle.com> <8b8eea87-8b5d-8561-7058-633184ce8976@oracle.com> <533DF576-7B8B-4BC7-BB09-50609116AA56@oracle.com> <064ec92d-7e6d-b499-be9f-7578a1a5fb39@oracle.com> <4f71aae6-8250-67aa-c4ee-d206037af50e@oracle.com> Message-ID: Reprising discussion of [1] from last month. I updated the patch [2] which now hopefully accounts for the various comments. Specifically the specification of the PrintStream.write(byte[]) override was clarified as follows: A) If auto-flush is enabled data will be flushed. B) API Note: * No IOException is actually thrown but the error flag is set instead; * Refer user to writeBytes(byte[]) and write(byte[],int,int). C) Implementation Requirements: * Equivalent to this.write(buf, 0, buf.length), not super.write(buf, 0, buf.length). The implementation is updated as well per the foregoing statement. Thanks, Brian [1] https://bugs.openjdk.java.net/browse/JDK-8187898 [2] http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.04/ From alexander.matveev at oracle.com Tue Aug 13 21:41:10 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Tue, 13 Aug 2019 14:41:10 -0700 Subject: RFR: JDK-8229138: Add --linux-app-release option for DEB and RPM packages In-Reply-To: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> References: <9a737c5d-e539-8343-b869-9798c4f8be2b@oracle.com> Message-ID: <2f2e49df-9adc-07a7-6e00-bf0410b39457@oracle.com> Looks good. On 8/13/2019 12:56 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229138?filter=-1 > > [2] http://cr.openjdk.java.net/~herrick/8229138/webrev.01/ > > > Thanks, > > Andy > From coleen.phillimore at oracle.com Tue Aug 13 23:56:02 2019 From: coleen.phillimore at oracle.com (coleen.phillimore at oracle.com) Date: Tue, 13 Aug 2019 19:56:02 -0400 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> Message-ID: Hi, I saw my name in this thread and had a discussion with Mandy. I don't like that the VM and JDK having this special coordinated dance of +1/-1, and the reason for this is to differentiate the value of 0 in StackFrame meaning either uninitialized or invalid.? If through some race, an unitialized value is observed, then the MemberName may not be filled in either.? In any case zero makes sense to return as the bci because it'll point to the line number beginning of the method, if used to get the line number. The stackwalk API doesn't return invalid bci because it adjusts it: int compiledVFrame::bci() const { ? int raw = raw_bci(); ? return raw == SynchronizationEntryBCI ? 0 : raw; } At any rate, the 04 webrev looks good minus the +1/-1 dance and StackWalker.java comment.? Coupling the jdk and jvm like this feels like it's asking for bugs.? I like the simpler implementation that fixes the bug that we have. Thanks, Coleen On 8/13/19 1:49 PM, Mandy Chung wrote: > > > On 8/13/19 9:30 AM, Peter Levart wrote: >> Usually the StackFrameInfo(s) are consumed as soon as they are >> returned from StackWalker API and never assigned to @Stable field. So >> there's no purpose of @Stable for bci field use. Except >> documentation. But documentation can be specified in the form of >> comments too. >> > > There are several JDK classes whose fields are filled by VM and > comment is the form of documentation.? Until new use of StackFrame in > the future shows performance benefit, it's okay to stick with @Stable > original intent and keep the comment: > > +??? private int bci;??????????????????? // zero and negative values > represent invalid BCI > > Please also review CSR: > ?? https://bugs.openjdk.java.net/browse/JDK-8229487 > > Mandy From lance.andersen at oracle.com Wed Aug 14 14:33:49 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 14 Aug 2019 10:33:49 -0400 Subject: RFR 8184432: Remove references to jdbc@sun.com from javax.sql.rowset.spi.SyncProvider Message-ID: <0A2B5CCE-CD20-43A0-9684-842738B9D3C9@oracle.com> Hi, Please review this trivial patch which removes references to jdbc at sun.com and mention of a list of available SyncProviders which does not exist. ???? $ hg diff diff -r cffcc4c5a5ba src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java Wed Aug 07 14:04:10 2019 -0400 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java Wed Aug 14 10:28:54 2019 -0400 @@ -90,13 +90,6 @@ * com.sun.rowset.providers.RIOptimisticProvider * *

- * A vendor can register a SyncProvider implementation class name - * with Oracle Corporation by sending email to jdbc at sun.com. - * Oracle will maintain a database listing the - * available SyncProvider implementations for use with compliant - * RowSet implementations. This database will be similar to the - * one already maintained to list available JDBC drivers. - *

* Vendors should refer to the reference implementation synchronization * providers for additional guidance on how to implement a new * SyncProvider implementation. $ ????? Best Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From Roger.Riggs at oracle.com Wed Aug 14 14:39:39 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 14 Aug 2019 10:39:39 -0400 Subject: RFR 8184432: Remove references to jdbc@sun.com from javax.sql.rowset.spi.SyncProvider In-Reply-To: <0A2B5CCE-CD20-43A0-9684-842738B9D3C9@oracle.com> References: <0A2B5CCE-CD20-43A0-9684-842738B9D3C9@oracle.com> Message-ID: <57fa0a2a-0fd3-ab7c-9f69-063f958b23a3@oracle.com> +1 On 8/14/19 10:33 AM, Lance Andersen wrote: > Hi, > > Please review this trivial patch which removes references to jdbc at sun.com and mention of a list of available SyncProviders which does not exist. > > ???? > $ hg diff > diff -r cffcc4c5a5ba src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java > --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java Wed Aug 07 14:04:10 2019 -0400 > +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java Wed Aug 14 10:28:54 2019 -0400 > @@ -90,13 +90,6 @@ > * com.sun.rowset.providers.RIOptimisticProvider > * > *

> - * A vendor can register a SyncProvider implementation class name > - * with Oracle Corporation by sending email to jdbc at sun.com. > - * Oracle will maintain a database listing the > - * available SyncProvider implementations for use with compliant > - * RowSet implementations. This database will be similar to the > - * one already maintained to list available JDBC drivers. > - *

> * Vendors should refer to the reference implementation synchronization > * providers for additional guidance on how to implement a new > * SyncProvider implementation. > $ > ????? > > Best > Lance > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From julia.boes at oracle.com Wed Aug 14 16:01:37 2019 From: julia.boes at oracle.com (Julia Boes) Date: Wed, 14 Aug 2019 17:01:37 +0100 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: References: Message-ID: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> Hi, This fix adds decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath. The methods were added to java.lang.Math previously [1] and should have been added to java.lang.StrictMath for consistency. Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 Thanks, Julia [1] https://bugs.openjdk.java.net/browse/JDK-8022109 From brian.burkhalter at oracle.com Wed Aug 14 16:08:35 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 14 Aug 2019 09:08:35 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> Message-ID: <4A81C518-E2FC-4340-8011-69D2F0823679@oracle.com> Hi Julia, I think you need ?@since 14? on the new StrictMath methods. I don?t see any other problems. Thanks, Brian > On Aug 14, 2019, at 9:01 AM, Julia Boes wrote: > > This fix adds decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath. The methods were added to java.lang.Math previously [1] and should have been added to java.lang.StrictMath for consistency. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 > > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ > > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 From lance.andersen at oracle.com Wed Aug 14 16:23:14 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 14 Aug 2019 12:23:14 -0400 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <4A81C518-E2FC-4340-8011-69D2F0823679@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <4A81C518-E2FC-4340-8011-69D2F0823679@oracle.com> Message-ID: Hi Julia, Brian > On Aug 14, 2019, at 12:08 PM, Brian Burkhalter wrote: > > Hi Julia, > > I think you need ?@since 14? on the new StrictMath methods Yes, as these are new methods to this class the above would be correct vs 1.8 > . I don?t see any other problems. Looks OK to me For the CSR Compatibility Risk Assessment ????? New public static methods are added to java.lang.StrictMath, which is a class that can't be instantiated. The compatibility risk should be minimal. ?????? There are new methods, so there is no compatibility risk. You might change to something similar as: _????? There is no compatibility risk as this proposal adds new static methods to java.lang.StrictMath ??????? For the specification, you may want to consider including the specdiff as an attachment, or what I do in some cases given it is a small set of additions, just paste the javadoc in the spec section. HTH Lance > > Thanks, > > Brian > >> On Aug 14, 2019, at 9:01 AM, Julia Boes wrote: >> >> This fix adds decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath. The methods were added to java.lang.Math previously [1] and should have been added to java.lang.StrictMath for consistency. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >> >> Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >> >> CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From ivan.gerasimov at oracle.com Wed Aug 14 17:56:01 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 14 Aug 2019 10:56:01 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> Message-ID: Hi Julia! In ExactArithTests.java 1) 169???????????? long neg2 = -((long)x) ; please remove the superfluous space at the end. 2) 176???????????? long neg2 = (long) x - 1L; should be `long neg2 = -((long)x);` In StrictMath.java 3) while you're here, could you please replace semicolon with comma: ?916????? * Returns the value of the {@code long} argument; ?917????? * throwing an exception if the value overflows an {@code int}. With kind regards, Ivan On 8/14/19 9:01 AM, Julia Boes wrote: > > Hi, > > This fix adds decrementExact(), incrementExact(), and negateExact() to > java.lang.StrictMath. The methods were added to java.lang.Math > previously [1] and should have been added to java.lang.StrictMath for > consistency. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 > > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ > > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 > > Thanks, > > Julia > > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 > > -- With kind regards, Ivan Gerasimov From ivan.gerasimov at oracle.com Wed Aug 14 18:20:57 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 14 Aug 2019 11:20:57 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> Message-ID: A tiny addition: On 8/14/19 10:56 AM, Ivan Gerasimov wrote: > Hi Julia! > > In ExactArithTests.java > 1) > 169???????????? long neg2 = -((long)x) ; > please remove the superfluous space at the end. > > 2) > 176???????????? long neg2 = (long) x - 1L; > should be `long neg2 = -((long)x);` > > In StrictMath.java > 3) > > while you're here, could you please replace semicolon with comma: > ?916????? * Returns the value of the {@code long} argument; > ?917????? * throwing an exception if the value overflows an {@code int}. > > In src/java.base/share/classes/java/lang/Math.java 4) at line 1061 ???? * Returns the value of the {@code long} argument; ???? * throwing an exception if the value overflows an {@code int}. analogously to (3) above, could you please s/;/,/ ? Thanks! > > With kind regards, > Ivan > > > On 8/14/19 9:01 AM, Julia Boes wrote: >> >> Hi, >> >> This fix adds decrementExact(), incrementExact(), and negateExact() >> to java.lang.StrictMath. The methods were added to java.lang.Math >> previously [1] and should have been added to java.lang.StrictMath for >> consistency. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >> >> Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >> >> CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >> >> Thanks, >> >> Julia >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >> >> -- With kind regards, Ivan Gerasimov From alexey.semenyuk at oracle.com Wed Aug 14 18:29:05 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Wed, 14 Aug 2019 14:29:05 -0400 Subject: RFR: JDK-8229750: Fix bad merge of JDK-8215447 patch In-Reply-To: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> References: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> Message-ID: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - bad merge fix [1] https://bugs.openjdk.java.net/browse/JDK-8229750 [2] http://cr.openjdk.java.net/~asemenyuk/8229750/webrev.00/ Thanks, Alexey From andy.herrick at oracle.com Wed Aug 14 18:37:56 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Wed, 14 Aug 2019 14:37:56 -0400 Subject: RFR: JDK-8229750: Fix bad merge of JDK-8215447 patch In-Reply-To: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> References: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> Message-ID: looks good /Andy On 8/14/19 2:29 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - bad merge fix > > [1] https://bugs.openjdk.java.net/browse/JDK-8229750 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229750/webrev.00/ > > Thanks, > Alexey > From iris.clark at oracle.com Wed Aug 14 19:03:23 2019 From: iris.clark at oracle.com (Iris Clark) Date: Wed, 14 Aug 2019 12:03:23 -0700 (PDT) Subject: RFR 8184432: Remove references to jdbc@sun.com from javax.sql.rowset.spi.SyncProvider In-Reply-To: <0A2B5CCE-CD20-43A0-9684-842738B9D3C9@oracle.com> References: <0A2B5CCE-CD20-43A0-9684-842738B9D3C9@oracle.com> Message-ID: <5785adfd-32ff-40b5-9613-a07bb352f098@default> HI, Lance. Looks good. I'm curious. How did you find this? iris -----Original Message----- From: Lance Andersen Sent: Wednesday, August 14, 2019 7:34 AM To: core-libs-dev Subject: RFR 8184432: Remove references to jdbc at sun.com from javax.sql.rowset.spi.SyncProvider Hi, Please review this trivial patch which removes references to jdbc at sun.com and mention of a list of available SyncProviders which does not exist. ???? $ hg diff diff -r cffcc4c5a5ba src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java Wed Aug 07 14:04:10 2019 -0400 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvide +++ r.java Wed Aug 14 10:28:54 2019 -0400 @@ -90,13 +90,6 @@ * com.sun.rowset.providers.RIOptimisticProvider * *

- * A vendor can register a SyncProvider implementation class name - * with Oracle Corporation by sending email to jdbc at sun.com. - * Oracle will maintain a database listing the - * available SyncProvider implementations for use with compliant - * RowSet implementations. This database will be similar to the - * one already maintained to list available JDBC drivers. - *

* Vendors should refer to the reference implementation synchronization * providers for additional guidance on how to implement a new * SyncProvider implementation. $ ????? Best Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From lance.andersen at oracle.com Wed Aug 14 19:10:22 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 14 Aug 2019 15:10:22 -0400 Subject: RFR 8184432: Remove references to jdbc@sun.com from javax.sql.rowset.spi.SyncProvider In-Reply-To: <5785adfd-32ff-40b5-9613-a07bb352f098@default> References: <0A2B5CCE-CD20-43A0-9684-842738B9D3C9@oracle.com> <5785adfd-32ff-40b5-9613-a07bb352f098@default> Message-ID: <083E33B0-3CAD-4470-87A9-98C6D23FF09F@oracle.com> Hi Iris, Jon Gibbons reported the issue as part of some of his many clean-up activities to improve the javadocs Best, Lance. > On Aug 14, 2019, at 3:03 PM, Iris Clark wrote: > > HI, Lance. > > Looks good. > > I'm curious. How did you find this? > > iris > > -----Original Message----- > From: Lance Andersen > Sent: Wednesday, August 14, 2019 7:34 AM > To: core-libs-dev > Subject: RFR 8184432: Remove references to jdbc at sun.com from javax.sql.rowset.spi.SyncProvider > > Hi, > > Please review this trivial patch which removes references to jdbc at sun.com and mention of a list of available SyncProviders which does not exist. > > ???? > $ hg diff > diff -r cffcc4c5a5ba src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java > --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvider.java Wed Aug 07 14:04:10 2019 -0400 > +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProvide > +++ r.java Wed Aug 14 10:28:54 2019 -0400 > @@ -90,13 +90,6 @@ > * com.sun.rowset.providers.RIOptimisticProvider > * > *

> - * A vendor can register a SyncProvider implementation class name > - * with Oracle Corporation by sending email to jdbc at sun.com. > - * Oracle will maintain a database listing the > - * available SyncProvider implementations for use with compliant > - * RowSet implementations. This database will be similar to the > - * one already maintained to list available JDBC drivers. > - *

> * Vendors should refer to the reference implementation synchronization > * providers for additional guidance on how to implement a new > * SyncProvider implementation. > $ > ????? > > Best > Lance > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From huizhe.wang at oracle.com Wed Aug 14 19:15:23 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 14 Aug 2019 12:15:23 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> Message-ID: <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> > while you're here, could you please replace semicolon with comma: > ?916????? * Returns the value of the {@code long} argument; > ?917????? * throwing an exception if the value overflows an {@code int}. It seems to me the first sentence shall be the synopsis. The 2nd part is not necessary as that's what the "@throws" tag is for. If it has to be there, should it be "throws" instead of "throwing" (I'm not a native speaker :-) ) Cheers, Joe > > With kind regards, > Ivan > > > On 8/14/19 9:01 AM, Julia Boes wrote: >> >> Hi, >> >> This fix adds decrementExact(), incrementExact(), and negateExact() >> to java.lang.StrictMath. The methods were added to java.lang.Math >> previously [1] and should have been added to java.lang.StrictMath for >> consistency. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >> >> Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >> >> CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >> >> Thanks, >> >> Julia >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >> >> From daniel.fuchs at oracle.com Wed Aug 14 19:21:18 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 14 Aug 2019 20:21:18 +0100 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> Message-ID: <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> Hi Joe, On 14/08/2019 20:15, Joe Wang wrote: > The 2nd part is not necessary as that's what the "@throws" tag is for. Not withstanding the fact that this is a copy of the API doc from java.lang.Math, I'd argue that the second part is quite important. It's why the method is called exact, and is probably the only reason why you would call that method in the first place. So I think the 2nd part must be in the synopsis too. best regards, -- daniel On 8/14/19 9:01 AM, Julia Boes wrote: > > Hi, > > This fix adds decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath. The methods were added to java.lang.Math previously [1] and should have been added to java.lang.StrictMath for consistency. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 > > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ > > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 > > Thanks, > > Julia > > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 From mandy.chung at oracle.com Wed Aug 14 19:42:47 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 14 Aug 2019 12:42:47 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> Message-ID: <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> I have further discussion with Coleen and walkthrough the vframe implementation.? Here is what we confirm and agree. vframeStream::bci might return an invalid bci whereas javaVFrame::bci returns a valid bci (compiledVFrame::bci adjusts invalid bci to 0). An invalid bci could happen when hitting a safepoint on bci #0 on a synchronized method either before or after the monitor is locked (implicit synchronization without explicit monitorenter).?? That might occur when StackOverflowError is thrown for example.? However, that should never happen when StackWalker is called and the top frame would be in the stack walking code. +1/-1 adjustment intends to address invalid bci case but such case is not applicable for StackWalker API.? With that, I agree with Coleen that VM should set the bci value to StackFrameInfo::bci field and no adjustment needed: ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ thanks Mandy On 8/13/19 4:56 PM, coleen.phillimore at oracle.com wrote: > > Hi, I saw my name in this thread and had a discussion with Mandy. I > don't like that the VM and JDK having this special coordinated dance > of +1/-1, and the reason for this is to differentiate the value of 0 > in StackFrame meaning either uninitialized or invalid. If through some > race, an unitialized value is observed, then the MemberName may not be > filled in either.? In any case zero makes sense to return as the bci > because it'll point to the line number beginning of the method, if > used to get the line number. > > The stackwalk API doesn't return invalid bci because it adjusts it: > > int compiledVFrame::bci() const { > ? int raw = raw_bci(); > ? return raw == SynchronizationEntryBCI ? 0 : raw; > } > > At any rate, the 04 webrev looks good minus the +1/-1 dance and > StackWalker.java comment.? Coupling the jdk and jvm like this feels > like it's asking for bugs.? I like the simpler implementation that > fixes the bug that we have. > > Thanks, > Coleen > > > On 8/13/19 1:49 PM, Mandy Chung wrote: >> >> >> On 8/13/19 9:30 AM, Peter Levart wrote: >>> Usually the StackFrameInfo(s) are consumed as soon as they are >>> returned from StackWalker API and never assigned to @Stable field. >>> So there's no purpose of @Stable for bci field use. Except >>> documentation. But documentation can be specified in the form of >>> comments too. >>> >> >> There are several JDK classes whose fields are filled by VM and >> comment is the form of documentation.? Until new use of StackFrame in >> the future shows performance benefit, it's okay to stick with @Stable >> original intent and keep the comment: >> >> +??? private int bci;??????????????????? // zero and negative values >> represent invalid BCI >> >> Please also review CSR: >> ?? https://bugs.openjdk.java.net/browse/JDK-8229487 >> >> Mandy > From Roger.Riggs at oracle.com Wed Aug 14 19:43:41 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 14 Aug 2019 15:43:41 -0400 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> Message-ID: Hi, In the CSR, please include *only* the specification of the API. Do not include the implementation or tests. The specification text has to stand on it own merits. Copy/paste patches are ok but the particular diff context information is unnecessary noise. Thanks, Roger On 8/14/19 3:21 PM, Daniel Fuchs wrote: > Hi Joe, > > On 14/08/2019 20:15, Joe Wang wrote: >> The 2nd part is not necessary as that's what the "@throws" tag is for. > > Not withstanding the fact that this is a copy of the API doc from > java.lang.Math, I'd argue that the second part is quite important. > It's why the method is called exact, and is probably the only > reason why you would call that method in the first place. > So I think the 2nd part must be in the synopsis too. > > best regards, > > -- daniel > > On 8/14/19 9:01 AM, Julia Boes wrote: > > > > Hi, > > > > This fix adds decrementExact(), incrementExact(), and negateExact() > to java.lang.StrictMath. The methods were added to java.lang.Math > previously [1] and should have been added to java.lang.StrictMath for > consistency. > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 > > > > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ > > > > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 > > > > Thanks, > > > > Julia > > > > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 From huizhe.wang at oracle.com Wed Aug 14 19:45:18 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 14 Aug 2019 12:45:18 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> Message-ID: Hi Daniel, That makes sense. So it meant to say "converts the long to int only if it's within the range of an integer" (to be "exact"). It may then add "throws an exception if not". But the original is fine, just my 2 cents. Best, Joe On 8/14/19 12:21 PM, Daniel Fuchs wrote: > Hi Joe, > > On 14/08/2019 20:15, Joe Wang wrote: >> The 2nd part is not necessary as that's what the "@throws" tag is for. > > Not withstanding the fact that this is a copy of the API doc from > java.lang.Math, I'd argue that the second part is quite important. > It's why the method is called exact, and is probably the only > reason why you would call that method in the first place. > So I think the 2nd part must be in the synopsis too. > > best regards, > > -- daniel > > On 8/14/19 9:01 AM, Julia Boes wrote: > > > > Hi, > > > > This fix adds decrementExact(), incrementExact(), and negateExact() > to java.lang.StrictMath. The methods were added to java.lang.Math > previously [1] and should have been added to java.lang.StrictMath for > consistency. > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 > > > > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ > > > > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 > > > > Thanks, > > > > Julia > > > > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 From coleen.phillimore at oracle.com Wed Aug 14 20:52:54 2019 From: coleen.phillimore at oracle.com (coleen.phillimore at oracle.com) Date: Wed, 14 Aug 2019 16:52:54 -0400 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> Message-ID: On 8/14/19 3:42 PM, Mandy Chung wrote: > I have further discussion with Coleen and walkthrough the vframe > implementation.? Here is what we confirm and agree. > > vframeStream::bci might return an invalid bci whereas javaVFrame::bci > returns a valid bci (compiledVFrame::bci adjusts invalid bci to 0). > > An invalid bci could happen when hitting a safepoint on bci #0 on a > synchronized method either before or after the monitor is locked > (implicit synchronization without explicit monitorenter).?? That might > occur when StackOverflowError is thrown for example. However, that > should never happen when StackWalker is called and the top frame would > be in the stack walking code. > > +1/-1 adjustment intends to address invalid bci case but such case is > not applicable for StackWalker API.? With that, I agree with Coleen > that VM should set the bci value to StackFrameInfo::bci field and no > adjustment needed: > ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ This looks good and straighforward. Thank you! Coleen > > thanks > Mandy > > On 8/13/19 4:56 PM, coleen.phillimore at oracle.com wrote: >> >> Hi, I saw my name in this thread and had a discussion with Mandy. I >> don't like that the VM and JDK having this special coordinated dance >> of +1/-1, and the reason for this is to differentiate the value of 0 >> in StackFrame meaning either uninitialized or invalid. If through >> some race, an unitialized value is observed, then the MemberName may >> not be filled in either.? In any case zero makes sense to return as >> the bci because it'll point to the line number beginning of the >> method, if used to get the line number. >> >> The stackwalk API doesn't return invalid bci because it adjusts it: >> >> int compiledVFrame::bci() const { >> ? int raw = raw_bci(); >> ? return raw == SynchronizationEntryBCI ? 0 : raw; >> } >> >> At any rate, the 04 webrev looks good minus the +1/-1 dance and >> StackWalker.java comment.? Coupling the jdk and jvm like this feels >> like it's asking for bugs.? I like the simpler implementation that >> fixes the bug that we have. >> >> Thanks, >> Coleen >> >> >> On 8/13/19 1:49 PM, Mandy Chung wrote: >>> >>> >>> On 8/13/19 9:30 AM, Peter Levart wrote: >>>> Usually the StackFrameInfo(s) are consumed as soon as they are >>>> returned from StackWalker API and never assigned to @Stable field. >>>> So there's no purpose of @Stable for bci field use. Except >>>> documentation. But documentation can be specified in the form of >>>> comments too. >>>> >>> >>> There are several JDK classes whose fields are filled by VM and >>> comment is the form of documentation.? Until new use of StackFrame >>> in the future shows performance benefit, it's okay to stick with >>> @Stable original intent and keep the comment: >>> >>> +??? private int bci;??????????????????? // zero and negative values >>> represent invalid BCI >>> >>> Please also review CSR: >>> ?? https://bugs.openjdk.java.net/browse/JDK-8229487 >>> >>> Mandy >> > From frederic.parain at oracle.com Wed Aug 14 20:55:55 2019 From: frederic.parain at oracle.com (Frederic Parain) Date: Wed, 14 Aug 2019 16:55:55 -0400 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> Message-ID: <3150F5E3-BF88-4F11-974C-9A23A8688121@oracle.com> Much cleaner! Thumbs up! Fred > On Aug 14, 2019, at 15:42, Mandy Chung wrote: > > I have further discussion with Coleen and walkthrough the vframe implementation. Here is what we confirm and agree. > > vframeStream::bci might return an invalid bci whereas javaVFrame::bci returns a valid bci (compiledVFrame::bci adjusts invalid bci to 0). > > An invalid bci could happen when hitting a safepoint on bci #0 on a synchronized method either before or after the monitor is locked (implicit synchronization without explicit monitorenter). That might occur when StackOverflowError is thrown for example. However, that should never happen when StackWalker is called and the top frame would be in the stack walking code. > > +1/-1 adjustment intends to address invalid bci case but such case is not applicable for StackWalker API. With that, I agree with Coleen that VM should set the bci value to StackFrameInfo::bci field and no adjustment needed: > http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ > > thanks > Mandy > > On 8/13/19 4:56 PM, coleen.phillimore at oracle.com wrote: >> >> Hi, I saw my name in this thread and had a discussion with Mandy. I don't like that the VM and JDK having this special coordinated dance of +1/-1, and the reason for this is to differentiate the value of 0 in StackFrame meaning either uninitialized or invalid. If through some race, an unitialized value is observed, then the MemberName may not be filled in either. In any case zero makes sense to return as the bci because it'll point to the line number beginning of the method, if used to get the line number. >> >> The stackwalk API doesn't return invalid bci because it adjusts it: >> >> int compiledVFrame::bci() const { >> int raw = raw_bci(); >> return raw == SynchronizationEntryBCI ? 0 : raw; >> } >> >> At any rate, the 04 webrev looks good minus the +1/-1 dance and StackWalker.java comment. Coupling the jdk and jvm like this feels like it's asking for bugs. I like the simpler implementation that fixes the bug that we have. >> >> Thanks, >> Coleen >> >> >> On 8/13/19 1:49 PM, Mandy Chung wrote: >>> >>> >>> On 8/13/19 9:30 AM, Peter Levart wrote: >>>> Usually the StackFrameInfo(s) are consumed as soon as they are returned from StackWalker API and never assigned to @Stable field. So there's no purpose of @Stable for bci field use. Except documentation. But documentation can be specified in the form of comments too. >>>> >>> >>> There are several JDK classes whose fields are filled by VM and comment is the form of documentation. Until new use of StackFrame in the future shows performance benefit, it's okay to stick with @Stable original intent and keep the comment: >>> >>> + private int bci; // zero and negative values represent invalid BCI >>> >>> Please also review CSR: >>> https://bugs.openjdk.java.net/browse/JDK-8229487 >>> >>> Mandy >> > From alexander.matveev at oracle.com Wed Aug 14 21:11:09 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Wed, 14 Aug 2019 14:11:09 -0700 Subject: RFR: JDK-8229750: Fix bad merge of JDK-8215447 patch In-Reply-To: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> References: <503ea64b-64b7-e7e1-de8f-5c34d9a494e2@oracle.com> <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> Message-ID: Looks good. On 8/14/2019 11:29 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - bad merge fix > > [1] https://bugs.openjdk.java.net/browse/JDK-8229750 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229750/webrev.00/ > > Thanks, > Alexey > From claes.redestad at oracle.com Thu Aug 15 10:03:45 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 15 Aug 2019 12:03:45 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily Message-ID: Hi, by resolving permissions for code source URLs lazily, we can reduce early class loading during bootstrap, which improves footprint, startup and reduces the typical bootstrap dependency graph. Bug: https://bugs.openjdk.java.net/browse/JDK-8229773 Webrev: http://cr.openjdk.java.net/~redestad/8229773/webrev.00/ A note on the System.java changes: The laziness makes it so that FilePermission isn't initialized eagerly, which has an implicit bootstrap dependency on that the default file system provider has been initialized before a SecurityManager has been installed (since initializing FilePermission will otherwise do recursive calls into FilePermission). We already force load of the image reader on SecurityManager due similar bootstrap issues, which transitively loads the DefaultFileSystemProvider.instance(), but explicitly adding the dependency on the file system provider to System::setSecurityManager seems prudent: it's effectively a no-op on jdk/jdk right now, but documents the dependency and safeguards against future implementation changes to image reader subsystem. A note on the HelloClasslist changes: The patch drops a number of classes from being loaded on typical bootstrap and small apps, including the HelloClasslist tool. Since the HelloClasslist establishes what's to be included in the default CDS archive this can lead to a small regression on apps which actually do use the (nio) file system provider, so explicitly adding it in avoids tiny regression on those while not diminishing the speed-up to other apps. Testing: tier1-3 Thanks! /Claes From Alan.Bateman at oracle.com Thu Aug 15 10:56:30 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 15 Aug 2019 11:56:30 +0100 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: On 15/08/2019 11:03, Claes Redestad wrote: > Hi, > > by resolving permissions for code source URLs lazily, we can reduce > early class loading during bootstrap, which improves footprint, startup > and reduces the typical bootstrap dependency graph. > > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229773 > Webrev: http://cr.openjdk.java.net/~redestad/8229773/webrev.00/ > > : I think the approach is okay as URL::openConnection doesn't actually open the connection to the resource and the creation of the URLStreamdHandler shouldn't depend on permissions granted to the caller. If a handler needs permissions when creating the URLConnection then it should do so in a privileged block. I think it would be a bit cleaner if the supporting class would lazily add the permissions for a CodeSource to the collection. That is, create it with a permissions collection and code source rather than a URL to match SecureClassLoader::getPermissions. You could potentially use it in URLClassLoader getPermission(CodeSource) method too. In System.setSecurityManager then you might need DefaultFileSystemProvider.theFileSystem() to ensure that the default file system is fully initialized before setting the SM. A minor nit this adds a spurious import BuiltinClassLoader. Also it can import the sun.security.uti class to be consistent with the existing code. -Alan From claes.redestad at oracle.com Thu Aug 15 12:44:37 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 15 Aug 2019 14:44:37 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: Hi, On 2019-08-15 12:56, Alan Bateman wrote: > On 15/08/2019 11:03, Claes Redestad wrote: >> Hi, >> >> by resolving permissions for code source URLs lazily, we can reduce >> early class loading during bootstrap, which improves footprint, startup >> and reduces the typical bootstrap dependency graph. >> >> Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229773 >> Webrev: ... >> >> : > I think the approach is okay as URL::openConnection doesn't actually > open the connection to the resource and the creation of the > URLStreamdHandler shouldn't depend on permissions granted to the caller. > If a handler needs permissions when creating the URLConnection then it > should do so in a privileged block. thanks! I checked most of the handlers and the openConnection implementations and couldn't find any path that isn't either free of permission checks or doing permission sensitive steps in a privileged block already. Many handlers are already potentially created lazily after a SM has already been installed, so I don't think we need additional tests for this. > I think it would be a bit cleaner if > the supporting class would lazily add the permissions for a CodeSource > to the collection. That is, create it with a permissions collection and > code source rather than a URL to match > SecureClassLoader::getPermissions. You could potentially use it in > URLClassLoader getPermission(CodeSource) method too. That'd be cool. The logic in URLClassLoader is mostly a super-set of the logic I'm hoisting from BuiltinClassLoader here, but the logic in URLClassLoader also has a security check acting on the ACC of the classloader which would be hard to move to the supporting class, and it seems that check need to happen eagerly. I'll readjust the API to wrap the CodeSource rather than the URL, but I think we should leave URLClassLoader alone for now. > > In System.setSecurityManager then you might need > DefaultFileSystemProvider.theFileSystem() to ensure that the default > file system is fully initialized before setting the SM. Right, doesn't make much of a difference since all providers currently set up their singleton file system on creation, but using theFileSystem better captures intent. > > A minor nit this adds a spurious import BuiltinClassLoader. Also it can > import the sun.security.uti class to be consistent with the existing code. Cleaned up imports, too: http://cr.openjdk.java.net/~redestad/8229773/webrev.01/ /Claes From sean.mullan at oracle.com Thu Aug 15 13:07:32 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 15 Aug 2019 09:07:32 -0400 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: Hi Claes, I already reviewed an earlier version of this and this is pretty similar. I did have a question about whether the default serialization was ok - did you look into that more? --Sean On 8/15/19 6:03 AM, Claes Redestad wrote: > Hi, > > by resolving permissions for code source URLs lazily, we can reduce > early class loading during bootstrap, which improves footprint, startup > and reduces the typical bootstrap dependency graph. > > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229773 > Webrev: http://cr.openjdk.java.net/~redestad/8229773/webrev.00/ > > A note on the System.java changes: > > The laziness makes it so that FilePermission isn't initialized > eagerly, which has an implicit bootstrap dependency on that the default > file system provider has been initialized before a SecurityManager has > been installed (since initializing FilePermission will otherwise do > recursive calls into FilePermission). We already force load of the image > reader on SecurityManager due similar bootstrap issues, which > transitively loads the DefaultFileSystemProvider.instance(), but > explicitly adding the dependency on the file system provider to > System::setSecurityManager seems prudent: it's effectively a no-op on > jdk/jdk right now, but documents the dependency and safeguards against > future implementation changes to image reader subsystem. > > A note on the HelloClasslist changes: > > The patch drops a number of classes from being loaded on typical > bootstrap and small apps, including the HelloClasslist tool. Since the > HelloClasslist establishes what's to be included in the default CDS > archive this can lead to a small regression on apps which actually do > use the (nio) file system provider, so explicitly adding it in avoids > tiny regression on those while not diminishing the speed-up to other > apps. > > Testing: tier1-3 > > Thanks! > > /Claes From claes.redestad at oracle.com Thu Aug 15 14:30:19 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 15 Aug 2019 16:30:19 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> Hi Sean, On 2019-08-15 15:07, Sean Mullan wrote: > Hi Claes, > > I already reviewed an earlier version of this and this is pretty > similar. I did have a question about whether the default serialization > was ok - did you look into that more? ah, yes.. all the constituents are serializable (whether we wrap the CodeSource or its URL) so the new Lazy..Collection should be too. I was entertaining the idea that we could writeReplace the lazy collection with a PermissionCollection to avoid polluting serialization use cases with new type, but couldn't think of any real upside to that. /Clae From daniel.fuchs at oracle.com Thu Aug 15 15:10:49 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 15 Aug 2019 16:10:49 +0100 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: <4862da5f-6c53-98ad-df9a-9236ba8e2e24@oracle.com> Hi Claes, I wonder if initialize() should check the state of the readOnly() flag - and if that's true, call perms.setReadOnly() ? see SecureClassLoader::getProtectionDomain(..) best regards, -- daniel On 15/08/2019 13:44, Claes Redestad wrote: > Hi, > > On 2019-08-15 12:56, Alan Bateman wrote: >> On 15/08/2019 11:03, Claes Redestad wrote: >>> Hi, >>> >>> by resolving permissions for code source URLs lazily, we can reduce >>> early class loading during bootstrap, which improves footprint, startup >>> and reduces the typical bootstrap dependency graph. >>> >>> Bug:??? https://bugs.openjdk.java.net/browse/JDK-8229773 >>> Webrev: ... >>> >>> : >> I think the approach is okay as URL::openConnection doesn't actually >> open the connection to the resource and the creation of the >> URLStreamdHandler shouldn't depend on permissions granted to the >> caller. If a handler needs permissions when creating the URLConnection >> then it should do so in a privileged block. > > thanks! > > I checked most of the handlers and the openConnection implementations > and couldn't find any path that isn't either free of permission checks > or doing permission sensitive steps in a privileged block already. Many > handlers are already potentially created lazily after a SM has already > been installed, so I don't think we need additional tests for this. > >> I think it would be a bit cleaner if the supporting class would lazily >> add the permissions for a CodeSource to the collection. That is, >> create it with a permissions collection and code source rather than a >> URL to match SecureClassLoader::getPermissions. You could potentially >> use it in URLClassLoader getPermission(CodeSource) method too. > > That'd be cool. The logic in URLClassLoader is mostly a super-set of the > logic I'm hoisting from BuiltinClassLoader here, but the logic in > URLClassLoader also has a security check acting on the ACC of the > classloader which would be hard to move to the supporting class, and it > seems that check need to happen eagerly. > > I'll readjust the API to wrap the CodeSource rather than the URL, but I > think we should leave URLClassLoader alone for now. > >> >> In System.setSecurityManager then you might need >> DefaultFileSystemProvider.theFileSystem() to ensure that the default >> file system is fully initialized before setting the SM. > > Right, doesn't make much of a difference since all providers currently > set up their singleton file system on creation, but using theFileSystem > better captures intent. > >> >> A minor nit this adds a spurious import BuiltinClassLoader. Also it >> can import the sun.security.uti class to be consistent with the >> existing code. > > Cleaned up imports, too: > > http://cr.openjdk.java.net/~redestad/8229773/webrev.01/ > > /Claes From claes.redestad at oracle.com Thu Aug 15 15:15:19 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 15 Aug 2019 17:15:19 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <4862da5f-6c53-98ad-df9a-9236ba8e2e24@oracle.com> References: <4862da5f-6c53-98ad-df9a-9236ba8e2e24@oracle.com> Message-ID: <18336d6e-2c0f-809a-aa55-ca0d12b77047@oracle.com> Hi Daniel, seems prudent, especially if we are to writeReplace the underlying collection on serialization. /Claes On 2019-08-15 17:10, Daniel Fuchs wrote: > Hi Claes, > > I wonder if initialize() should check the state of > the readOnly() flag - and if that's true, call > perms.setReadOnly() ? > > see SecureClassLoader::getProtectionDomain(..) > > best regards, > > -- daniel From claes.redestad at oracle.com Thu Aug 15 15:22:14 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 15 Aug 2019 17:22:14 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> Message-ID: (adding back core-libs-dev) Hi Roger, seems easy enough to add a writeReplace: http://cr.openjdk.java.net/~redestad/8229773/webrev.02 /Claes On 2019-08-15 16:54, Roger Riggs wrote: > Hi Claes, > > I would recommend using writeReplace to serialize the > PermissionCollection so the serialized form does not change. > Though these are unlikely to be serialized, it will be less likely to > trigger some interoperability issue between different version. It may > need to be documented that serializing/deserializing does not retain the > lazyness. > > Roger > > > On 8/15/19 10:30 AM, Claes Redestad wrote: >> Hi Sean, >> >> On 2019-08-15 15:07, Sean Mullan wrote: >>> Hi Claes, >>> >>> I already reviewed an earlier version of this and this is pretty >>> similar. I did have a question about whether the default >>> serialization was ok - did you look into that more? >> >> ah, yes.. all the constituents are serializable (whether we wrap the >> CodeSource or its URL) so the new Lazy..Collection should be too. I was >> entertaining the idea that we could writeReplace the lazy collection >> with a PermissionCollection to avoid polluting serialization use cases >> with new type, but couldn't think of any real upside to that. >> >> /Clae > From Roger.Riggs at oracle.com Thu Aug 15 15:27:29 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Thu, 15 Aug 2019 11:27:29 -0400 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> Message-ID: <54d1f24b-a860-5dc7-6743-5b53b4a54cf5@oracle.com> Looks good, Thanks, Roger On 8/15/19 11:22 AM, Claes Redestad wrote: > (adding back core-libs-dev) > > Hi Roger, > > seems easy enough to add a writeReplace: > > http://cr.openjdk.java.net/~redestad/8229773/webrev.02 > > /Claes > > On 2019-08-15 16:54, Roger Riggs wrote: >> Hi Claes, >> >> I would recommend using writeReplace to serialize the >> PermissionCollection so the serialized form does not change. >> Though these are unlikely to be serialized, it will be less likely to >> trigger some interoperability issue between different version. It may >> need to be documented that serializing/deserializing does not retain >> the lazyness. >> >> Roger >> >> >> On 8/15/19 10:30 AM, Claes Redestad wrote: >>> Hi Sean, >>> >>> On 2019-08-15 15:07, Sean Mullan wrote: >>>> Hi Claes, >>>> >>>> I already reviewed an earlier version of this and this is pretty >>>> similar. I did have a question about whether the default >>>> serialization was ok - did you look into that more? >>> >>> ah, yes.. all the constituents are serializable (whether we wrap the >>> CodeSource or its URL) so the new Lazy..Collection should be too. I was >>> entertaining the idea that we could writeReplace the lazy collection >>> with a PermissionCollection to avoid polluting serialization use cases >>> with new type, but couldn't think of any real upside to that. >>> >>> /Clae >> From daniel.fuchs at oracle.com Thu Aug 15 15:44:28 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 15 Aug 2019 16:44:28 +0100 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <54d1f24b-a860-5dc7-6743-5b53b4a54cf5@oracle.com> References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> <54d1f24b-a860-5dc7-6743-5b53b4a54cf5@oracle.com> Message-ID: <63f52c62-2779-b3d1-bfd3-5b414ecf526b@oracle.com> Thanks Claes, Looks good to me too. best regards, -- daniel On 15/08/2019 16:27, Roger Riggs wrote: > Looks good, > > Thanks, Roger > > > On 8/15/19 11:22 AM, Claes Redestad wrote: >> (adding back core-libs-dev) >> >> Hi Roger, >> >> seems easy enough to add a writeReplace: >> >> http://cr.openjdk.java.net/~redestad/8229773/webrev.02 >> >> /Claes >> From mandrikov at gmail.com Thu Aug 15 16:46:13 2019 From: mandrikov at gmail.com (Evgeny Mandrikov) Date: Thu, 15 Aug 2019 18:46:13 +0200 Subject: RFR: JDK-8152467: remove uses of anachronistic array declarations for method return type Message-ID: Hello! Please review patch [1] for JDK-8152467 [2]. Also it needs a sponsor since I have only author status in OpenJDK Census [3]. After this change tier1 tests pass and I don't see other occurrences to replace in output of ag "\)\s*\[\s*\]" src With best regards, Evgeny Mandrikov [1] http://cr.openjdk.java.net/~godin/8152467/webrev.00/ [2] https://bugs.openjdk.java.net/browse/JDK-8152467 [3] https://openjdk.java.net/census#godin From andy.herrick at oracle.com Thu Aug 15 18:53:28 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Thu, 15 Aug 2019 14:53:28 -0400 Subject: RFR: JDK-8224594: Simplify jpackage Logging Message-ID: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8224594 [2] http://cr.openjdk.java.net/~herrick/8224594/ Thanks, Andy From shade at redhat.com Thu Aug 15 18:59:35 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Thu, 15 Aug 2019 20:59:35 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> Message-ID: <2f9f4c91-eb8a-f072-8cf8-fe72b748cf9c@redhat.com> On 8/14/19 9:42 PM, Mandy Chung wrote: > ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ Looks good. So, to reiterate, we do not need to initialize bci to -1 for StackFrameInfo, because it is not exposed anywhere? -- Thanks, -Aleksey From shade at redhat.com Thu Aug 15 19:01:08 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Thu, 15 Aug 2019 21:01:08 +0200 Subject: RFR: JDK-8152467: remove uses of anachronistic array declarations for method return type In-Reply-To: References: Message-ID: On 8/15/19 6:46 PM, Evgeny Mandrikov wrote: > [1] http://cr.openjdk.java.net/~godin/8152467/webrev.00/ This looks good. -- Thanks, -Aleksey From alexey.semenyuk at oracle.com Thu Aug 15 19:09:09 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 15 Aug 2019 15:09:09 -0400 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> Message-ID: <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> Andy, What is the reason to remove log statements in http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html ? - Alexey On 8/15/2019 2:53 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8224594 > > [2] http://cr.openjdk.java.net/~herrick/8224594/ > > > Thanks, > > Andy > From mandy.chung at oracle.com Thu Aug 15 19:11:40 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 15 Aug 2019 12:11:40 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <2f9f4c91-eb8a-f072-8cf8-fe72b748cf9c@redhat.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> <2f9f4c91-eb8a-f072-8cf8-fe72b748cf9c@redhat.com> Message-ID: <8b52fc97-6d0d-04b4-f9f9-1c603e83696e@oracle.com> On 8/15/19 11:59 AM, Aleksey Shipilev wrote: > On 8/14/19 9:42 PM, Mandy Chung wrote: >> ?? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ > Looks good. > > So, to reiterate, we do not need to initialize bci to -1 for StackFrameInfo, because it is not exposed anywhere? > No, it is only exposed via public API after the StackFrameInfo is filled by the VM. If the uninitialized value is observed, the MemberName may not be uninitialized either.?? Both bci and MemberName fields should be handled if the race becomes an issue. Mandy From Alan.Bateman at oracle.com Thu Aug 15 19:21:48 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 15 Aug 2019 20:21:48 +0100 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> Message-ID: <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> On 15/08/2019 16:22, Claes Redestad wrote: > (adding back core-libs-dev) > > Hi Roger, > > seems easy enough to add a writeReplace: > > http://cr.openjdk.java.net/~redestad/8229773/webrev.02 This mostly looks good. In LazyCodeSourcePermissionCollection it think "initialize" should be renamed to "ensureAdded" as that more accurately describes what it does. Also the class description could do with a bit of word smiting to make it clear that permissions for a CodeSource are lazily added to the underlying permission collection. -Alan From andy.herrick at oracle.com Thu Aug 15 19:40:01 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Thu, 15 Aug 2019 15:40:01 -0400 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> Message-ID: The first of these doesn't convey any additional information, since it is just parroting back the given option value. The second may be of use, and I could restore it as a Log.verbose(), but I felt the output here was incomplete, and would be better served by tracing in the caller, since this is the value returned, and the caller (either MacAppBundler, MacPkgBundler, or MacAppBundler) could say what the key was being used for, and if the certificate derived from this key was valid. In general is a fine line to decide what to include in verbose output. We used to have both debug and verbose output, but other than printing out exceptions, theses two and one other were the only places actually calling Log.debug() /Andy On 8/15/2019 3:09 PM, Alexey Semenyuk wrote: > Andy, > > What is the reason to remove log statements in > http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html > > http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html > > > ? > > - Alexey > > On 8/15/2019 2:53 PM, Andy Herrick wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8224594 >> >> [2] http://cr.openjdk.java.net/~herrick/8224594/ >> >> >> Thanks, >> >> Andy >> > From alexander.matveev at oracle.com Thu Aug 15 19:42:24 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 15 Aug 2019 12:42:24 -0700 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> Message-ID: <737b2cc1-07b6-55b0-df83-ea83e3aa8456@oracle.com> Looks good and probably lets restore removed log statements. On 8/15/2019 12:09 PM, Alexey Semenyuk wrote: > Andy, > > What is the reason to remove log statements in > http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html > > http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html > > > ? > > - Alexey > > On 8/15/2019 2:53 PM, Andy Herrick wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8224594 >> >> [2] http://cr.openjdk.java.net/~herrick/8224594/ >> >> >> Thanks, >> >> Andy >> > From shade at redhat.com Thu Aug 15 19:43:43 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Thu, 15 Aug 2019 21:43:43 +0200 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: <8b52fc97-6d0d-04b4-f9f9-1c603e83696e@oracle.com> References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> <2f9f4c91-eb8a-f072-8cf8-fe72b748cf9c@redhat.com> <8b52fc97-6d0d-04b4-f9f9-1c603e83696e@oracle.com> Message-ID: On 8/15/19 9:11 PM, Mandy Chung wrote: > On 8/15/19 11:59 AM, Aleksey Shipilev wrote: >> On 8/14/19 9:42 PM, Mandy Chung wrote: >>> ??? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ >> Looks good. >> >> So, to reiterate, we do not need to initialize bci to -1 for StackFrameInfo, because it is not >> exposed anywhere? >> > No, it is only exposed via public API after the StackFrameInfo is filled by the VM. > > If the uninitialized value is observed, the MemberName may not be uninitialized either.?? Both bci > and MemberName fields should be handled if the race becomes an issue. Okay then. I checked the object footprints before/after the patch, and they are the same. After-patch version has a single byte to spare for something else, if we ever needed it. (The first gap is VM-injected "version" field). == x86_64, -XX:+UseCompressedOops java.lang.StackFrameInfo object internals: OFFSET SIZE TYPE DESCRIPTION VALUE 0 12 (object header) N/A 12 4 int StackFrameInfo.bci N/A 16 2 (alignment/padding gap) 18 1 boolean StackFrameInfo.retainClassRef N/A 19 1 (alignment/padding gap) 20 4 java.lang.Object StackFrameInfo.memberName N/A 24 4 java.lang.StackTraceElement StackFrameInfo.ste N/A 28 4 (loss due to the next object alignment) Instance size: 32 bytes == x86_64, -XX:-UseCompressedOops java.lang.StackFrameInfo object internals: OFFSET SIZE TYPE DESCRIPTION VALUE 0 16 (object header) N/A 16 4 int StackFrameInfo.bci N/A 20 2 (alignment/padding gap) 22 1 boolean StackFrameInfo.retainClassRef N/A 23 1 (alignment/padding gap) 24 8 java.lang.Object StackFrameInfo.memberName N/A 32 8 java.lang.StackTraceElement StackFrameInfo.ste N/A Instance size: 40 bytes Space losses: 3 bytes internal + 0 bytes external = 3 bytes total == x86_32: java.lang.StackFrameInfo object internals: OFFSET SIZE TYPE DESCRIPTION VALUE 0 8 (object header) N/A 8 4 int StackFrameInfo.bci N/A 12 2 (alignment/padding gap) 14 1 boolean StackFrameInfo.retainClassRef N/A 15 1 (alignment/padding gap) 16 4 java.lang.Object StackFrameInfo.memberName N/A 20 4 java.lang.StackTraceElement StackFrameInfo.ste N/A Instance size: 24 bytes Space losses: 3 bytes internal + 0 bytes external = 3 bytes total -- Thanks, -Aleksey From mandy.chung at oracle.com Thu Aug 15 19:52:03 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 15 Aug 2019 12:52:03 -0700 Subject: RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767 In-Reply-To: References: <963b6933-1b30-4ef7-625e-5551d2eb4377@oracle.com> <15efe8dc-7699-6483-a8fd-b2651d3e30f4@redhat.com> <8d5b83a4-24d3-ecdd-63a3-085c2aaf66bd@redhat.com> <2be58d84-2617-fd15-7699-1ae23c4ee4a9@oracle.com> <4e206193-4b54-d161-0886-6de71825dbb3@redhat.com> <8df48a2b-c433-cf09-e4aa-9272bfc3b352@gmail.com> <607f86b0-35af-2c86-4755-94362a58370c@oracle.com> <56f4b71b-72a5-b142-4b8f-0d368dd9150a@oracle.com> <2f9f4c91-eb8a-f072-8cf8-fe72b748cf9c@redhat.com> <8b52fc97-6d0d-04b4-f9f9-1c603e83696e@oracle.com> Message-ID: <243ac71a-61fe-2abd-955b-e517dd0a7711@oracle.com> On 8/15/19 12:43 PM, Aleksey Shipilev wrote: > On 8/15/19 9:11 PM, Mandy Chung wrote: >> On 8/15/19 11:59 AM, Aleksey Shipilev wrote: >>> On 8/14/19 9:42 PM, Mandy Chung wrote: >>>> ??? http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.05/ >>> Looks good. >>> >>> So, to reiterate, we do not need to initialize bci to -1 for StackFrameInfo, because it is not >>> exposed anywhere? >>> >> No, it is only exposed via public API after the StackFrameInfo is filled by the VM. >> >> If the uninitialized value is observed, the MemberName may not be uninitialized either.?? Both bci and MemberName fields should be handled if the race becomes an issue. > Okay then. > > I checked the object footprints before/after the patch, and they are the same. After-patch version has a single byte to spare for something else, if we ever needed it. (The first gap is VM-injected "version" field). > Thanks for checking that. Mandy From alexey.semenyuk at oracle.com Thu Aug 15 19:54:04 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 15 Aug 2019 15:54:04 -0400 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> Message-ID: <4f34e3d5-f420-01f4-c7c2-5a0b772140c5@oracle.com> Sounds good. - Alexey On 8/15/2019 3:40 PM, Andy Herrick wrote: > The first of these doesn't convey any additional information, since it > is just parroting back the given option value. > > The second may be of use, and I could restore it as a Log.verbose(), > but I felt the output here was incomplete, and would be better served > by tracing in the caller, since this is the value returned, and the > caller (either MacAppBundler, MacPkgBundler, or MacAppBundler) could > say what the key was being used for, and if the certificate derived > from this key was valid. > > In general is a fine line to decide what to include in verbose output. > > We used to have both debug and verbose output, but other than printing > out exceptions, theses two and one other were the only places actually > calling Log.debug() > > /Andy > > On 8/15/2019 3:09 PM, Alexey Semenyuk wrote: >> Andy, >> >> What is the reason to remove log statements in >> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html >> >> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html >> >> >> ? >> >> - Alexey >> >> On 8/15/2019 2:53 PM, Andy Herrick wrote: >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8224594 >>> >>> [2] http://cr.openjdk.java.net/~herrick/8224594/ >>> >>> >>> Thanks, >>> >>> Andy >>> >> From andy.herrick at oracle.com Thu Aug 15 20:50:12 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Thu, 15 Aug 2019 16:50:12 -0400 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> Message-ID: <7b3bcf7a-cf86-7559-cba5-7927d6305e50@oracle.com> ok - revised [3] to restore the second trace statement (now Log.verbose()) [3]: http://cr.openjdk.java.net/~herrick/8224594/webrev.02/ /Andy On 8/15/2019 3:40 PM, Andy Herrick wrote: > The first of these doesn't convey any additional information, since it > is just parroting back the given option value. > > The second may be of use, and I could restore it as a Log.verbose(), > but I felt the output here was incomplete, and would be better served > by tracing in the caller, since this is the value returned, and the > caller (either MacAppBundler, MacPkgBundler, or MacAppBundler) could > say what the key was being used for, and if the certificate derived > from this key was valid. > > In general is a fine line to decide what to include in verbose output. > > We used to have both debug and verbose output, but other than printing > out exceptions, theses two and one other were the only places actually > calling Log.debug() > > /Andy > > On 8/15/2019 3:09 PM, Alexey Semenyuk wrote: >> Andy, >> >> What is the reason to remove log statements in >> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html >> >> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html >> >> >> ? >> >> - Alexey >> >> On 8/15/2019 2:53 PM, Andy Herrick wrote: >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8224594 >>> >>> [2] http://cr.openjdk.java.net/~herrick/8224594/ >>> >>> >>> Thanks, >>> >>> Andy >>> >> From alexander.matveev at oracle.com Thu Aug 15 21:36:31 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 15 Aug 2019 14:36:31 -0700 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: <7b3bcf7a-cf86-7559-cba5-7927d6305e50@oracle.com> References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> <7b3bcf7a-cf86-7559-cba5-7927d6305e50@oracle.com> Message-ID: <54c7210d-7853-3572-a85b-b8f5ccbd64f6@oracle.com> Looks good. Thanks, Alexander On 8/15/2019 1:50 PM, Andy Herrick wrote: > ok - revised [3] to restore the second trace statement (now > Log.verbose()) > > [3]: http://cr.openjdk.java.net/~herrick/8224594/webrev.02/ > > /Andy > > On 8/15/2019 3:40 PM, Andy Herrick wrote: >> The first of these doesn't convey any additional information, since >> it is just parroting back the given option value. >> >> The second may be of use, and I could restore it as a Log.verbose(), >> but I felt the output here was incomplete, and would be better served >> by tracing in the caller, since this is the value returned, and the >> caller (either MacAppBundler, MacPkgBundler, or MacAppBundler) could >> say what the key was being used for, and if the certificate derived >> from this key was valid. >> >> In general is a fine line to decide what to include in verbose output. >> >> We used to have both debug and verbose output, but other than >> printing out exceptions, theses two and one other were the only >> places actually calling Log.debug() >> >> /Andy >> >> On 8/15/2019 3:09 PM, Alexey Semenyuk wrote: >>> Andy, >>> >>> What is the reason to remove log statements in >>> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html >>> >>> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html >>> >>> >>> ? >>> >>> - Alexey >>> >>> On 8/15/2019 2:53 PM, Andy Herrick wrote: >>>> Please review the jpackage fix for bug [1] at [2]. >>>> >>>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>>> repository (jpackage). >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8224594 >>>> >>>> [2] http://cr.openjdk.java.net/~herrick/8224594/ >>>> >>>> >>>> Thanks, >>>> >>>> Andy >>>> >>> From alexey.semenyuk at oracle.com Thu Aug 15 22:18:04 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 15 Aug 2019 18:18:04 -0400 Subject: RFR: JDK-8224594: Simplify jpackage Logging In-Reply-To: <7b3bcf7a-cf86-7559-cba5-7927d6305e50@oracle.com> References: <02df74b7-aea1-3af3-5778-3ee36727b406@oracle.com> <74dc679e-abd9-d268-67b6-59b6abd2a0da@oracle.com> <7b3bcf7a-cf86-7559-cba5-7927d6305e50@oracle.com> Message-ID: <79cfc655-b0b4-a232-0a1a-06740f30e580@oracle.com> Looks good. - Alexey On 8/15/2019 4:50 PM, Andy Herrick wrote: > ok - revised [3] to restore the second trace statement (now > Log.verbose()) > > [3]: http://cr.openjdk.java.net/~herrick/8224594/webrev.02/ > > /Andy > > On 8/15/2019 3:40 PM, Andy Herrick wrote: >> The first of these doesn't convey any additional information, since >> it is just parroting back the given option value. >> >> The second may be of use, and I could restore it as a Log.verbose(), >> but I felt the output here was incomplete, and would be better served >> by tracing in the caller, since this is the value returned, and the >> caller (either MacAppBundler, MacPkgBundler, or MacAppBundler) could >> say what the key was being used for, and if the certificate derived >> from this key was valid. >> >> In general is a fine line to decide what to include in verbose output. >> >> We used to have both debug and verbose output, but other than >> printing out exceptions, theses two and one other were the only >> places actually calling Log.debug() >> >> /Andy >> >> On 8/15/2019 3:09 PM, Alexey Semenyuk wrote: >>> Andy, >>> >>> What is the reason to remove log statements in >>> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java.sdiff.html >>> >>> http://cr.openjdk.java.net/~herrick/8224594/webrev.01/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java.sdiff.html >>> >>> >>> ? >>> >>> - Alexey >>> >>> On 8/15/2019 2:53 PM, Andy Herrick wrote: >>>> Please review the jpackage fix for bug [1] at [2]. >>>> >>>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>>> repository (jpackage). >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8224594 >>>> >>>> [2] http://cr.openjdk.java.net/~herrick/8224594/ >>>> >>>> >>>> Thanks, >>>> >>>> Andy >>>> >>> From peter.firmstone at zeus.net.au Thu Aug 15 22:20:15 2019 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Fri, 16 Aug 2019 08:20:15 +1000 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: <5D55DA9F.5050807@zeus.net.au> Hello Claes, The following code is included in the constructor of our SecurityManager implementation, I suspect we may need to add some classes to this list, perhaps this is something that needs documenting? Regards, Peter. /* The following ensures the classes we need are loaded early to avoid * class loading deadlock during permission checks */ try { checkPermission(new RuntimePermission("setIO"), SMPrivilegedContext); } catch (ExceptionInInitializerError er){ Error e = new ExceptionInInitializerError( "All domains on stack when starting a security manager must have AllPermission"); e.initCause(er); throw e; } constructed = Security.class != null; On 15/08/2019 8:03 PM, Claes Redestad wrote: > Hi, > > by resolving permissions for code source URLs lazily, we can reduce > early class loading during bootstrap, which improves footprint, startup > and reduces the typical bootstrap dependency graph. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229773 > Webrev: http://cr.openjdk.java.net/~redestad/8229773/webrev.00/ > > A note on the System.java changes: > > The laziness makes it so that FilePermission isn't initialized > eagerly, which has an implicit bootstrap dependency on that the default > file system provider has been initialized before a SecurityManager has > been installed (since initializing FilePermission will otherwise do > recursive calls into FilePermission). We already force load of the image > reader on SecurityManager due similar bootstrap issues, which > transitively loads the DefaultFileSystemProvider.instance(), but > explicitly adding the dependency on the file system provider to > System::setSecurityManager seems prudent: it's effectively a no-op on > jdk/jdk right now, but documents the dependency and safeguards against > future implementation changes to image reader subsystem. > > A note on the HelloClasslist changes: > > The patch drops a number of classes from being loaded on typical > bootstrap and small apps, including the HelloClasslist tool. Since the > HelloClasslist establishes what's to be included in the default CDS > archive this can lead to a small regression on apps which actually do > use the (nio) file system provider, so explicitly adding it in avoids > tiny regression on those while not diminishing the speed-up to other > apps. > > Testing: tier1-3 > > Thanks! > > /Claes From peter.firmstone at zeus.net.au Thu Aug 15 23:39:24 2019 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Fri, 16 Aug 2019 09:39:24 +1000 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: Message-ID: <5D55ED2C.6000306@zeus.net.au> Hello Alan, This is related to URL and CodeSource and might be worth making a note of for future reference. Our software uses delayed dynamically assigned permissions via a policy provider, but for privileged domains that have AllPermission we make sure to assign this up front (We also utilise an RFC3986URIClassLoader and override CodeSource, so we're using our RFC3986 compliant URI instead of URL). The former because we dynamically download CodeSource's and there's no way of predicting up front which will be downloaded and the latter as a performance optimisation of ProtectionDomain. So we have a RFC3986 URI implementation, similar to Java's URI, it is not Serializable for security reasons. In addition to RFC3896 normalization, we have also recently added the ability to normalize IPv6 address conformant to "RFC 5952 A Recommendation for IPv6 Address Text Representation." The class also normalizes file system paths in a platform dependant manner, eg Upper Case for MS Windows, but not Unix. We have a URI::implies method that is similar to CodeSource::implies, with matching rules. We do this to avoid DNS calls or accessing the file system unnecessarily. Also, to avoid synchronization / locking overhead of PermissionCollection's and Permissions, we have a Policy provider that generates a thread confined Permissions and PermissionCollection instances on demand, allowing them to be garbage collected as soon as the implies call returns (Permission objects are initialized up front and effectively immutable and cached) a PermissionComparator also arranges the Permissions in an order that improves performance wen creating PermissionCollection instances. Our Security overhead is less than 1% as a result and the delays and blocking we had due to DNS calls have been eliminated. Regards, Peter. On 15/08/2019 8:56 PM, Alan Bateman wrote: > On 15/08/2019 11:03, Claes Redestad wrote: >> Hi, >> >> by resolving permissions for code source URLs lazily, we can reduce >> early class loading during bootstrap, which improves footprint, startup >> and reduces the typical bootstrap dependency graph. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8229773 >> Webrev: http://cr.openjdk.java.net/~redestad/8229773/webrev.00/ >> >> : > I think the approach is okay as URL::openConnection doesn't actually > open the connection to the resource and the creation of the > URLStreamdHandler shouldn't depend on permissions granted to the > caller. If a handler needs permissions when creating the URLConnection > then it should do so in a privileged block. I think it would be a bit > cleaner if the supporting class would lazily add the permissions for a > CodeSource to the collection. That is, create it with a permissions > collection and code source rather than a URL to match > SecureClassLoader::getPermissions. You could potentially use it in > URLClassLoader getPermission(CodeSource) method too. > > In System.setSecurityManager then you might need > DefaultFileSystemProvider.theFileSystem() to ensure that the default > file system is fully initialized before setting the SM. > > A minor nit this adds a spurious import BuiltinClassLoader. Also it > can import the sun.security.uti class to be consistent with the > existing code. > > -Alan > > > From david.holmes at oracle.com Fri Aug 16 00:41:00 2019 From: david.holmes at oracle.com (David Holmes) Date: Fri, 16 Aug 2019 10:41:00 +1000 Subject: flatMap still prevents short circuiting when using .iterator() In-Reply-To: References: Message-ID: Re-directing to core-libs-dev David On 15/08/2019 7:48 pm, Stephen Buergler wrote: > Not really sure where to send this. > flatMap was fixed so that it doesn't prevent short circuiting. > https://bugs.openjdk.java.net/browse/JDK-8075939 > If you replace the test cases in the ticket with versions that use > .iterator().next() instead of .findFirst().get() then the problem > still happens. > I just tested this with openjdk:14 on docker hub. > From Alan.Bateman at oracle.com Fri Aug 16 07:04:47 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 16 Aug 2019 08:04:47 +0100 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <5D55DA9F.5050807@zeus.net.au> References: <5D55DA9F.5050807@zeus.net.au> Message-ID: <8ce427f1-5473-9e2f-af85-ceb7b08ed419@oracle.com> On 15/08/2019 23:20, Peter Firmstone wrote: > : > > The following code is included in the constructor of our > SecurityManager implementation, I suspect we may need to add some > classes to this list, perhaps this is something that needs documenting? The checkPermission method of custom security manager can run arbitrary code so recursive initialization, stack overflow, bootstrap method errors, ... are always hazards. I don't know what documentation you have in mind but I don't think there is a definite list of classes that need to be loaded/initialized before the custom security manager is set because it will come down to the code that it executes in its checkPermission method. -Alan. From Alan.Bateman at oracle.com Fri Aug 16 10:39:02 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 16 Aug 2019 11:39:02 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> Message-ID: <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> On 15/08/2019 12:53, Andrew Dinn wrote: > Hi Alan, > > Any further input on this patch forthcoming? > I think the main changes since I looked at it previously have been in the tests. On non-Linux platforms, FileChannel.map should throw UOE when invoked with a mode map of READ_ONLY_SYNC or READ_WRITE_SYNC so I think we need a test for that. MapFail seems fragile. If you add @modules java.base/jdk.internal.misc to the test description then it could use Unsafe::isWritebackEnabled and I think would simplify the test and checks. It would mean it could run on all platforms. Also "MapFail" is probably too general a name for a test in MBB because its specific to the extended map modes, not a general test of map failing. In passing, MappedByteBuffer load/isLoaded check the fd value before isSync, can force() do the same? Also the @return on the private isSync method is very wordy and I don't think needs to duplicate the method description. -Alan From peter.firmstone at zeus.net.au Fri Aug 16 10:40:16 2019 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Fri, 16 Aug 2019 20:40:16 +1000 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <8ce427f1-5473-9e2f-af85-ceb7b08ed419@oracle.com> References: <5D55DA9F.5050807@zeus.net.au> <8ce427f1-5473-9e2f-af85-ceb7b08ed419@oracle.com> Message-ID: <5D568810.8060503@zeus.net.au> Hello Alan, Yes, we are aware of those issues. I mean documenting that system Permission classes should be loaded before setting a custom SecurityManager, accessing the file system is important, so if you haven't loaded the necessary classes before setting a custom SecurityManager, it won't be gracefull... The simplest way of ensuring classes are loaded is by creating object instances of them. Perhaps just a note to beware of ensuring necessary classes are loaded and let developers figure out what they need. The recursive calls are easy enough to deal with to avoid any stack overflows using ThreadLocal. inTrustedCodeRecursiveCall.set(Boolean.TRUE); try { delegateContext = AccessController.doPrivileged( new PrivilegedAction(){ public AccessControlContext run() { return new AccessControlContext(finalExecutionContext, dc); } } ); }finally { inTrustedCodeRecursiveCall.set(Boolean.FALSE); // Must always happen, no matter what. } We've only really been caught out once with some jvm bootstrap changes, otherwise it's been rock solid. The other thing we do is once we've got more than three ProtectionDomains on the stack is execute the ProtectionDomain implies checks in parallel. Really helps when you're making a lot of network calls. Cheers, Peter. On 16/08/2019 5:04 PM, Alan Bateman wrote: > On 15/08/2019 23:20, Peter Firmstone wrote: >> : >> >> The following code is included in the constructor of our >> SecurityManager implementation, I suspect we may need to add some >> classes to this list, perhaps this is something that needs documenting? > The checkPermission method of custom security manager can run > arbitrary code so recursive initialization, stack overflow, bootstrap > method errors, ... are always hazards. I don't know what documentation > you have in mind but I don't think there is a definite list of classes > that need to be loaded/initialized before the custom security manager > is set because it will come down to the code that it executes in its > checkPermission method. > > -Alan. > > From claes.redestad at oracle.com Fri Aug 16 11:14:46 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Fri, 16 Aug 2019 13:14:46 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <5D568810.8060503@zeus.net.au> References: <5D55DA9F.5050807@zeus.net.au> <8ce427f1-5473-9e2f-af85-ceb7b08ed419@oracle.com> <5D568810.8060503@zeus.net.au> Message-ID: <1d1ea235-77bc-9517-9f00-4053c71be759@oracle.com> Hi Peter, by explicitly ensuring the file system has been initialized before installing a SecurityManager using a hook in System.setSecurityManager, the patch at hand takes step to ensure things stay neutral w.r.t. Permission initialization order when using any SecurityManager. It's not perfectly identical, so while unlikely, there's a theoretical possibility some implementation scenario not covered by our regression tests might run into issues. Any help testing custom implementation on coming EA builds would be greatly appreciated! One thing we could do on the JDK end to reduce fragility somewhat in this area is to provoke initialization of sun.security.util.SecurityConstants before installing the first SM. /Claes On 2019-08-16 12:40, Peter Firmstone wrote: > Hello Alan, > > Yes, we are aware of those issues. > > I mean documenting that system Permission classes should be loaded > before setting a custom SecurityManager, accessing the file system is > important, so if you haven't loaded the necessary classes before setting > a custom SecurityManager, it won't be gracefull...? The simplest way of > ensuring classes are loaded is by creating object instances of them. > > Perhaps just a note to beware of ensuring necessary classes are loaded > and let developers figure out what they need. > > The recursive calls are easy enough to deal with to avoid any stack > overflows using ThreadLocal. > > inTrustedCodeRecursiveCall.set(Boolean.TRUE); > ??????????? try { > ??????????????? delegateContext = AccessController.doPrivileged( > ??????????????????? new PrivilegedAction(){ > ??????????????????????? public AccessControlContext run() { > ??????????????????????????? return new > AccessControlContext(finalExecutionContext, dc); > ??????????????????????? } > ??????????????????? } > ??????????????? ); > ??????????? }finally { > ??????????????? inTrustedCodeRecursiveCall.set(Boolean.FALSE); // Must > always happen, no matter what. > ??????????? } > > We've only really been caught out once with some jvm bootstrap changes, > otherwise it's been rock solid. > > The other thing we do is once we've got more than three > ProtectionDomains on the stack is execute the ProtectionDomain implies > checks in parallel.? Really helps when you're making a lot of network > calls. > > Cheers, > > Peter. > > On 16/08/2019 5:04 PM, Alan Bateman wrote: >> On 15/08/2019 23:20, Peter Firmstone wrote: >>> : >>> >>> The following code is included in the constructor of our >>> SecurityManager implementation, I suspect we may need to add some >>> classes to this list, perhaps this is something that needs documenting? >> The checkPermission method of custom security manager can run >> arbitrary code so recursive initialization, stack overflow, bootstrap >> method errors, ... are always hazards. I don't know what documentation >> you have in mind but I don't think there is a definite list of classes >> that need to be loaded/initialized before the custom security manager >> is set because it will come down to the code that it executes in its >> checkPermission method. >> >> -Alan. >> >> > From claes.redestad at oracle.com Fri Aug 16 12:30:02 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Fri, 16 Aug 2019 14:30:02 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> Message-ID: <29f787cf-a4ab-c294-69ee-2361fdfe0186@oracle.com> On 2019-08-15 21:21, Alan Bateman wrote: > On 15/08/2019 16:22, Claes Redestad wrote: >> (adding back core-libs-dev) >> >> Hi Roger, >> >> seems easy enough to add a writeReplace: >> >> http://cr.openjdk.java.net/~redestad/8229773/webrev.02 > This mostly looks good. In LazyCodeSourcePermissionCollection it think > "initialize" should be renamed to "ensureAdded" as that more accurately > describes what it does. Also the class description could do with a bit > of word smiting to make it clear that permissions for a CodeSource are > lazily added to the underlying permission collection. How about this: http://cr.openjdk.java.net/~redestad/8229773/webrev.03/ Also simplified BuiltinClassLoader#getPermissions since the jrt-specific optimization is now redundant. /Claes From Alan.Bateman at oracle.com Fri Aug 16 16:38:41 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 16 Aug 2019 17:38:41 +0100 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <29f787cf-a4ab-c294-69ee-2361fdfe0186@oracle.com> References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> <29f787cf-a4ab-c294-69ee-2361fdfe0186@oracle.com> Message-ID: On 16/08/2019 13:30, Claes Redestad wrote: > > How about this: > > http://cr.openjdk.java.net/~redestad/8229773/webrev.03/ > > Also simplified BuiltinClassLoader#getPermissions since the jrt-specific > optimization is now redundant. > Looks good. -Alan From sean.mullan at oracle.com Fri Aug 16 16:51:25 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Fri, 16 Aug 2019 12:51:25 -0400 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> <29f787cf-a4ab-c294-69ee-2361fdfe0186@oracle.com> Message-ID: +1 from me as well. --Sean On 8/16/19 12:38 PM, Alan Bateman wrote: > On 16/08/2019 13:30, Claes Redestad wrote: >> >> How about this: >> >> http://cr.openjdk.java.net/~redestad/8229773/webrev.03/ >> >> Also simplified BuiltinClassLoader#getPermissions since the jrt-specific >> optimization is now redundant. >> > Looks good. > > -Alan > From Roger.Riggs at oracle.com Fri Aug 16 17:00:29 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Fri, 16 Aug 2019 13:00:29 -0400 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> <29f787cf-a4ab-c294-69ee-2361fdfe0186@oracle.com> Message-ID: +1 On 8/16/19 12:51 PM, Sean Mullan wrote: > +1 from me as well. > > --Sean > > On 8/16/19 12:38 PM, Alan Bateman wrote: >> On 16/08/2019 13:30, Claes Redestad wrote: >>> >>> How about this: >>> >>> http://cr.openjdk.java.net/~redestad/8229773/webrev.03/ >>> >>> Also simplified BuiltinClassLoader#getPermissions since the >>> jrt-specific >>> optimization is now redundant. >>> >> Looks good. >> >> -Alan >> From andy.herrick at oracle.com Fri Aug 16 18:22:30 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 16 Aug 2019 14:22:30 -0400 Subject: JDK-8229786: No output after WinShortcutTest.exe is launched Message-ID: <864b79ff-c6db-573f-365f-b96e6083715e@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8229786 [2] http://cr.openjdk.java.net/~herrick/8229786 Thanks, Andy From alexey.semenyuk at oracle.com Fri Aug 16 18:26:48 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 16 Aug 2019 14:26:48 -0400 Subject: JDK-8229786: No output after WinShortcutTest.exe is launched In-Reply-To: <864b79ff-c6db-573f-365f-b96e6083715e@oracle.com> References: <864b79ff-c6db-573f-365f-b96e6083715e@oracle.com> Message-ID: Andy, I think we want this change in all Windows jtreg tests as they all use this windowless Hello test. - Alexey On 8/16/2019 2:22 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229786 > > [2] http://cr.openjdk.java.net/~herrick/8229786 > > > Thanks, > > Andy > From alexey.semenyuk at oracle.com Fri Aug 16 18:28:57 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 16 Aug 2019 14:28:57 -0400 Subject: RFR: JDK-8213941: Debian linux problems in JavaPackager In-Reply-To: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> References: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> Message-ID: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - add --linux-app-category command line option [1] https://bugs.openjdk.java.net/browse/JDK-8213941 2] http://cr.openjdk.java.net/~asemenyuk/8213941/webrev.00/ Thanks, Alexey From andy.herrick at oracle.com Fri Aug 16 19:08:34 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 16 Aug 2019 15:08:34 -0400 Subject: JDK-8229786: No output after WinShortcutTest.exe is launched In-Reply-To: References: <864b79ff-c6db-573f-365f-b96e6083715e@oracle.com> Message-ID: <3f4a0e88-bc2d-75c4-59b5-bf2d22be9f63@oracle.com> On 8/16/2019 2:26 PM, Alexey Semenyuk wrote: > Andy, > > I think we want this change in all Windows jtreg tests as they all use > this windowless Hello test. yes - but except for testing launching app from shortcut of the installed app, the automated tests run the app and capture it's output, so only on these cases is--win-console arg needed to confirm the operation (creation of a shortcut by installer) succeeded. /Andy > - Alexey > > On 8/16/2019 2:22 PM, Andy Herrick wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8229786 >> >> [2] http://cr.openjdk.java.net/~herrick/8229786 >> >> >> Thanks, >> >> Andy >> > From alexey.semenyuk at oracle.com Fri Aug 16 19:12:04 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 16 Aug 2019 15:12:04 -0400 Subject: JDK-8229786: No output after WinShortcutTest.exe is launched In-Reply-To: <3f4a0e88-bc2d-75c4-59b5-bf2d22be9f63@oracle.com> References: <864b79ff-c6db-573f-365f-b96e6083715e@oracle.com> <3f4a0e88-bc2d-75c4-59b5-bf2d22be9f63@oracle.com> Message-ID: <0bc2b5cb-526e-7d56-9015-7618280a7ddc@oracle.com> Makes sense. Looks good then. - Alexey On 8/16/2019 3:08 PM, Andy Herrick wrote: > On 8/16/2019 2:26 PM, Alexey Semenyuk wrote: >> Andy, >> >> I think we want this change in all Windows jtreg tests as they all >> use this windowless Hello test. > > yes - but except for testing launching app from shortcut of the > installed app, the automated tests run the app and capture it's > output, so only on these cases is--win-console arg needed to confirm > the operation (creation of a shortcut by installer) succeeded. > > /Andy > >> - Alexey >> >> On 8/16/2019 2:22 PM, Andy Herrick wrote: >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8229786 >>> >>> [2] http://cr.openjdk.java.net/~herrick/8229786 >>> >>> >>> Thanks, >>> >>> Andy >>> >> From Roger.Riggs at oracle.com Fri Aug 16 19:15:30 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Fri, 16 Aug 2019 15:15:30 -0400 Subject: RFR 8207814: (proxy) upgrade the proxy class generator Message-ID: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> Please review an enhancement to replace the java.lang.reflect.Proxy class file generation. The new generator uses ASM and generates stackmaps. The implementation follows the same structure as before but has many differences as it leverages ASM for generating the bytecode. A Combo test is included and two JMH based benchmarks. The ancient ProxyGenerator_15 implementation is temporarily retained to allow comparisons of generated class files and performance. Issue: ? https://bugs.openjdk.java.net/browse/JDK-8207814 Webrev: http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ (Upgrading bytecode generation is necessary for Valhalla but makes sense for the main line.) Thanks, Roger From vlv.spb.ru at mail.ru Fri Aug 16 19:29:46 2019 From: vlv.spb.ru at mail.ru (=?UTF-8?B?VmxhZGltaXIgWWFyb3NsYXZza2l5?=) Date: Fri, 16 Aug 2019 22:29:46 +0300 Subject: =?UTF-8?B?RndkOiBSZTogUmVbMl06IEFkYXB0aXZlIGluc2VydGlvbiBzb3J0IGluIER1?= =?UTF-8?B?YWxQaXZvdCBRdWlja3NvcnQ=?= Message-ID: <1565983786.413302409@f478.i.mail.ru> Hi Vladimir, I performed lots of benchmarks: 1. I updated my own sort-bench (jmh based) and run many tests (all distributions + permutations) on integer arrays for sizes = 50, 100, 150, 200, 500, 1000, 2000: In this benchmark, the metric is (minimum + stddev) and it gives the overall score: in average, the new DPQS is 7% faster Comparing sorters DPQ_19_05_01 vs DPQ_19_08_09 winners : 349 / 321 stats (%): [1115: ?=107.99222 ?=45.746456 rms=153.73868 min=62.684937 max=524.28424] Full results are available: https://github.com/bourgesl/nearly-optimal-mergesort-code/blob/master/sort-bench/2019.08/sort-50-2000-stats.out 2. I ran Vladimir's test (from https://github.com/iaroslavski/sorting ): Before (07/24): # Data type = int, Sorting type = sequential, Length = 150 test_name;jdk_time;dpqs_time;gain random;1867.00;2074.00;-0.11 equal;224.00;98.00;0.56 ascending;476.00;112.00;0.76 descending;1185.00;260.00;0.78 period[4];564.00;782.00;-0.39 period[5];610.00;1076.00;-0.76 period[6];710.00;1028.00;-0.45 stagger[15];1788.00;2316.00;-0.30 stagger[24];709.00;1028.00;-0.45 stagger[33];2020.00;1934.00;0.04 shuffle[6];1624.00;1218.00;0.25 shuffle[7];1347.00;1189.00;0.12 shuffle[8];1345.00;1085.00;0.19 TOTAL;14469.00;14200.00;0.02 Patched (08/14): # Data type = int, Sorting type = sequential, Length = 150 test_name;jdk_time;dpqs_time;gain random;1881.00;1860.00;0.01 equal;223.00;98.00;0.56 ascending;478.00;111.00;0.77 descending;1192.00;262.00;0.78 period[4];564.00;660.00;-0.17 period[5];613.00;1014.00;-0.65 period[6];713.00;968.00;-0.36 stagger[15];1787.00;1893.00;-0.06 stagger[24];712.00;969.00;-0.36 stagger[33];2021.00;1890.00;0.06 shuffle[6];1618.00;1185.00;0.27 shuffle[7];1361.00;1129.00;0.17 shuffle[8];1341.00;1094.00;0.18 TOTAL;14504.00;13133.00;0.09 In conclusion, I confirm Vladimir's gain on my laptop (Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz): size = 150, char, was: 0.02 -> new: 0.09 Finally both benchmarks agree 7% gain ! Cheers, Laurent From andy.herrick at oracle.com Fri Aug 16 20:36:33 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 16 Aug 2019 16:36:33 -0400 Subject: RFR:JDK-8229791: Code clean up regressions Message-ID: <716daf7a-2540-9898-2836-eee6fb485ab2@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8229791 [2] http://cr.openjdk.java.net/~herrick/8229791/webrev.02/ Thanks, Andy From andy.herrick at oracle.com Fri Aug 16 20:39:23 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Fri, 16 Aug 2019 16:39:23 -0400 Subject: RFR: JDK-8213941: Debian linux problems in JavaPackager In-Reply-To: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> References: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Message-ID: looks good /Andy On 8/16/2019 2:28 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - add --linux-app-category command line option > > [1] https://bugs.openjdk.java.net/browse/JDK-8213941 > > 2] http://cr.openjdk.java.net/~asemenyuk/8213941/webrev.00/ > > Thanks, > Alexey > From alexander.matveev at oracle.com Fri Aug 16 20:57:03 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Fri, 16 Aug 2019 13:57:03 -0700 Subject: JDK-8229786: No output after WinShortcutTest.exe is launched In-Reply-To: <0bc2b5cb-526e-7d56-9015-7618280a7ddc@oracle.com> References: <864b79ff-c6db-573f-365f-b96e6083715e@oracle.com> <3f4a0e88-bc2d-75c4-59b5-bf2d22be9f63@oracle.com> <0bc2b5cb-526e-7d56-9015-7618280a7ddc@oracle.com> Message-ID: <9b0b97f6-5e19-b5d6-80c7-482b9a667f20@oracle.com> Looks good. Thanks, Alexander On 8/16/2019 12:12 PM, Alexey Semenyuk wrote: > Makes sense. Looks good then. > > - Alexey > > On 8/16/2019 3:08 PM, Andy Herrick wrote: >> On 8/16/2019 2:26 PM, Alexey Semenyuk wrote: >>> Andy, >>> >>> I think we want this change in all Windows jtreg tests as they all >>> use this windowless Hello test. >> >> yes - but except for testing launching app from shortcut of the >> installed app, the automated tests run the app and capture it's >> output, so only on these cases is--win-console arg needed to confirm >> the operation (creation of a shortcut by installer) succeeded. >> >> /Andy >> >>> - Alexey >>> >>> On 8/16/2019 2:22 PM, Andy Herrick wrote: >>>> Please review the jpackage fix for bug [1] at [2]. >>>> >>>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>>> repository (jpackage). >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8229786 >>>> >>>> [2] http://cr.openjdk.java.net/~herrick/8229786 >>>> >>>> >>>> Thanks, >>>> >>>> Andy >>>> >>> > From alexey.semenyuk at oracle.com Fri Aug 16 20:58:35 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 16 Aug 2019 16:58:35 -0400 Subject: RFR:JDK-8229791: Code clean up regressions In-Reply-To: <716daf7a-2540-9898-2836-eee6fb485ab2@oracle.com> References: <716daf7a-2540-9898-2836-eee6fb485ab2@oracle.com> Message-ID: Looks good. - Alexey On 8/16/2019 4:36 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229791 > > [2] http://cr.openjdk.java.net/~herrick/8229791/webrev.02/ > > > Thanks, > > Andy > > From alexander.matveev at oracle.com Fri Aug 16 21:04:59 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Fri, 16 Aug 2019 14:04:59 -0700 Subject: RFR: JDK-8213941: Debian linux problems in JavaPackager In-Reply-To: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> References: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Message-ID: <93f831cd-3080-eb5e-1ea3-cc2d0133c747@oracle.com> Looks good. Is it possible to have test for this new option? If yes, then as part of this fix or as separate issue should be fine. Thanks, Alexander On 8/16/2019 11:28 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - add --linux-app-category command line option > > [1] https://bugs.openjdk.java.net/browse/JDK-8213941 > > 2] http://cr.openjdk.java.net/~asemenyuk/8213941/webrev.00/ > > Thanks, > Alexey > From alexey.semenyuk at oracle.com Fri Aug 16 21:09:08 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 16 Aug 2019 17:09:08 -0400 Subject: RFR: JDK-8213941: Debian linux problems in JavaPackager In-Reply-To: <93f831cd-3080-eb5e-1ea3-cc2d0133c747@oracle.com> References: <30d69bc8-b8bb-38b0-2455-7a5424304a2b@oracle.com> <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> <93f831cd-3080-eb5e-1ea3-cc2d0133c747@oracle.com> Message-ID: I've created https://bugs.openjdk.java.net/browse/JDK-8229840 to track this task. - Alexey On 8/16/2019 5:04 PM, Alexander Matveev wrote: > Looks good. > > Is it possible to have test for this new option? If yes, then as part > of this fix or as separate issue should be fine. > > Thanks, > Alexander > > On 8/16/2019 11:28 AM, Alexey Semenyuk wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - add --linux-app-category command line option >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8213941 >> >> 2] http://cr.openjdk.java.net/~asemenyuk/8213941/webrev.00/ >> >> Thanks, >> Alexey >> > From alexander.matveev at oracle.com Fri Aug 16 21:13:43 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Fri, 16 Aug 2019 14:13:43 -0700 Subject: RFR:JDK-8229791: Code clean up regressions In-Reply-To: <716daf7a-2540-9898-2836-eee6fb485ab2@oracle.com> References: <716daf7a-2540-9898-2836-eee6fb485ab2@oracle.com> Message-ID: Looks good. Thanks, Alexander On 8/16/2019 1:36 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229791 > > [2] http://cr.openjdk.java.net/~herrick/8229791/webrev.02/ > > > Thanks, > > Andy > > From peter.firmstone at zeus.net.au Fri Aug 16 21:24:26 2019 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Sat, 17 Aug 2019 07:24:26 +1000 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: <1d1ea235-77bc-9517-9f00-4053c71be759@oracle.com> References: <5D55DA9F.5050807@zeus.net.au> <8ce427f1-5473-9e2f-af85-ceb7b08ed419@oracle.com> <5D568810.8060503@zeus.net.au> <1d1ea235-77bc-9517-9f00-4053c71be759@oracle.com> Message-ID: <5D571F0A.8020709@zeus.net.au> Thanks Claes, I'll run some tests :) Cheers, Peter. On 16/08/2019 9:14 PM, Claes Redestad wrote: > Hi Peter, > > by explicitly ensuring the file system has been initialized before > installing a SecurityManager using a hook in System.setSecurityManager, > the patch at hand takes step to ensure things stay neutral w.r.t. > Permission initialization order when using any SecurityManager. It's not > perfectly identical, so while unlikely, there's a theoretical > possibility some implementation scenario not covered by our regression > tests might run into issues. Any help testing custom implementation on > coming EA builds would be greatly appreciated! > > One thing we could do on the JDK end to reduce fragility somewhat in > this area is to provoke initialization of > sun.security.util.SecurityConstants before installing the first SM. > > /Claes > > On 2019-08-16 12:40, Peter Firmstone wrote: >> Hello Alan, >> >> Yes, we are aware of those issues. >> >> I mean documenting that system Permission classes should be loaded >> before setting a custom SecurityManager, accessing the file system is >> important, so if you haven't loaded the necessary classes before >> setting a custom SecurityManager, it won't be gracefull... The >> simplest way of ensuring classes are loaded is by creating object >> instances of them. >> >> Perhaps just a note to beware of ensuring necessary classes are >> loaded and let developers figure out what they need. >> >> The recursive calls are easy enough to deal with to avoid any stack >> overflows using ThreadLocal. >> >> inTrustedCodeRecursiveCall.set(Boolean.TRUE); >> try { >> delegateContext = AccessController.doPrivileged( >> new PrivilegedAction(){ >> public AccessControlContext run() { >> return new >> AccessControlContext(finalExecutionContext, dc); >> } >> } >> ); >> }finally { >> inTrustedCodeRecursiveCall.set(Boolean.FALSE); // >> Must always happen, no matter what. >> } >> >> We've only really been caught out once with some jvm bootstrap >> changes, otherwise it's been rock solid. >> >> The other thing we do is once we've got more than three >> ProtectionDomains on the stack is execute the ProtectionDomain >> implies checks in parallel. Really helps when you're making a lot of >> network calls. >> >> Cheers, >> >> Peter. >> >> On 16/08/2019 5:04 PM, Alan Bateman wrote: >>> On 15/08/2019 23:20, Peter Firmstone wrote: >>>> : >>>> >>>> The following code is included in the constructor of our >>>> SecurityManager implementation, I suspect we may need to add some >>>> classes to this list, perhaps this is something that needs >>>> documenting? >>> The checkPermission method of custom security manager can run >>> arbitrary code so recursive initialization, stack overflow, >>> bootstrap method errors, ... are always hazards. I don't know what >>> documentation you have in mind but I don't think there is a definite >>> list of classes that need to be loaded/initialized before the custom >>> security manager is set because it will come down to the code that >>> it executes in its checkPermission method. >>> >>> -Alan. >>> >>> >> From mandy.chung at oracle.com Sat Aug 17 00:59:13 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 16 Aug 2019 17:59:13 -0700 Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> Message-ID: Hi Roger, Thanks for doing this.? Replacing ancient bytecode generators makes it much easier to support new features like value types. The diff of ProxyGenerator is not quite right (might be due to the rename?) as some code are unchanged but shown as modified. "jdk.proxy.ProxyGenerator.saveGeneratedFiles" is an existing property. Perhaps a better name for "jdk.proxy.proxy_15" would be "jdk.proxy.ProxyGenerator.useASM" with default true. Perhaps renaming ProxyGenerator_15 to LegacyProxyGenerator? The combo test is great that exercises different combinations. It validates the interfaces that the proxy class implements and the exception types in the methods of the proxy class. I checked the existing test/jdk/java/lang/reflect/Proxy tests. It looks like there is no proxy test with an invocation handler that throws checked exceptions and also undeclared exceptions. It'd be good if you can add that as a sanity test. Mandy On 8/16/19 12:15 PM, Roger Riggs wrote: > Please review an enhancement to replace the java.lang.reflect.Proxy > class file generation. > The new generator uses ASM and generates stackmaps. The implementation > follows > the same structure as before but has many differences as it leverages > ASM for generating the bytecode. > A Combo test is included and two JMH based benchmarks. > > The ancient ProxyGenerator_15 implementation is temporarily retained > to allow comparisons of generated class files and performance. > > Issue: > ? https://bugs.openjdk.java.net/browse/JDK-8207814 > > Webrev: > http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ > > (Upgrading bytecode generation is necessary for Valhalla but makes > sense for the main line.) > > Thanks, Roger > From mandrikov at gmail.com Sun Aug 18 19:22:47 2019 From: mandrikov at gmail.com (Evgeny Mandrikov) Date: Sun, 18 Aug 2019 21:22:47 +0200 Subject: RFR: JDK-8139820: URLClassPath.FileLoader constructor redundantly checks protocol Message-ID: Hello! Please review patch [1] for JDK-8139820 [2]. Also it needs a sponsor since I have only author status in OpenJDK Census [3]. With best regards, Evgeny Mandrikov [1] https://cr.openjdk.java.net/~godin/8139820/webrev.00/ [2] https://bugs.openjdk.java.net/browse/JDK-8139820 [3] https://openjdk.java.net/census#godin From claes.redestad at oracle.com Sun Aug 18 22:18:46 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 19 Aug 2019 00:18:46 +0200 Subject: RFR: JDK-8139820: URLClassPath.FileLoader constructor redundantly checks protocol In-Reply-To: References: Message-ID: <6bbaf3d7-be33-e629-6f47-764a24beebcd@oracle.com> Hi, On 2019-08-18 21:22, Evgeny Mandrikov wrote: > [1] https://cr.openjdk.java.net/~godin/8139820/webrev.00/ looks ok to me. I'd add a comment that protocol is assumed to be "file", and perhaps make the constructor private (valid since JDK 11). I can sponsor the change, seeing how I apperently filed and then completely forgot about this cleanup.. :-) Thanks! /Claes From claes.redestad at oracle.com Mon Aug 19 06:52:24 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 19 Aug 2019 08:52:24 +0200 Subject: RFR: 8229773: Resolve permissions for code source URLs lazily In-Reply-To: References: <079ccff9-e5dd-c0ab-0684-10380132386d@oracle.com> <36a9e4db-2380-fa0c-6675-18bb66213f09@oracle.com> <29f787cf-a4ab-c294-69ee-2361fdfe0186@oracle.com> Message-ID: Thanks everyone. Pushed. /Claes Roger Riggs skrev: (16 augusti 2019 19:00:29 CEST) >+1 > >On 8/16/19 12:51 PM, Sean Mullan wrote: >> +1 from me as well. >> >> --Sean >> >> On 8/16/19 12:38 PM, Alan Bateman wrote: >>> On 16/08/2019 13:30, Claes Redestad wrote: >>>> >>>> How about this: >>>> >>>> http://cr.openjdk.java.net/~redestad/8229773/webrev.03/ >>>> >>>> Also simplified BuiltinClassLoader#getPermissions since the >>>> jrt-specific >>>> optimization is now redundant. >>>> >>> Looks good. >>> >>> -Alan >>> -- Skickat fr?n min Android-enhet med K-9 Mail. Urs?kta min f?ordighet. From chris.hegarty at oracle.com Mon Aug 19 07:43:34 2019 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 19 Aug 2019 08:43:34 +0100 Subject: RFR: JDK-8139820: URLClassPath.FileLoader constructor redundantly checks protocol In-Reply-To: <6bbaf3d7-be33-e629-6f47-764a24beebcd@oracle.com> References: <6bbaf3d7-be33-e629-6f47-764a24beebcd@oracle.com> Message-ID: > On 18 Aug 2019, at 23:18, Claes Redestad wrote: > > Hi, > > On 2019-08-18 21:22, Evgeny Mandrikov wrote: >> [1] https://cr.openjdk.java.net/~godin/8139820/webrev.00/ > > looks ok to me. +1 seems ok to me. -Chris From shade at redhat.com Mon Aug 19 08:02:28 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Mon, 19 Aug 2019 10:02:28 +0200 Subject: RFR: JDK-8152467: remove uses of anachronistic array declarations for method return type In-Reply-To: References: Message-ID: <5acd1c4a-5685-9d96-ac71-02ca9d5c536b@redhat.com> On 8/15/19 9:01 PM, Aleksey Shipilev wrote: > On 8/15/19 6:46 PM, Evgeny Mandrikov wrote: >> [1] http://cr.openjdk.java.net/~godin/8152467/webrev.00/ > > This looks good. I also believe this qualifies as trivial patch. I will be sponsoring the push. Now running through jdk-submit, to avoid surprises. -- Thanks, -Aleksey From OGATAK at jp.ibm.com Mon Aug 19 09:51:06 2019 From: OGATAK at jp.ibm.com (Kazunori Ogata) Date: Mon, 19 Aug 2019 18:51:06 +0900 Subject: RFR: JDK-8229871: Imporve performance of Method.copy() and leafCopy() Message-ID: Hi, May I have review for "JDK-8229871: Imporve performance of Method.copy() and leafCopy()"? Method.copy() and leafCopy() creates a copy of a Method object with sharing MethodAccessor object. Since the methodAccessor field is a volatile variable, copying this field needs memory fence to ensure the field is visible to all threads on the weak memory platforms such as POWER and ARM. When the methodAccessor of the root object is null (i.e., not initialized yet), we do not need to copy the null value because this field of the copied object has been initialized to null in the constructor. We can reduce overhead of the memory fence only when the root's methodAccessor is non-null. This change improved performance by 5.8% using a micro benchmark that repeatedly invokes Class.getMethods(). Bug: https://bugs.openjdk.java.net/browse/JDK-8229871 Webrev: http://cr.openjdk.java.net/~ogatak/8229871/webrev.00/ By the way, why Method.methodAccessor is volatile, while Field.fieldAccessor and Field.overrideFieldAccessor are not volatile? I know the use of volatile reduces probability of creating duplicated method accessor, but the chance still exists. I couldn't find the difference between Method and Field classes to make Method.methodAccessor volatile. If we can make it non-volatile, it is more preferable than a quick hack above. Regards, Ogata From Alan.Bateman at oracle.com Mon Aug 19 10:14:07 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 19 Aug 2019 11:14:07 +0100 Subject: RFR: JDK-8152467: remove uses of anachronistic array declarations for method return type In-Reply-To: <5acd1c4a-5685-9d96-ac71-02ca9d5c536b@redhat.com> References: <5acd1c4a-5685-9d96-ac71-02ca9d5c536b@redhat.com> Message-ID: On 19/08/2019 09:02, Aleksey Shipilev wrote: > On 8/15/19 9:01 PM, Aleksey Shipilev wrote: >> On 8/15/19 6:46 PM, Evgeny Mandrikov wrote: >>> [1] http://cr.openjdk.java.net/~godin/8152467/webrev.00/ >> This looks good. > I also believe this qualifies as trivial patch. Yes, and looks okay although it's probably not worth spending time cleaning up rmic as it will be removed at some point (the need for it to generate static stubs mostly went away in JDK 5 and the tool has been deprecated for several releases). -Alan. > I will be sponsoring the push. Now running through > jdk-submit, to avoid surprises. > From adinn at redhat.com Mon Aug 19 11:29:32 2019 From: adinn at redhat.com (Andrew Dinn) Date: Mon, 19 Aug 2019 12:29:32 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> Message-ID: Hi Alan, Thanks for looking at the patch again. I think I have addressed all your concerns (comments inline). Webrev and retest results at the end. On 16/08/2019 11:39, Alan Bateman wrote: > I think the main changes since I looked at it previously have been in > the tests. That's mostly it. I did also fix a problem that was breaking build of x86_32. I also ensured that MAP_SYNC maps fail as expected on that arch. > On non-Linux platforms, FileChannel.map should throw UOE when invoked > with a mode map of READ_ONLY_SYNC or READ_WRITE_SYNC so I think we need > a test for that. > > MapFail seems fragile. If you add @modules java.base/jdk.internal.misc > to the test description then it could use Unsafe::isWritebackEnabled and > I think would simplify the test and checks. It would mean it could run > on all platforms. Also "MapFail" is probably too general a name for a > test in MBB because its specific to the extended map modes, not a > general test of map failing. I renamed the test to MapSyncFail and modified it to run without restriction to a specific os or cpu. I also generalized it to run twice with a boolean arg which selects mode READ_ONLY_SYNC on the first run and READ_WRITE_SYNC on the second one. The logic of the test is now to expect 1) IOException if Unsafe.isWriteBackEnabled -> true 2) UnsupportedOperationException if Unsafe.isWriteBackEnabled -> false If the wrong exception or neither exception is thrown the test fails. Case 1 currently only applies for x86_64. Case 2 applies for all other architectures. > In passing, MappedByteBuffer load/isLoaded check the fd value before > isSync, can force() do the same? Also the @return on the private isSync > method is very wordy and I don't think needs to duplicate the method > description. Sure, I have modified force() to do that check first. Of course, that means that force(int, int) is going to repeat the same test -- it has to because it may be called direct without going via force(). However, that's not really a problem since the compiler should elide the repeated check. I also shortened the text following the @return annotation as requested. Updated webrev: http://cr.openjdk.java.net/~adinn/8224974/webrev.12 Testing: Test PmemTest: passes as expected on x86_64 (only arch for which DAX file system is available) fails to pass as expected on aarch64 and x86_32 (however, this case is covered by the next test) Test MapSyncFail: passes with expected exceptions on Linux for x86_64 (IOException), aarch64 and x86_32 (UnsupportedOperationException). not tested on other arch/OS combinations (I have no access to the necessary kit). Red Hat MW tests: All still passing successfully submit test: still in progress Is it ok to push if the submit test comes back clean? regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From martinrb at google.com Mon Aug 19 14:31:31 2019 From: martinrb at google.com (Martin Buchholz) Date: Mon, 19 Aug 2019 07:31:31 -0700 Subject: RFR: JDK-8152467: remove uses of anachronistic array declarations for method return type In-Reply-To: References: Message-ID: The Assignee field in JBS should be updated. This syntax is so weird it's probably not caught by https://errorprone.info/bugpattern/MixedArrayDimensions If not, you could try writing your own errorprone check for it. On Thu, Aug 15, 2019 at 9:47 AM Evgeny Mandrikov wrote: > Hello! > > Please review patch [1] for JDK-8152467 [2]. Also it needs a sponsor since > I have only author status in OpenJDK Census [3]. > > After this change tier1 tests pass and I don't see other occurrences to > replace in output of > ag "\)\s*\[\s*\]" src > > > With best regards, > Evgeny Mandrikov > > [1] http://cr.openjdk.java.net/~godin/8152467/webrev.00/ > [2] https://bugs.openjdk.java.net/browse/JDK-8152467 > [3] https://openjdk.java.net/census#godin > From Alan.Bateman at oracle.com Mon Aug 19 14:36:20 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 19 Aug 2019 15:36:20 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> Message-ID: On 19/08/2019 12:29, Andrew Dinn wrote: > : > I renamed the test to MapSyncFail and modified it to run without > restriction to a specific os or cpu. > > I also generalized it to run twice with a boolean arg which selects mode > READ_ONLY_SYNC on the first run and READ_WRITE_SYNC on the second one. > > The logic of the test is now to expect > > 1) IOException if Unsafe.isWriteBackEnabled -> true > 2) UnsupportedOperationException if Unsafe.isWriteBackEnabled -> false > > If the wrong exception or neither exception is thrown the test fails. > > Case 1 currently only applies for x86_64. > Case 2 applies for all other architectures. Thanks, this looks must better and avoids checking the architecture and exception messages. I think webrev.12 looks good; I don't have any other comments. -Alan From Roger.Riggs at oracle.com Mon Aug 19 15:21:03 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Mon, 19 Aug 2019 11:21:03 -0400 Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> Message-ID: Hi Mandy, On 8/16/19 8:59 PM, Mandy Chung wrote: > Hi Roger, > > Thanks for doing this.? Replacing ancient bytecode generators makes > it much easier to support new features like value types. > > The diff of ProxyGenerator is not quite right (might be due to > the rename?) as some code are unchanged but shown as modified. Since so much of the file has changed, I took the opportunity to reorder some of the methods and fields to more closely match current conventions. > > "jdk.proxy.ProxyGenerator.saveGeneratedFiles" is an existing property. > Perhaps a better name for "jdk.proxy.proxy_15" would be > "jdk.proxy.ProxyGenerator.useASM" with default true. > > Perhaps renaming ProxyGenerator_15 to LegacyProxyGenerator? Since the property and old implementation should be removed (and as soon as the risk is evaluated) it made more sense to name the implementation with the version number of the class files (JDK version 1.5) it produces. > > The combo test is great that exercises different combinations. > It validates the interfaces that the proxy class implements and > the exception types in the methods of the proxy class. > > I checked the existing test/jdk/java/lang/reflect/Proxy tests. > It looks like there is no proxy test with an invocation handler > that throws checked exceptions and also undeclared exceptions. > It'd be good if you can add that as a sanity test. This does seem to be a legacy gap in the testing. I'll write a test. Thanks, Roger > > Mandy > > On 8/16/19 12:15 PM, Roger Riggs wrote: >> Please review an enhancement to replace the java.lang.reflect.Proxy >> class file generation. >> The new generator uses ASM and generates stackmaps. The >> implementation follows >> the same structure as before but has many differences as it leverages >> ASM for generating the bytecode. >> A Combo test is included and two JMH based benchmarks. >> >> The ancient ProxyGenerator_15 implementation is temporarily retained >> to allow comparisons of generated class files and performance. >> >> Issue: >> ? https://bugs.openjdk.java.net/browse/JDK-8207814 >> >> Webrev: >> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ >> >> (Upgrading bytecode generation is necessary for Valhalla but makes >> sense for the main line.) >> >> Thanks, Roger >> > From michael.osipov at siemens.com Mon Aug 19 15:39:51 2019 From: michael.osipov at siemens.com (Osipov, Michael) Date: Mon, 19 Aug 2019 17:39:51 +0200 Subject: [Bug] zipfs unintentionally ignores umask/permissions Message-ID: Folks, please evaluate this bug. I am astounded that this hasn't been reported/fixed before. We create ZIP (zipfs provider) files with a default umask of 027. Those files are read via NFS and CIFS with Unix group permissions from other processes, may be on Windows or HP-UX (Tomcat). Consider the following code: > public class ZipTest { > > public static void main(String[] args) throws IOException { > > String zipSuffix = args[0]; > > Map env = new HashMap<>(); > env.put("create", "true"); > > Path zipPath = Paths.get("zipfs-" + zipSuffix); > > if (Files.exists(zipPath)) > Files.delete(zipPath); > > try (FileSystem fs = FileSystems > .newFileSystem(URI.create("jar:" + zipPath.toUri().toASCIIString()), env)) { > for (int i = 1; i < args.length; i++) { > Path srcPath = Paths.get(args[i]); > Path dstPath = fs.getPath(args[i]); > Files.copy(srcPath, dstPath); > } > } > > zipPath = Paths.get("zipos-" + zipSuffix); > > if (Files.exists(zipPath)) > Files.delete(zipPath); > > try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipPath))) { > for (int i = 1; i < args.length; i++) { > zos.putNextEntry(new ZipEntry(args[i])); > Files.copy(Paths.get(args[i]), zos); > zos.closeEntry(); > } > } > > } > > } Tests performed on: > $ uname -a > FreeBSD deblndw011x.ad001.siemens.net 12.0-STABLE FreeBSD 12.0-STABLE #10 r350672: Wed Aug 7 10:14:20 CEST 2019 > root at deblndw011x.ad001.siemens.net:/usr/obj/usr/src/amd64.amd64/sys/DEBLNDW011X amd64 > $ java -version > openjdk version "1.8.0_222" > OpenJDK Runtime Environment (build 1.8.0_222-b10) > OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode) and > $ uname -a > HP-UX deblndw0 B.11.31 U ia64 HP-UX > $ java -version > java version "1.8.0.17-hp-ux" > Java(TM) SE Runtime Environment (build 1.8.0.17-hp-ux-b1) > Java HotSpot(TM) Server VM (build 25.17-b1, mixed mode) and here is the faulty result on HP-UX, similar case for FreeBSD: > java -jar zip-test.jar toll.zip toll.pdf > $ ll *toll.zip > -rwx------ 1 osipovmi cad 1128 2019-08-19 17:16 zipfs-toll.zip* > -rw-r----- 1 osipovmi cad 1118 2019-08-19 17:16 zipos-toll.zip The umask is completely ignored by the zipfs provider. Running through tusc on HP-UX or truss on FreeBSD: > open("/net/home/osipovmi/zipfstmp4577367104205101212.tmp", O_WRONLY|O_CREAT|O_EXCL|0x800, 0700) = 18 > rename("/net/home/osipovmi/zipfstmp4577367104205101212.tmp", "/net/home/osipovmi/zipfs-toll.zip") = 0 FreeBSD respectively: > openat(AT_FDCWD,"/net/home/osipovmi/zipfstmp4205922272998633281.tmp",O_WRONLY|O_CREAT|O_EXCL,0600) > rename("/net/home/osipovmi/zipfstmp4205922272998633281.tmp","/net/home/osipovmi/zipfs-toll.zip") Syscall outputs are here: http://home.apache.org/~michaelo/java/zip-test.tar.gz The bug im subtile, but obviously here: https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/aa318070b27849f1fe00d14684b2a40f7b29bf79/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java#L1089-L1097 and https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/aa318070b27849f1fe00d14684b2a40f7b29bf79/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java#L1297 which is: > Files.move(tmpFile, zfpath, REPLACE_EXISTING); by using: https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/aa318070b27849f1fe00d14684b2a40f7b29bf79/jdk/src/share/classes/java/nio/file/TempFileHelper.java#L68-L74 Note that this also happens when the file is already there. The permissions are *not* retained and this causes here a lot of grief. zip(1) does not suffer from this nor does ZipOutputStream as you can see. I'd expect that reading the attributes from zfpath, moving and then settings them is a good option. Regards, Michael From alexey.semenyuk at oracle.com Mon Aug 19 16:25:12 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 19 Aug 2019 12:25:12 -0400 Subject: RFR: JDK-8215381: Investigate if current implementation of --license-file is correct for Debian packages In-Reply-To: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> References: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - change format of the default copyright file to comply with Debian packaging requirements; - install copyright file in proper location to comply with Debian packaging requirements; - introduce --linux-deb-copyright-file command line option to allow override of the default copyright file template [1] https://bugs.openjdk.java.net/browse/JDK-8215381 [2] http://cr.openjdk.java.net/~asemenyuk/8215381/webrev.00/ Thanks, Alexey From Alan.Bateman at oracle.com Mon Aug 19 16:48:46 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 19 Aug 2019 17:48:46 +0100 Subject: [Bug] zipfs unintentionally ignores umask/permissions In-Reply-To: References: Message-ID: <235c21b2-53ad-a2bd-873a-4a400ee19079@oracle.com> On 19/08/2019 16:39, Osipov, Michael wrote: > : > > Note that this also happens when the file is already there. The > permissions are *not* retained and this causes here a lot of grief. > zip(1) does not suffer from this nor does ZipOutputStream as you can see. > > I'd expect that reading the attributes from zfpath, moving and then > settings them is a good option. Thanks for the bug report, I've created JDK-8229888 [1] to track it. -Alan [1] https://bugs.openjdk.java.net/browse/JDK-8229888 From michael.osipov at siemens.com Mon Aug 19 16:53:27 2019 From: michael.osipov at siemens.com (Osipov, Michael) Date: Mon, 19 Aug 2019 18:53:27 +0200 Subject: [Bug] zipfs unintentionally ignores umask/permissions In-Reply-To: <235c21b2-53ad-a2bd-873a-4a400ee19079@oracle.com> References: <235c21b2-53ad-a2bd-873a-4a400ee19079@oracle.com> Message-ID: <07b7b582-66e0-0575-5d63-b5113ac6b47e@siemens.com> Am 2019-08-19 um 18:48 schrieb Alan Bateman: > On 19/08/2019 16:39, Osipov, Michael wrote: >> : >> >> Note that this also happens when the file is already there. The >> permissions are *not* retained and this causes here a lot of grief. >> zip(1) does not suffer from this nor does ZipOutputStream as you can see. >> >> I'd expect that reading the attributes from zfpath, moving and then >> settings them is a good option. > Thanks for the bug report, I've created JDK-8229888 [1] to track it. > > -Alan > > [1] https://bugs.openjdk.java.net/browse/JDK-8229888 Hi Alan, thanks for the JIRA issue. The title is somewhat misleading because it happens always. On create and on update due to the temp file approach. How is your backport policy? I'd expect an upcoming fix to land in Java 11 and -- especially -- Java 8. HPE will then provide an update for us on HP-UX from the OpenJDK sources. Regards, Michael From alexey.semenyuk at oracle.com Mon Aug 19 16:56:01 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 19 Aug 2019 12:56:01 -0400 Subject: RFR: JDK-8225447: Revise Debian packaging In-Reply-To: References: Message-ID: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - fix all permission related issues reported by lintian - cleanup control files to address issues reported by lintian - fix jtreg tests - change package installation directory of Debian package from /opt/ to /opt/ to make it compliant with Debian packaging requirements Errors reported by lintian on simple test package before the fix is [3] and after the fix is [4] [1] https://bugs.openjdk.java.net/browse/JDK-8225447 [2] http://cr.openjdk.java.net/~asemenyuk/8225447/webrev.00/ [3] http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.before_the_fix.txt [4] http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.after_the_fix.txt Thanks, Alexey From volker.simonis at gmail.com Mon Aug 19 17:09:37 2019 From: volker.simonis at gmail.com (Volker Simonis) Date: Mon, 19 Aug 2019 19:09:37 +0200 Subject: [Bug] zipfs unintentionally ignores umask/permissions In-Reply-To: <07b7b582-66e0-0575-5d63-b5113ac6b47e@siemens.com> References: <235c21b2-53ad-a2bd-873a-4a400ee19079@oracle.com> <07b7b582-66e0-0575-5d63-b5113ac6b47e@siemens.com> Message-ID: Hi Michael, have you had a look at the recently added enhancements for zipfs: 8213031: (zipfs) Add support for POSIX file permissions https://bugs.openjdk.java.net/browse/JDK-8213031 The corresponding CSR 8213082: (zipfs) Add support for POSIX file permissions https://bugs.openjdk.java.net/browse/JDK-8213082 is also interesting to read as it discusses some of the long-standing problems of the zipfs implementation which may be surprising for the normal user. Regards, Volker On Mon, Aug 19, 2019 at 6:53 PM Osipov, Michael wrote: > > > > Am 2019-08-19 um 18:48 schrieb Alan Bateman: > > On 19/08/2019 16:39, Osipov, Michael wrote: > >> : > >> > >> Note that this also happens when the file is already there. The > >> permissions are *not* retained and this causes here a lot of grief. > >> zip(1) does not suffer from this nor does ZipOutputStream as you can see. > >> > >> I'd expect that reading the attributes from zfpath, moving and then > >> settings them is a good option. > > Thanks for the bug report, I've created JDK-8229888 [1] to track it. > > > > -Alan > > > > [1] https://bugs.openjdk.java.net/browse/JDK-8229888 > > Hi Alan, > > thanks for the JIRA issue. The title is somewhat misleading because it > happens always. On create and on update due to the temp file approach. > > How is your backport policy? I'd expect an upcoming fix to land in Java > 11 and -- especially -- Java 8. HPE will then provide an update for us > on HP-UX from the OpenJDK sources. > > Regards, > > Michael From michael.osipov at siemens.com Mon Aug 19 17:22:56 2019 From: michael.osipov at siemens.com (Osipov, Michael) Date: Mon, 19 Aug 2019 19:22:56 +0200 Subject: [Bug] zipfs unintentionally ignores umask/permissions In-Reply-To: References: <235c21b2-53ad-a2bd-873a-4a400ee19079@oracle.com> <07b7b582-66e0-0575-5d63-b5113ac6b47e@siemens.com> Message-ID: <7a4c1752-04a7-76c5-94cf-993e9f2d3ada@siemens.com> Am 2019-08-19 um 19:09 schrieb Volker Simonis: > Hi Michael, > > have you had a look at the recently added enhancements for zipfs: > > 8213031: (zipfs) Add support for POSIX file permissions > https://bugs.openjdk.java.net/browse/JDK-8213031 > > The corresponding CSR > > 8213082: (zipfs) Add support for POSIX file permissions > https://bugs.openjdk.java.net/browse/JDK-8213082 > > is also interesting to read as it discusses some of the long-standing > problems of the zipfs implementation which may be surprising for the > normal user. Volker, I am aware of that, but that's not what I am looking for. Michael > On Mon, Aug 19, 2019 at 6:53 PM Osipov, Michael > wrote: >> >> >> >> Am 2019-08-19 um 18:48 schrieb Alan Bateman: >>> On 19/08/2019 16:39, Osipov, Michael wrote: >>>> : >>>> >>>> Note that this also happens when the file is already there. The >>>> permissions are *not* retained and this causes here a lot of grief. >>>> zip(1) does not suffer from this nor does ZipOutputStream as you can see. >>>> >>>> I'd expect that reading the attributes from zfpath, moving and then >>>> settings them is a good option. >>> Thanks for the bug report, I've created JDK-8229888 [1] to track it. >>> >>> -Alan >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8229888 >> >> Hi Alan, >> >> thanks for the JIRA issue. The title is somewhat misleading because it >> happens always. On create and on update due to the temp file approach. >> >> How is your backport policy? I'd expect an upcoming fix to land in Java >> 11 and -- especially -- Java 8. HPE will then provide an update for us >> on HP-UX from the OpenJDK sources. >> >> Regards, >> >> Michael From dmitry.chuyko at bell-sw.com Mon Aug 19 18:38:55 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Mon, 19 Aug 2019 21:38:55 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> Message-ID: Hi Andrew, Just a minor style thing in MapSyncFail test: can "true" and "false" (the mode) be "READ_WRITE_SYNC" and "READ_ONLY_SYNC" instead? -Dmitry On 8/19/19 2:29 PM, Andrew Dinn wrote: > Hi Alan, > > ................... > I renamed the test to MapSyncFail and modified it to run without > restriction to a specific os or cpu. > > I also generalized it to run twice with a boolean arg which selects mode > READ_ONLY_SYNC on the first run and READ_WRITE_SYNC on the second one. > > The logic of the test is now to expect > > 1) IOException if Unsafe.isWriteBackEnabled -> true > 2) UnsupportedOperationException if Unsafe.isWriteBackEnabled -> false > > If the wrong exception or neither exception is thrown the test fails. > > Case 1 currently only applies for x86_64. > Case 2 applies for all other architectures. > >> In passing, MappedByteBuffer load/isLoaded check the fd value before >> isSync, can force() do the same? Also the @return on the private isSync >> method is very wordy and I don't think needs to duplicate the method >> description. > Sure, I have modified force() to do that check first. > > Of course, that means that force(int, int) is going to repeat the same > test -- it has to because it may be called direct without going via force(). > > However, that's not really a problem since the compiler should elide the > repeated check. > > I also shortened the text following the @return annotation as requested. > > Updated webrev: > > http://cr.openjdk.java.net/~adinn/8224974/webrev.12 > > Testing: > > Test PmemTest: > passes as expected on x86_64 (only arch for which DAX file system is > available) > fails to pass as expected on aarch64 and x86_32 (however, this case is > covered by the next test) > > Test MapSyncFail: > passes with expected exceptions on Linux for x86_64 (IOException), > aarch64 and x86_32 (UnsupportedOperationException). > not tested on other arch/OS combinations (I have no access to the > necessary kit). > > Red Hat MW tests: > All still passing successfully > > submit test: > still in progress > > Is it ok to push if the submit test comes back clean? > > regards, > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From andy.herrick at oracle.com Mon Aug 19 18:51:09 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 14:51:09 -0400 Subject: RFR: JDK-8215381: Investigate if current implementation of --license-file is correct for Debian packages In-Reply-To: References: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Message-ID: <236ac567-3e52-6b01-1e0e-65d99f237d4a@oracle.com> looks good to me. /Andy On 8/19/19 12:25 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - change format of the default copyright file to comply with Debian > packaging requirements; > - install copyright file in proper location to comply with Debian > packaging requirements; > - introduce --linux-deb-copyright-file command line option to allow > override of the default copyright file template > > [1] https://bugs.openjdk.java.net/browse/JDK-8215381 > > [2] http://cr.openjdk.java.net/~asemenyuk/8215381/webrev.00/ > > Thanks, > Alexey > From andy.herrick at oracle.com Mon Aug 19 19:33:41 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 15:33:41 -0400 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8229795 [2] http://cr.openjdk.java.net/~herrick/8229795/ /Andy From brian.burkhalter at oracle.com Mon Aug 19 20:08:24 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 19 Aug 2019 13:08:24 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() Message-ID: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Please review a potential fix of [1]. BigInteger.toString(int radix) for instances with more than 20 ints in the magnitude array works by recursively decomposing the BigInteger into smaller BigIntegers which have no more than 20 ints in their magnitude array and then uses the internal method smallToString() to convert the smaller BigIntegers into Strings. Internally smallToString() uses a StringBuilder to concatenate component digits and then returns the String created by StringBuilder.toString(). The various strings returned by smallToString() are themselves concatenated in another StringBuilder and the value eventually returned by this StringBuilder?s toString() method is the final result. So all in at least four times the memory needed for the character content of the final result is allocated. Also at least the StringBuilder which contains the final result is likely resizing itself to ensure sufficient capacity and performing a copy each time it resizes. The proposed change [2] uses one single StringBuilder with capacity sufficient to contain the final result. The memory needed is therefore reduced to twice that needed for the character content of the final result. Also, intermediate StringBuilder self-resizings are eliminated altogether as the StringBuilder has sufficient capacity to contain the final result. This method is covered in testing by the existing stringConv() method of BigIntegerTest. Numerous other tests were also run with larger values using the same methodology: create a BigInteger x, get the result s = x.toString(radix) for each radix, create a new value BigInteger y = BigInteger(s,radix), verify that y.equals(x) is true. Thanks, Brian [1] https://bugs.openjdk.java.net/browse/JDK-8229845 [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.00/ From alexander.matveev at oracle.com Mon Aug 19 20:26:39 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Mon, 19 Aug 2019 13:26:39 -0700 Subject: RFR: JDK-8215381: Investigate if current implementation of --license-file is correct for Debian packages In-Reply-To: References: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Message-ID: <6dfece78-b37c-3a78-d4db-dbab5b6a4acb@oracle.com> Looks good. Thanks, Alexander On 8/19/2019 9:25 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - change format of the default copyright file to comply with Debian > packaging requirements; > - install copyright file in proper location to comply with Debian > packaging requirements; > - introduce --linux-deb-copyright-file command line option to allow > override of the default copyright file template > > [1] https://bugs.openjdk.java.net/browse/JDK-8215381 > > [2] http://cr.openjdk.java.net/~asemenyuk/8215381/webrev.00/ > > Thanks, > Alexey > From alexey.semenyuk at oracle.com Mon Aug 19 20:41:55 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 19 Aug 2019 16:41:55 -0400 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. In-Reply-To: References: Message-ID: Looks good. Just curious why changes in FileAssociationsBase.java files? - Alexey On 8/19/2019 3:33 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229795 > > [2] http://cr.openjdk.java.net/~herrick/8229795/ > > /Andy > > From kevin.rushforth at oracle.com Mon Aug 19 20:53:52 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Mon, 19 Aug 2019 13:53:52 -0700 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. In-Reply-To: References: Message-ID: The following will take the last in the list of extensions and use that: + entryName = ext.toUpperCase() + "File"; Also, did you mean to upper-case the extension? I note that "File" isn't upper-case, nor is the prefix when there isn't an extension. -- Kevin On 8/19/2019 12:33 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229795 > > [2] http://cr.openjdk.java.net/~herrick/8229795/ > > /Andy > > From milan.mimica at gmail.com Mon Aug 19 16:20:53 2019 From: milan.mimica at gmail.com (Milan Mimica) Date: Mon, 19 Aug 2019 18:20:53 +0200 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout Message-ID: Hello list Please find the attached patch that fixes JDK-8228580. It works the similar way UDP timeout does: calculate the initial timeout from retry attempt, and account for duration of every blocking call on the TCP socket. I am listed as Author[1] on "jdk" project. [1] https://openjdk.java.net/census#mmimica -- Milan Mimica -------------- next part -------------- A non-text attachment was scrubbed... Name: JDK-8228580.patch Type: text/x-patch Size: 5042 bytes Desc: not available URL: From andy.herrick at oracle.com Mon Aug 19 21:09:34 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 17:09:34 -0400 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. In-Reply-To: References: Message-ID: On 8/19/19 4:53 PM, Kevin Rushforth wrote: > The following will take the last in the list of extensions and use that: > > + entryName = ext.toUpperCase() + "File"; entryName is both set and used within the "for (String ext : extensions)" block. > > > Also, did you mean to upper-case the extension? I note that "File" > isn't upper-case, nor is the prefix when there isn't an extension. yes - I meant that - my example was "JNLPFile" we use as name of "jnlp" association we use in webstart. I have no example of mime-type association without any file extensions, so was just using the name as is. /Andy > > -- Kevin > > > On 8/19/2019 12:33 PM, Andy Herrick wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8229795 >> >> [2] http://cr.openjdk.java.net/~herrick/8229795/ >> >> /Andy >> >> > From andy.herrick at oracle.com Mon Aug 19 21:13:29 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 17:13:29 -0400 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. In-Reply-To: References: Message-ID: <36deac9f-e01e-9445-1969-3ec352f8275a@oracle.com> On 8/19/19 4:41 PM, Alexey Semenyuk wrote: > Looks good. > > Just curious why changes in FileAssociationsBase.java files? It doesn't really matter in a test association, but experimental mime-types (those not registered win IANA) are supposed to be of the form application/x-... /Andy > > - Alexey > > On 8/19/2019 3:33 PM, Andy Herrick wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8229795 >> >> [2] http://cr.openjdk.java.net/~herrick/8229795/ >> >> /Andy >> >> > From alexander.matveev at oracle.com Mon Aug 19 21:15:10 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Mon, 19 Aug 2019 14:15:10 -0700 Subject: RFR: JDK-8225447: Revise Debian packaging In-Reply-To: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> Message-ID: Looks good. Thanks, Alexander On 8/19/2019 9:56 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - fix all permission related issues reported by lintian > - cleanup control files to address issues reported by lintian > - fix jtreg tests > - change package installation directory of Debian package from > /opt/ to /opt/ to make it compliant with Debian > packaging requirements > > Errors reported by lintian on simple test package before the fix is > [3] and after the fix is [4] > > [1] https://bugs.openjdk.java.net/browse/JDK-8225447 > > [2] http://cr.openjdk.java.net/~asemenyuk/8225447/webrev.00/ > > [3] > http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.before_the_fix.txt > > [4] > http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.after_the_fix.txt > > Thanks, > Alexey > From kevin.rushforth at oracle.com Mon Aug 19 21:16:47 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Mon, 19 Aug 2019 14:16:47 -0700 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. In-Reply-To: References: Message-ID: OK. Looks good. -- Kevin On 8/19/2019 2:09 PM, Andy Herrick wrote: > > On 8/19/19 4:53 PM, Kevin Rushforth wrote: >> The following will take the last in the list of extensions and use that: >> >> + entryName = ext.toUpperCase() + "File"; > entryName is both set and used within the "for (String ext : > extensions)" block. >> >> >> Also, did you mean to upper-case the extension? I note that "File" >> isn't upper-case, nor is the prefix when there isn't an extension. > > yes - I meant that - my example was "JNLPFile" we use as name of > "jnlp" association we use in webstart. > > I have no example of mime-type association without any file > extensions, so was just using the name as is. > > /Andy > >> >> -- Kevin >> >> >> On 8/19/2019 12:33 PM, Andy Herrick wrote: >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8229795 >>> >>> [2] http://cr.openjdk.java.net/~herrick/8229795/ >>> >>> /Andy >>> >>> >> From forax at univ-mlv.fr Mon Aug 19 21:19:23 2019 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 19 Aug 2019 23:19:23 +0200 (CEST) Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> Message-ID: <1668546107.189546.1566249563047.JavaMail.zimbra@u-pem.fr> A follow up should to use constant dynamic (introduce in Java 11) to get the j.l.r.Method object instead of pre-calculating all of them in the static init block. The idea is that a ldc on a constant dynamic with bootstrap method that takes a MethodHandle as parameter (as boostrap argument) can return the corresponding Method by using Lookup.revealDirect + reflectAs. The bootstrap method can be added to j.l.i.ConstantBootstraps This should consume less bytecode (the MethodHandle is directly encodable as a constant pool constant) and only creates the j.l.r.Method if the interface method is actually called. R?mi ----- Mail original ----- > De: "Roger Riggs" > ?: "core-libs-dev" > Envoy?: Vendredi 16 Ao?t 2019 21:15:30 > Objet: RFR 8207814: (proxy) upgrade the proxy class generator > Please review an enhancement to replace the java.lang.reflect.Proxy > class file generation. > The new generator uses ASM and generates stackmaps. The implementation > follows > the same structure as before but has many differences as it leverages > ASM for generating the bytecode. > A Combo test is included and two JMH based benchmarks. > > The ancient ProxyGenerator_15 implementation is temporarily retained > to allow comparisons of generated class files and performance. > > Issue: > ? https://bugs.openjdk.java.net/browse/JDK-8207814 > > Webrev: > http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ > > (Upgrading bytecode generation is necessary for Valhalla but makes sense > for the main line.) > > Thanks, Roger From alexander.matveev at oracle.com Mon Aug 19 21:44:56 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Mon, 19 Aug 2019 14:44:56 -0700 Subject: RFR: JDK-8229795: Investigate registry key usage and need for --win-registry-name option. In-Reply-To: References: Message-ID: <264134ef-a396-296e-a068-4a028591f34e@oracle.com> Looks good. Thanks, Alexander On 8/19/2019 2:16 PM, Kevin Rushforth wrote: > OK. Looks good. > > -- Kevin > > > On 8/19/2019 2:09 PM, Andy Herrick wrote: >> >> On 8/19/19 4:53 PM, Kevin Rushforth wrote: >>> The following will take the last in the list of extensions and use >>> that: >>> >>> + entryName = ext.toUpperCase() + "File"; >> entryName is both set and used within the "for (String ext : >> extensions)" block. >>> >>> >>> Also, did you mean to upper-case the extension? I note that "File" >>> isn't upper-case, nor is the prefix when there isn't an extension. >> >> yes - I meant that - my example was "JNLPFile" we use as name of >> "jnlp" association we use in webstart. >> >> I have no example of mime-type association without any file >> extensions, so was just using the name as is. >> >> /Andy >> >>> >>> -- Kevin >>> >>> >>> On 8/19/2019 12:33 PM, Andy Herrick wrote: >>>> Please review the jpackage fix for bug [1] at [2]. >>>> >>>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>>> repository (jpackage). >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8229795 >>>> >>>> [2] http://cr.openjdk.java.net/~herrick/8229795/ >>>> >>>> /Andy >>>> >>>> >>> > From andy.herrick at oracle.com Mon Aug 19 21:52:56 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 17:52:56 -0400 Subject: RFR: JDK-8225447: Revise Debian packaging In-Reply-To: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> Message-ID: looks good. /Andy On 8/19/2019 12:56 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - fix all permission related issues reported by lintian > - cleanup control files to address issues reported by lintian > - fix jtreg tests > - change package installation directory of Debian package from > /opt/ to /opt/ to make it compliant with Debian > packaging requirements > > Errors reported by lintian on simple test package before the fix is > [3] and after the fix is [4] > > [1] https://bugs.openjdk.java.net/browse/JDK-8225447 > > [2] http://cr.openjdk.java.net/~asemenyuk/8225447/webrev.00/ > > [3] > http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.before_the_fix.txt > > [4] > http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.after_the_fix.txt > > Thanks, > Alexey > From kevin.rushforth at oracle.com Mon Aug 19 21:54:35 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Mon, 19 Aug 2019 14:54:35 -0700 Subject: RFR: JDK-8215381: Investigate if current implementation of --license-file is correct for Debian packages In-Reply-To: References: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> Message-ID: <6e0f1cd7-3000-0dd7-1cb0-9725cf768cfc@oracle.com> Looks good. I do have one question. I see that you changed the resource name from "resource.deb-copyright" to "resource.copyright-file". Will this property be used for the RPM copyright / license file, too? If not, would it be better to keep "deb" in the name? -- Kevin On 8/19/2019 9:25 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - change format of the default copyright file to comply with Debian > packaging requirements; > - install copyright file in proper location to comply with Debian > packaging requirements; > - introduce --linux-deb-copyright-file command line option to allow > override of the default copyright file template > > [1] https://bugs.openjdk.java.net/browse/JDK-8215381 > > [2] http://cr.openjdk.java.net/~asemenyuk/8215381/webrev.00/ > > Thanks, > Alexey > From kevin.rushforth at oracle.com Mon Aug 19 21:54:51 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Mon, 19 Aug 2019 14:54:51 -0700 Subject: RFR: JDK-8225447: Revise Debian packaging In-Reply-To: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> Message-ID: Looks good. -- Kevin On 8/19/2019 9:56 AM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - fix all permission related issues reported by lintian > - cleanup control files to address issues reported by lintian > - fix jtreg tests > - change package installation directory of Debian package from > /opt/ to /opt/ to make it compliant with Debian > packaging requirements > > Errors reported by lintian on simple test package before the fix is > [3] and after the fix is [4] > > [1] https://bugs.openjdk.java.net/browse/JDK-8225447 > > [2] http://cr.openjdk.java.net/~asemenyuk/8225447/webrev.00/ > > [3] > http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.before_the_fix.txt > > [4] > http://cr.openjdk.java.net/~asemenyuk/8225447/8225447.lintian.after_the_fix.txt > > Thanks, > Alexey > From pavel.rappo at oracle.com Mon Aug 19 22:08:08 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 19 Aug 2019 23:08:08 +0100 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout In-Reply-To: References: Message-ID: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> Thanks for doing that. I've only skimmed through the patch and I?d recommend that no matter if the changes are adequate or not there should be a test [1]: "...A unit test, written for the jtreg test harness, that validates your change. The test should fail when run against a build without the change and succeed when run against a build with the change. Unit tests aren't always practical, especially for changes such as performance improvements or fixes to bugs that are highly platform-dependent, but if practical then a unit test is required." Please consider adding it to the patch while the changes are being (preliminary) reviewed. -Pavel ------------------------------------------------------------------------------- [1] https://openjdk.java.net/contribute/ > On 19 Aug 2019, at 17:20, Milan Mimica wrote: > > Hello list > > Please find the attached patch that fixes JDK-8228580. > > It works the similar way UDP timeout does: calculate the initial > timeout from retry attempt, and account for duration of every blocking > call on the TCP socket. > > I am listed as Author[1] on "jdk" project. > > [1] https://openjdk.java.net/census#mmimica > > > -- > Milan Mimica > From mandy.chung at oracle.com Mon Aug 19 22:13:10 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 19 Aug 2019 15:13:10 -0700 Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: <1668546107.189546.1566249563047.JavaMail.zimbra@u-pem.fr> References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> <1668546107.189546.1566249563047.JavaMail.zimbra@u-pem.fr> Message-ID: This is a good idea to explore.? We should keep this patch to focus on switching ASM.I will file a JBS issue for this suggestion. Mandy On 8/19/19 2:19 PM, Remi Forax wrote: > A follow up should to use constant dynamic (introduce in Java 11) to get the j.l.r.Method object instead of pre-calculating all of them in the static init block. > The idea is that a ldc on a constant dynamic with bootstrap method that takes a MethodHandle as parameter (as boostrap argument) can return the corresponding Method by using Lookup.revealDirect + reflectAs. > The bootstrap method can be added to j.l.i.ConstantBootstraps > > This should consume less bytecode (the MethodHandle is directly encodable as a constant pool constant) and only creates the j.l.r.Method if the interface method is actually called. > > R?mi > > ----- Mail original ----- >> De: "Roger Riggs" >> ?: "core-libs-dev" >> Envoy?: Vendredi 16 Ao?t 2019 21:15:30 >> Objet: RFR 8207814: (proxy) upgrade the proxy class generator >> Please review an enhancement to replace the java.lang.reflect.Proxy >> class file generation. >> The new generator uses ASM and generates stackmaps. The implementation >> follows >> the same structure as before but has many differences as it leverages >> ASM for generating the bytecode. >> A Combo test is included and two JMH based benchmarks. >> >> The ancient ProxyGenerator_15 implementation is temporarily retained >> to allow comparisons of generated class files and performance. >> >> Issue: >> ? https://bugs.openjdk.java.net/browse/JDK-8207814 >> >> Webrev: >> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ >> >> (Upgrading bytecode generation is necessary for Valhalla but makes sense >> for the main line.) >> >> Thanks, Roger From aeubanks at google.com Mon Aug 19 23:14:23 2019 From: aeubanks at google.com (Arthur Eubanks) Date: Mon, 19 Aug 2019 16:14:23 -0700 Subject: RFR: 8229899: java.io.File.isInvalid() is racy Message-ID: Bug: https://bugs.openjdk.java.net/browse/JDK-8229899 Webrev: http://cr.openjdk.java.net/~aeubanks/8229899/webrev.00/ final boolean isInvalid() { if (status == null) { status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED : PathStatus.INVALID; } return status == PathStatus.INVALID; } If the reads to "status" are reordered and another thread writes to "status", the return value can be wrong. Reading "status" to a local variable fixes the issue. From alexander.matveev at oracle.com Mon Aug 19 23:23:03 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Mon, 19 Aug 2019 16:23:03 -0700 Subject: RFR: JDK-8229788: Error dialog displays with DLL issue when installing WinChooserTest application Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - Fixed by statically linking with runtime. [1] https://bugs.openjdk.java.net/browse/JDK-8229788 [2] http://cr.openjdk.java.net/~almatvee/8229788/webrev.00/ Thanks, Alexander From alexey.semenyuk at oracle.com Mon Aug 19 23:22:59 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 19 Aug 2019 19:22:59 -0400 Subject: RFR: JDK-8215381: Investigate if current implementation of --license-file is correct for Debian packages In-Reply-To: <6e0f1cd7-3000-0dd7-1cb0-9725cf768cfc@oracle.com> References: <3c86b6fc-6187-126b-a5df-5b00f88bf788@oracle.com> <6e0f1cd7-3000-0dd7-1cb0-9725cf768cfc@oracle.com> Message-ID: <2f257e4d-d615-9942-4285-5d97b8f8f39a@oracle.com> There is a bunch or resource names with "deb-" prefix. My assumption about this prefix was that these names are related to control files for Debian packaging, i.e. special files that go into DEBIAN directory. copyright file used to be one of them. However this was not correct. There should be no DEBIAN/copyright file at all. Instead copyright file should be installed at /usr/share/doc//copyright location. To reflect this change I removed "deb-" prefix. There is param.license-type.default resource name that is RPM specific, so I don't think there is any inconsistency. - Alexey On 8/19/2019 5:54 PM, Kevin Rushforth wrote: > Looks good. I do have one question. I see that you changed the > resource name from "resource.deb-copyright" to > "resource.copyright-file". Will this property be used for the RPM > copyright / license file, too? If not, would it be better to keep > "deb" in the name? > > -- Kevin > > > On 8/19/2019 9:25 AM, Alexey Semenyuk wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - change format of the default copyright file to comply with Debian >> packaging requirements; >> - install copyright file in proper location to comply with Debian >> packaging requirements; >> - introduce --linux-deb-copyright-file command line option to allow >> override of the default copyright file template >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8215381 >> >> [2] http://cr.openjdk.java.net/~asemenyuk/8215381/webrev.00/ >> >> Thanks, >> Alexey >> > From alexey.semenyuk at oracle.com Mon Aug 19 23:51:11 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 19 Aug 2019 19:51:11 -0400 Subject: RFR: JDK-8229788: Error dialog displays with DLL issue when installing WinChooserTest application In-Reply-To: References: Message-ID: <1d81ac43-e6a5-7d2f-9674-3efeb62e8c97@oracle.com> Looks good. BTW, we can statically link with runtime app launcher and avoid copying a bunch of MS dll-s to install bin directory. - Alexey On 8/19/2019 7:23 PM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Fixed by statically linking with runtime. > > [1] https://bugs.openjdk.java.net/browse/JDK-8229788 > > [2] http://cr.openjdk.java.net/~almatvee/8229788/webrev.00/ > > Thanks, > Alexander From andy.herrick at oracle.com Tue Aug 20 00:10:04 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 20:10:04 -0400 Subject: RFR: JDK-8229788: Error dialog displays with DLL issue when installing WinChooserTest application In-Reply-To: References: Message-ID: <866c3781-bf10-b00f-3779-b953cd882d91@oracle.com> looks good. /Andy On 8/19/2019 7:23 PM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - Fixed by statically linking with runtime. > > [1] https://bugs.openjdk.java.net/browse/JDK-8229788 > > [2] http://cr.openjdk.java.net/~almatvee/8229788/webrev.00/ > > Thanks, > Alexander From andy.herrick at oracle.com Tue Aug 20 00:17:18 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 19 Aug 2019 20:17:18 -0400 Subject: RFR: JDK-8229788: Error dialog displays with DLL issue when installing WinChooserTest application In-Reply-To: <1d81ac43-e6a5-7d2f-9674-3efeb62e8c97@oracle.com> References: <1d81ac43-e6a5-7d2f-9674-3efeb62e8c97@oracle.com> Message-ID: On 8/19/2019 7:51 PM, Alexey Semenyuk wrote: > Looks good. > > BTW, we can statically link with runtime app launcher and avoid > copying a bunch of MS dll-s to install bin directory. I'm not sure if that's true, but it would be great if it is.? The app launcher creates the virtual machine and runs the app in the launcher's process,? Wouldn't it cause a problem when the runtime and the app are dynamically linked ? /Andy > > - Alexey > > On 8/19/2019 7:23 PM, Alexander Matveev wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - Fixed by statically linking with runtime. >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8229788 >> >> [2] http://cr.openjdk.java.net/~almatvee/8229788/webrev.00/ >> >> Thanks, >> Alexander > From alexey.semenyuk at oracle.com Tue Aug 20 00:31:16 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Mon, 19 Aug 2019 20:31:16 -0400 Subject: RFR: JDK-8229788: Error dialog displays with DLL issue when installing WinChooserTest application In-Reply-To: References: <1d81ac43-e6a5-7d2f-9674-3efeb62e8c97@oracle.com> Message-ID: <7156e2bf-26ed-862a-2bb1-84c5c87387c3@oracle.com> On 8/19/2019 8:17 PM, Andy Herrick wrote: > > On 8/19/2019 7:51 PM, Alexey Semenyuk wrote: >> Looks good. >> >> BTW, we can statically link with runtime app launcher and avoid >> copying a bunch of MS dll-s to install bin directory. > > I'm not sure if that's true, but it would be great if it is.? The app > launcher creates the virtual machine and runs the app in the > launcher's process,? Wouldn't it cause a problem when the runtime and > the app are dynamically linked ? I don't think there will be any issues with this. - Alexey > > /Andy > >> >> - Alexey >> >> On 8/19/2019 7:23 PM, Alexander Matveev wrote: >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> - Fixed by statically linking with runtime. >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8229788 >>> >>> [2] http://cr.openjdk.java.net/~almatvee/8229788/webrev.00/ >>> >>> Thanks, >>> Alexander >> From mandrikov at gmail.com Tue Aug 20 00:52:10 2019 From: mandrikov at gmail.com (Evgeny Mandrikov) Date: Tue, 20 Aug 2019 02:52:10 +0200 Subject: RFR: JDK-8139820: URLClassPath.FileLoader constructor redundantly checks protocol In-Reply-To: <6bbaf3d7-be33-e629-6f47-764a24beebcd@oracle.com> References: <6bbaf3d7-be33-e629-6f47-764a24beebcd@oracle.com> Message-ID: On Mon, Aug 19, 2019 at 12:17 AM Claes Redestad wrote: > I'd add a comment that protocol is assumed to be "file", URLClassPath.FileLoader class already has a comment "from a file URL that refers to a directory", but anyway added comment for constructor. and perhaps make the constructor private (valid since JDK 11). > If I'm not mistaken, then this was valid even before Java 11 with difference that now compiler does not need to add additional synthetic constructor into bytecode thanks to nestmates in Java 11. Or do you mean that OpenJDK codebase was avoiding these synthetic constructors? By analogy for consistency also made JarLoader private. I can sponsor the change, seeing how I apperently filed and then > completely forgot about this cleanup.. :-) > Thank you for review and sponsoring! Updated patch - http://cr.openjdk.java.net/~godin/8139820/webrev.01/ tier1 tests pass on my machine. Regards, Evgeny From shade at redhat.com Tue Aug 20 07:56:41 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Tue, 20 Aug 2019 09:56:41 +0200 Subject: RFR: 8229899: java.io.File.isInvalid() is racy In-Reply-To: References: Message-ID: <61e6e14d-2ac4-35cc-f4b8-96afa11b2cd3@redhat.com> On 8/20/19 1:14 AM, Arthur Eubanks wrote: > Bug: https://bugs.openjdk.java.net/browse/JDK-8229899 > Webrev: http://cr.openjdk.java.net/~aeubanks/8229899/webrev.00/ Right, the new code turns data race benign. In older code, the first read of "status" could have returned "!null", while the second read could have returned "null", breaking the check. Dusty little corner in Java memory model, that. Looks good. -- Thanks, -Aleksey From adinn at redhat.com Tue Aug 20 08:02:14 2019 From: adinn at redhat.com (Andrew Dinn) Date: Tue, 20 Aug 2019 09:02:14 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> Message-ID: <9071c16a-6ef1-fe58-8233-764c3ab0e1f1@redhat.com> On 19/08/2019 19:38, Dmitry Chuyko wrote: > Just a minor style thing in MapSyncFail test: can "true" and "false" > (the mode) be "READ_WRITE_SYNC" and "READ_ONLY_SYNC" instead? Are you referring to the arguments passed on the command line? If so then the answer is clearly yes. However, I'm not sure why you consider this change important and/or an improvement? Do you feel that the code which processes the argument to compute the Mode setting is obscure? Or perhaps you are referring to something other than the command line arguments? I /do/ need to fix the typo in the test where is says "expected true of false as an argument" Obviously that should say "true *or* false". regards, Andrew Dinn ----------- From shade at redhat.com Tue Aug 20 08:05:44 2019 From: shade at redhat.com (Aleksey Shipilev) Date: Tue, 20 Aug 2019 10:05:44 +0200 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: On 8/19/19 10:08 PM, Brian Burkhalter wrote: > [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.00/ Two drive-by comments: *) It seems the "signum == 0" case in smallToString is regressing? Before, it just returned the constant-pooled "0", now it goes via StringBuilder; *) This might be "static final", while we are at it: 4109 private static String[] zeros = new String[64]; -- Thanks, -Aleksey From adinn at redhat.com Tue Aug 20 09:36:16 2019 From: adinn at redhat.com (Andrew Dinn) Date: Tue, 20 Aug 2019 10:36:16 +0100 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> Message-ID: On 19/08/2019 15:36, Alan Bateman wrote: > I think webrev.12 looks good; I don't have any other comments. Thanks, Alan. I just pushed the patch for the JEP implementation. (Hallelujah!). Thanks for all your help. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From Alan.Bateman at oracle.com Tue Aug 20 09:39:34 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 20 Aug 2019 10:39:34 +0100 Subject: RFR: 8229899: java.io.File.isInvalid() is racy In-Reply-To: References: Message-ID: <510b0cbf-31af-ddcf-40b1-8833eeeba07c@oracle.com> On 20/08/2019 00:14, Arthur Eubanks wrote: > Bug: https://bugs.openjdk.java.net/browse/JDK-8229899 > Webrev: http://cr.openjdk.java.net/~aeubanks/8229899/webrev.00/ > > final boolean isInvalid() { > if (status == null) { > status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED > : > PathStatus.INVALID; > } > return status == PathStatus.INVALID; > } > If the reads to "status" are reordered and another thread writes to > "status", the return value can be wrong. > Reading "status" to a local variable fixes the issue. An oversight in JDK-8003992 that we missed during the review at the time. The change looks good. -Alan. From dmitry.chuyko at bell-sw.com Tue Aug 20 11:16:18 2019 From: dmitry.chuyko at bell-sw.com (Dmitry Chuyko) Date: Tue, 20 Aug 2019 14:16:18 +0300 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: <9071c16a-6ef1-fe58-8233-764c3ab0e1f1@redhat.com> References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> <9071c16a-6ef1-fe58-8233-764c3ab0e1f1@redhat.com> Message-ID: On 8/20/19 11:02 AM, Andrew Dinn wrote: > On 19/08/2019 19:38, Dmitry Chuyko wrote: >> Just a minor style thing in MapSyncFail test: can "true" and "false" >> (the mode) be "READ_WRITE_SYNC" and "READ_ONLY_SYNC" instead? > Are you referring to the arguments passed on the command line? If so > then the answer is clearly yes. Yes, exactly that. Trivial change like a string switch wouldn't bloat the code much. Anyway, probably it was already a time to push changes :-) Latest version of MapSyncFail covers exception path then writeback is not enabled so I think we don't need additional work here either. Thanks for a good job! -Dmitry > > .......... > > regards, > > > Andrew Dinn > ----------- > From martinrb at google.com Tue Aug 20 15:20:55 2019 From: martinrb at google.com (Martin Buchholz) Date: Tue, 20 Aug 2019 08:20:55 -0700 Subject: RFR: 8229899: java.io.File.isInvalid() is racy In-Reply-To: References: Message-ID: Looks good to me. On Mon, Aug 19, 2019 at 4:15 PM Arthur Eubanks wrote: > Bug: https://bugs.openjdk.java.net/browse/JDK-8229899 > Webrev: http://cr.openjdk.java.net/~aeubanks/8229899/webrev.00/ > > final boolean isInvalid() { > if (status == null) { > status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED > : > PathStatus.INVALID; > } > return status == PathStatus.INVALID; > } > If the reads to "status" are reordered and another thread writes to > "status", the return value can be wrong. > Reading "status" to a local variable fixes the issue. > From aeubanks at google.com Tue Aug 20 15:25:51 2019 From: aeubanks at google.com (Arthur Eubanks) Date: Tue, 20 Aug 2019 08:25:51 -0700 Subject: RFR: 8229899: java.io.File.isInvalid() is racy In-Reply-To: References: Message-ID: Thanks for the reviews! On Tue, Aug 20, 2019 at 8:21 AM Martin Buchholz wrote: > Looks good to me. > > On Mon, Aug 19, 2019 at 4:15 PM Arthur Eubanks > wrote: > >> Bug: https://bugs.openjdk.java.net/browse/JDK-8229899 >> Webrev: http://cr.openjdk.java.net/~aeubanks/8229899/webrev.00/ >> >> final boolean isInvalid() { >> if (status == null) { >> status = (this.path.indexOf('\u0000') < 0) ? >> PathStatus.CHECKED >> : >> PathStatus.INVALID; >> } >> return status == PathStatus.INVALID; >> } >> If the reads to "status" are reordered and another thread writes to >> "status", the return value can be wrong. >> Reading "status" to a local variable fixes the issue. >> > From sixcorners at gmail.com Tue Aug 20 08:55:26 2019 From: sixcorners at gmail.com (Stephen Buergler) Date: Tue, 20 Aug 2019 03:55:26 -0500 Subject: flatMap still prevents short circuiting when using .iterator() In-Reply-To: References: Message-ID: Oops thanks. So I think the issue is that StreamSpliterators.java has this line bufferSink = ph.wrapSink(b::accept); that creates a Sink that never returns true in cancellationRequested() which is needed to get flatMap() to stop looping. On Thu, Aug 15, 2019 at 7:43 PM David Holmes wrote: > > Re-directing to core-libs-dev > > David > > On 15/08/2019 7:48 pm, Stephen Buergler wrote: > > Not really sure where to send this. > > flatMap was fixed so that it doesn't prevent short circuiting. > > https://bugs.openjdk.java.net/browse/JDK-8075939 > > If you replace the test cases in the ticket with versions that use > > .iterator().next() instead of .findFirst().get() then the problem > > still happens. > > I just tested this with openjdk:14 on docker hub. > > From mandy.chung at oracle.com Tue Aug 20 16:21:42 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 20 Aug 2019 09:21:42 -0700 Subject: RFR: JDK-8229871: Imporve performance of Method.copy() and leafCopy() In-Reply-To: References: Message-ID: <80be43d7-826b-355a-6b8d-bf75ce3630e7@oracle.com> Hi Ogata, The patch looks okay.? Nit: please add a space between if and (. About volatile methodAccessor field, I checked the history.? Both fieldAccessor and methodAccessor were started as volatile and the fieldAccessor declaration was updated due to JDK-5044412.?? As you observe, I think the methodAccessor field could be made non-volatile.? OTOH that might impact when it's inflated to spin bytecode for this method invocation.? I don't know how importance to keep its volatile vs non-volatile in practice without doing benchmarking/real application testing. Mandy On 8/19/19 2:51 AM, Kazunori Ogata wrote: > Hi, > > May I have review for "JDK-8229871: Imporve performance of Method.copy() > and leafCopy()"? > > Method.copy() and leafCopy() creates a copy of a Method object with > sharing MethodAccessor object. Since the methodAccessor field is a > volatile variable, copying this field needs memory fence to ensure the > field is visible to all threads on the weak memory platforms such as POWER > and ARM. > > When the methodAccessor of the root object is null (i.e., not initialized > yet), we do not need to copy the null value because this field of the > copied object has been initialized to null in the constructor. We can > reduce overhead of the memory fence only when the root's methodAccessor is > non-null. This change improved performance by 5.8% using a micro benchmark > that repeatedly invokes Class.getMethods(). > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229871 > > Webrev: http://cr.openjdk.java.net/~ogatak/8229871/webrev.00/ > > > By the way, why Method.methodAccessor is volatile, while > Field.fieldAccessor and Field.overrideFieldAccessor are not volatile? I > know the use of volatile reduces probability of creating duplicated method > accessor, but the chance still exists. I couldn't find the difference > between Method and Field classes to make Method.methodAccessor volatile. > If we can make it non-volatile, it is more preferable than a quick hack > above. > > > Regards, > Ogata > From ivan.gerasimov at oracle.com Tue Aug 20 17:28:58 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 20 Aug 2019 10:28:58 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: While we're here. On 8/20/19 1:05 AM, Aleksey Shipilev wrote: > *) This might be "static final", while we are at it: > > 4109 private static String[] zeros = new String[64]; > It may make sense to create the only string as private static final String zeros = "0".repeat(63); and then replace all sb.append(zeros[x]) with sb.append(zeros, 0, x) and sb.insert(pos, zeros[x]) with sb.insert(pos, zeros, 0, x). The difference would be in one extra bounds check, and as both append() and insert() are relatively expensive, this check would hardly be noticeable. -- With kind regards, Ivan Gerasimov From ivan.gerasimov at oracle.com Tue Aug 20 17:38:49 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 20 Aug 2019 10:38:49 -0700 Subject: RFR 8211360 : Change #if DEF to #if defined(DEF) Message-ID: <0d38c07a-e697-49c6-dfc0-938a8ffa7820@oracle.com> Hello! It's a followup for JDK-8211146. With that fix several C-preprocessor statements of form #elif __linux__ were changed to more accurate #elif defined(__linux__). grep found a few more occurrences of the same pattern, which also would better be cleaned up. BUGURL: https://bugs.openjdk.java.net/browse/JDK-8211360 WEBREV: http://cr.openjdk.java.net/~igerasim/8211360/00/webrev/ Mach5 control build/testing went fine on all platforms. Would you please help review? -- With kind regards, Ivan Gerasimov From brian.burkhalter at oracle.com Tue Aug 20 17:56:30 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 20 Aug 2019 10:56:30 -0700 Subject: RFR 8211360 : Change #if DEF to #if defined(DEF) In-Reply-To: <0d38c07a-e697-49c6-dfc0-938a8ffa7820@oracle.com> References: <0d38c07a-e697-49c6-dfc0-938a8ffa7820@oracle.com> Message-ID: <899FC93B-95C8-4E53-B1EA-E4C19EE3F58E@oracle.com> Hello Ivan, Looks fine. Brian > On Aug 20, 2019, at 10:38 AM, Ivan Gerasimov wrote: > > It's a followup for JDK-8211146. > > With that fix several C-preprocessor statements of form #elif __linux__ were changed to more accurate #elif defined(__linux__). > > grep found a few more occurrences of the same pattern, which also would better be cleaned up. > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8211360 > WEBREV: http://cr.openjdk.java.net/~igerasim/8211360/00/webrev/ > > Mach5 control build/testing went fine on all platforms. > Would you please help review? From brian.burkhalter at oracle.com Tue Aug 20 18:51:19 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 20 Aug 2019 11:51:19 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: Delta [1] and revised [2] patches: [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.00-01/ [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.01/ > On Aug 20, 2019, at 1:05 AM, Aleksey Shipilev wrote: > > On 8/19/19 10:08 PM, Brian Burkhalter wrote: >> [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.00/ > > Two drive-by comments: > > *) It seems the "signum == 0" case in smallToString is regressing? Before, it just returned the > constant-pooled "0", now it goes via StringBuilder; Yes, and I don?t see any way not to have it do so. Note that due to lines 3933-3936 in [2] this case will never be hit for values which have no more than 20 ints in their magnitude, i.e., those which do not recurse in toString(BigInteger,StringBuilder,int,int). > *) This might be "static final", while we are at it: > > 4109 private static String[] zeros = new String[64]; Above made final at L4111 in [2]. > On Aug 20, 2019, at 10:28 AM, Ivan Gerasimov wrote: > > While we're here. > > On 8/20/19 1:05 AM, Aleksey Shipilev wrote: >> *) This might be "static final", while we are at it: >> >> 4109 private static String[] zeros = new String[64]; >> > It may make sense to create the only string as > > private static final String zeros = "0".repeat(63); Changed at L4111 in [2]. > and then replace all > > sb.append(zeros[x]) with sb.append(zeros, 0, x) and L4006 in [2]. > sb.insert(pos, zeros[x]) with sb.insert(pos, zeros, 0, x). L4049 and L4054 in [2]. > The difference would be in one extra bounds check, and as both append() and insert() are relatively expensive, this check would hardly be noticeable. Thanks, Brian From Roger.Riggs at oracle.com Tue Aug 20 21:08:43 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 20 Aug 2019 17:08:43 -0400 Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> <1668546107.189546.1566249563047.JavaMail.zimbra@u-pem.fr> Message-ID: <4fcb7663-1b56-355a-e2e8-3073405feda1@oracle.com> Hi, Updated the webrev to rename the old ProxyGenerator to reflect the bytecode version (v49) and added a combo test for throwing exceptions in the handler (expected and unexpected). http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ Thanks, Roger On 8/19/19 6:13 PM, Mandy Chung wrote: > This is a good idea to explore.? We should keep this patch to focus on > switching ASM.I will file a JBS issue for this suggestion. > > Mandy > > On 8/19/19 2:19 PM, Remi Forax wrote: >> A follow up should to use constant dynamic (introduce in Java 11) to >> get the j.l.r.Method object instead of pre-calculating all of them in >> the static init block. >> The idea is that a ldc on a constant dynamic with bootstrap method >> that takes a MethodHandle as parameter (as boostrap argument) can >> return the corresponding Method by using Lookup.revealDirect + >> reflectAs. >> The bootstrap method can be added to j.l.i.ConstantBootstraps >> >> This should consume less bytecode (the MethodHandle is directly >> encodable as a constant pool constant) and only creates the >> j.l.r.Method if the interface method is actually called. >> >> R?mi >> >> ----- Mail original ----- >>> De: "Roger Riggs" >>> ?: "core-libs-dev" >>> Envoy?: Vendredi 16 Ao?t 2019 21:15:30 >>> Objet: RFR 8207814: (proxy) upgrade the proxy class generator >>> Please review an enhancement to replace the java.lang.reflect.Proxy >>> class file generation. >>> The new generator uses ASM and generates stackmaps. The implementation >>> follows >>> the same structure as before but has many differences as it leverages >>> ASM for generating the bytecode. >>> A Combo test is included and two JMH based benchmarks. >>> >>> The ancient ProxyGenerator_15 implementation is temporarily retained >>> to allow comparisons of generated class files and performance. >>> >>> Issue: >>> ?? https://bugs.openjdk.java.net/browse/JDK-8207814 >>> >>> Webrev: >>> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ >>> >>> (Upgrading bytecode generation is necessary for Valhalla but makes >>> sense >>> for the main line.) >>> >>> Thanks, Roger > From sandhya.viswanathan at intel.com Tue Aug 20 21:21:29 2019 From: sandhya.viswanathan at intel.com (Viswanathan, Sandhya) Date: Tue, 20 Aug 2019 21:21:29 +0000 Subject: RFR: 8224974: Implement JEP 352 In-Reply-To: References: <9b546ca7-b664-a681-7ee6-f074d49081b4@redhat.com> <56ae56b8-5170-cb45-17eb-d3a326f7560e@oracle.com> <31edb02d-b178-6e83-da02-f98e9d67d28e@redhat.com> <58637bf9-fb6b-fb67-01ee-1452d8b95190@oracle.com> Message-ID: <02FCFB8477C4EF43A2AD8E0C60F3DA2BB8B75E29@FMSMSX125.amr.corp.intel.com> Hi Andrew/Alan, It is wonderful to see this feature integrated. Thanks a lot for all your hard work. Best Regards, Sandhya -----Original Message----- From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On Behalf Of Andrew Dinn Sent: Tuesday, August 20, 2019 2:36 AM To: Alan Bateman Cc: Jonathan Halliday ; nio-dev at openjdk.java.net; core-libs-dev at openjdk.java.net Subject: Re: RFR: 8224974: Implement JEP 352 On 19/08/2019 15:36, Alan Bateman wrote: > I think webrev.12 looks good; I don't have any other comments. Thanks, Alan. I just pushed the patch for the JEP implementation. (Hallelujah!). Thanks for all your help. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander From ivan.gerasimov at oracle.com Tue Aug 20 21:45:53 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 20 Aug 2019 14:45:53 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> Hi Brian! Would it make sense to add an argument `digits` to smallToString (like the same named argument of toString, the minimum number of digits to pad to), so it could zero-pad the result itself? This way we could avoid inserting zeros into the middle of a StringBuilder after a call to smallToString. With kind regards, Ivan On 8/20/19 11:51 AM, Brian Burkhalter wrote: > Delta [1] and revised [2] patches: > > [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.00-01/ > [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.01/ > >> On Aug 20, 2019, at 1:05 AM, Aleksey Shipilev > > wrote: >> >> On 8/19/19 10:08 PM, Brian Burkhalter wrote: >>> [2]http://cr.openjdk.java.net/~bpb/8229845/webrev.00/ >> >> Two drive-by comments: >> >> *) It seems the "signum == 0" case in smallToString is regressing? >> Before, it just returned the >> constant-pooled "0", now it goes via StringBuilder; > > Yes, and I don?t see any way not to have it do so. Note that due to > lines 3933-3936 in [2] this case will never be hit for values which > have no more than 20 ints in their magnitude, i.e., those which do not > recurse in toString(BigInteger,StringBuilder,int,int). > >> *) This might be "static final", while we are at it: >> >> 4109 ????private static String[] zeros = new String[64]; > > Above made final at L4111 in [2]. > >> On Aug 20, 2019, at 10:28 AM, Ivan Gerasimov >> > wrote: >> >> While we're here. >> >> On 8/20/19 1:05 AM, Aleksey Shipilev wrote: >>> ?*) This might be "static final", while we are at it: >>> >>> 4109 ????private static String[] zeros = new String[64]; >>> >> It may make sense to create the only string as >> >> private static final String zeros = "0".repeat(63); > > Changed at L4111 in [2]. > >> and then replace all >> >> sb.append(zeros[x]) with sb.append(zeros, 0, x) and > > L4006 in [2]. > >> sb.insert(pos, zeros[x]) with sb.insert(pos, zeros, 0, x). > > L4049 and L4054 in [2]. > >> The difference would be in one extra bounds check, and as both >> append() and insert() are relatively expensive, this check would >> hardly be noticeable. > > Thanks, > > Brian -- With kind regards, Ivan Gerasimov From claes.redestad at oracle.com Tue Aug 20 21:56:18 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Tue, 20 Aug 2019 23:56:18 +0200 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: On 2019-08-20 10:05, Aleksey Shipilev wrote: > > *) This might be "static final", while we are at it: > > 4109 private static String[] zeros = new String[64]; Addressed by http://cr.openjdk.java.net/~redestad/8228581/open.00/ /Claes From claes.redestad at oracle.com Tue Aug 20 21:58:12 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Tue, 20 Aug 2019 23:58:12 +0200 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: On 2019-08-20 23:56, Claes Redestad wrote: > On 2019-08-20 10:05, Aleksey Shipilev wrote: >> >> ? *) This might be "static final", while we are at it: >> >> 4109???? private static String[] zeros = new String[64]; > > Addressed by http://cr.openjdk.java.net/~redestad/8228581/open.00/ Meant to link the review thread, not the webrev: http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061520.html /Claes From claes.redestad at oracle.com Tue Aug 20 21:59:17 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Tue, 20 Aug 2019 23:59:17 +0200 Subject: RFR: JDK-8139820: URLClassPath.FileLoader constructor redundantly checks protocol In-Reply-To: References: <6bbaf3d7-be33-e629-6f47-764a24beebcd@oracle.com> Message-ID: <4b5d8c04-8b5f-dd80-9c9d-3732c3e09e9f@oracle.com> On 2019-08-20 02:52, Evgeny Mandrikov wrote: > > Thank you for review and sponsoring! > Updated patch - http://cr.openjdk.java.net/~godin/8139820/webrev.01/ Ran it through the first couple of test tiers and pushed. /Claes From brian.burkhalter at oracle.com Tue Aug 20 23:30:23 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 20 Aug 2019 16:30:23 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> Message-ID: <17CC8B02-304E-4C4F-8AB8-15704C8B5A19@oracle.com> > On Aug 20, 2019, at 2:58 PM, Claes Redestad wrote: > > On 2019-08-20 23:56, Claes Redestad wrote: >> On 2019-08-20 10:05, Aleksey Shipilev wrote: >>> >>> *) This might be "static final", while we are at it: >>> >>> 4109 private static String[] zeros = new String[64]; >> Addressed by http://cr.openjdk.java.net/~redestad/8228581/open.00/ > > Meant to link the review thread, not the webrev: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061520.html Looks like we have a small collision. ;-) Thanks, Brian From brian.burkhalter at oracle.com Tue Aug 20 23:31:26 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 20 Aug 2019 16:31:26 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> Message-ID: <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> Hi Ivan, > On Aug 20, 2019, at 2:45 PM, Ivan Gerasimov wrote: > > Would it make sense to add an argument `digits` to smallToString (like the same named argument of toString, the minimum number of digits to pad to), so it could zero-pad the result itself? > > This way we could avoid inserting zeros into the middle of a StringBuilder after a call to smallToString. Indeed I do not like the zero insertion either. I?ll investigate your idea. Thanks, Brian > On 8/20/19 11:51 AM, Brian Burkhalter wrote: >> Delta [1] and revised [2] patches: >> >> [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.00-01/ >> [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.01/ From mandy.chung at oracle.com Wed Aug 21 00:42:36 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 20 Aug 2019 17:42:36 -0700 Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: <4fcb7663-1b56-355a-e2e8-3073405feda1@oracle.com> References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> <1668546107.189546.1566249563047.JavaMail.zimbra@u-pem.fr> <4fcb7663-1b56-355a-e2e8-3073405feda1@oracle.com> Message-ID: Hi Roger, The new test case looks good.? Thanks for adding that. I like the renamed ProxyGenerator_v49 better.? ProxyPerf.java needs to be updated to call the renamed class. Other than that, the patch looks good.? I'll rely on the test runs to verify this patch.? No need for a new webrev. I filed JDK-8229959 on Remi's idea on using constant dynamic. thanks Mandy On 8/20/19 2:08 PM, Roger Riggs wrote: > Hi, > > Updated the webrev to rename the old ProxyGenerator to reflect the > bytecode version (v49) > and added a combo test for throwing exceptions in the handler > (expected and unexpected). > > http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ > > Thanks, Roger > > > On 8/19/19 6:13 PM, Mandy Chung wrote: >> This is a good idea to explore.? We should keep this patch to focus >> on switching ASM.I will file a JBS issue for this suggestion. >> >> Mandy >> >> On 8/19/19 2:19 PM, Remi Forax wrote: >>> A follow up should to use constant dynamic (introduce in Java 11) to >>> get the j.l.r.Method object instead of pre-calculating all of them >>> in the static init block. >>> The idea is that a ldc on a constant dynamic with bootstrap method >>> that takes a MethodHandle as parameter (as boostrap argument) can >>> return the corresponding Method by using Lookup.revealDirect + >>> reflectAs. >>> The bootstrap method can be added to j.l.i.ConstantBootstraps >>> >>> This should consume less bytecode (the MethodHandle is directly >>> encodable as a constant pool constant) and only creates the >>> j.l.r.Method if the interface method is actually called. >>> >>> R?mi >>> >>> ----- Mail original ----- >>>> De: "Roger Riggs" >>>> ?: "core-libs-dev" >>>> Envoy?: Vendredi 16 Ao?t 2019 21:15:30 >>>> Objet: RFR 8207814: (proxy) upgrade the proxy class generator >>>> Please review an enhancement to replace the java.lang.reflect.Proxy >>>> class file generation. >>>> The new generator uses ASM and generates stackmaps. The implementation >>>> follows >>>> the same structure as before but has many differences as it leverages >>>> ASM for generating the bytecode. >>>> A Combo test is included and two JMH based benchmarks. >>>> >>>> The ancient ProxyGenerator_15 implementation is temporarily retained >>>> to allow comparisons of generated class files and performance. >>>> >>>> Issue: >>>> https://bugs.openjdk.java.net/browse/JDK-8207814 >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ >>>> >>>> (Upgrading bytecode generation is necessary for Valhalla but makes >>>> sense >>>> for the main line.) >>>> >>>> Thanks, Roger >> > From letuyang at amazon.com Wed Aug 21 05:18:41 2019 From: letuyang at amazon.com (Yang, Letu) Date: Wed, 21 Aug 2019 05:18:41 +0000 Subject: RFR 8229958: Provider.getService() scalability issue for legacy algorithms and message digests Message-ID: Hi, Please review the fix of https://bugs.openjdk.java.net/browse/JDK-8229958 where I made the change to allow majority of calls don't have to acquire the locks when checking the availability of the Provider object. Similar effort had been made in fixing https://bugs.openjdk.java.net/browse/JDK-7092821 , but it only helped the calls for new encryption algorithms. Xin had helped me to upload the CR: https://cr.openjdk.java.net/~xliu/8229958/webrev/ . I had run tier-1 tests, and also a JMH test to confirm its performance improvement. We have also had it running in a load test environment of an application for a couple of days, and the improvement was confirmed as well. Best regards, Letu From nick.gasson at arm.com Wed Aug 21 06:55:50 2019 From: nick.gasson at arm.com (Nick Gasson) Date: Wed, 21 Aug 2019 14:55:50 +0800 Subject: RFR(XS): 8229912: [TESTBUG] java/net/Socks/SocksIPv6Test fails without IPv6 Message-ID: Hi, Bug: https://bugs.openjdk.java.net/browse/JDK-8229912 Webrev: http://cr.openjdk.java.net/~ngasson/8229912/webrev.0/ This test should be skipped if IPv6 is disabled on the host, and it already has a shouldRun field to support this. But at the moment the the setUp() method will throw inside HttpServer.create() when it's passed an IPv6 address on a system with IPv6 disabled. Fix is to check shouldRun in setUp and return immediately if it's false. Thanks, Nick From ivan.gerasimov at oracle.com Wed Aug 21 07:07:22 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 21 Aug 2019 00:07:22 -0700 Subject: RFR 8229958: Provider.getService() scalability issue for legacy algorithms and message digests In-Reply-To: References: Message-ID: Hi Letu! The fix introduces a read of non-volatile variable legacyChanged outside of synchronized block, which is not guaranteed to produce consistent results. (Please note that in the mentioned fix for JDK-7092821 the variable servicesChanged was made volatile, so that it could be accessed outside the synchronized blocks.) With kind regards, Ivan On 8/20/19 10:18 PM, Yang, Letu wrote: > Hi, > > Please review the fix of https://bugs.openjdk.java.net/browse/JDK-8229958 where I made the change to allow majority of calls don't have to acquire the locks when checking the availability of the Provider object. Similar effort had been made in fixing https://bugs.openjdk.java.net/browse/JDK-7092821 , but it only helped the calls for new encryption algorithms. Xin had helped me to upload the CR: https://cr.openjdk.java.net/~xliu/8229958/webrev/ . > > I had run tier-1 tests, and also a JMH test to confirm its performance improvement. We have also had it running in a load test environment of an application for a couple of days, and the improvement was confirmed as well. > > Best regards, > Letu > -- With kind regards, Ivan Gerasimov From Alan.Bateman at oracle.com Wed Aug 21 07:08:31 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 21 Aug 2019 08:08:31 +0100 Subject: RFR(XS): 8229912: [TESTBUG] java/net/Socks/SocksIPv6Test fails without IPv6 In-Reply-To: References: Message-ID: <707f39fb-dc35-b9fa-7a95-9e40d62845ee@oracle.com> On 21/08/2019 07:55, Nick Gasson wrote: > Hi, > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229912 > Webrev: http://cr.openjdk.java.net/~ngasson/8229912/webrev.0/ > > This test should be skipped if IPv6 is disabled on the host, and it > already has a shouldRun field to support this. But at the moment the > the setUp() method will throw inside HttpServer.create() when it's > passed an IPv6 address on a system with IPv6 disabled. Fix is to check > shouldRun in setUp and return immediately if it's false. net-dev is the mailing list for the networking tests. There is a lot of recent activity there to allow the tests work in IPv6-only environments so fixing them to work in IPv4-only environments would be good too. For this test then I assume that the @BeforeClass setup method can throw SkipException and thus eliminate the need for each test to check "shouldRun" (shouldRun could go away). -Alan From letuyang at amazon.com Wed Aug 21 07:32:41 2019 From: letuyang at amazon.com (Yang, Letu) Date: Wed, 21 Aug 2019 07:32:41 +0000 Subject: RFR 8229958: Provider.getService() scalability issue for legacy algorithms and message digests In-Reply-To: References: Message-ID: Hi Ivan, You are right! I should make legacyChanged volatile as well. I will get it tested it with tier-1 and get back to you tomorrow. Letu ?On 8/21/19, 12:08 AM, "Ivan Gerasimov" wrote: Hi Letu! The fix introduces a read of non-volatile variable legacyChanged outside of synchronized block, which is not guaranteed to produce consistent results. (Please note that in the mentioned fix for JDK-7092821 the variable servicesChanged was made volatile, so that it could be accessed outside the synchronized blocks.) With kind regards, Ivan On 8/20/19 10:18 PM, Yang, Letu wrote: > Hi, > > Please review the fix of https://bugs.openjdk.java.net/browse/JDK-8229958 where I made the change to allow majority of calls don't have to acquire the locks when checking the availability of the Provider object. Similar effort had been made in fixing https://bugs.openjdk.java.net/browse/JDK-7092821 , but it only helped the calls for new encryption algorithms. Xin had helped me to upload the CR: https://cr.openjdk.java.net/~xliu/8229958/webrev/ . > > I had run tier-1 tests, and also a JMH test to confirm its performance improvement. We have also had it running in a load test environment of an application for a couple of days, and the improvement was confirmed as well. > > Best regards, > Letu > -- With kind regards, Ivan Gerasimov From Alan.Bateman at oracle.com Wed Aug 21 07:38:56 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 21 Aug 2019 08:38:56 +0100 Subject: RFR 8229958: Provider.getService() scalability issue for legacy algorithms and message digests In-Reply-To: References: Message-ID: <8357a658-5690-a46a-808c-f3b43234d7ba@oracle.com> On 21/08/2019 08:32, Yang, Letu wrote: > Hi Ivan, > > You are right! I should make legacyChanged volatile as well. I will get it tested it with tier-1 and get back to you tomorrow. > > Letu > > Probably best to being the discussion and the next version to security-dev as that is where the JCA code is maintained. There have also been several recent discussions and patches related to synchronization issues and performance in this code. -Alan From daniel.fuchs at oracle.com Wed Aug 21 09:05:21 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 21 Aug 2019 10:05:21 +0100 Subject: RFR(XS): 8229912: [TESTBUG] java/net/Socks/SocksIPv6Test fails without IPv6 In-Reply-To: References: Message-ID: Hi Nick, Thanks for finding this issue and proposing a fix. I agree with Alan that throwing SkipException would be a better choice, we have started using that more frequently recently. In addition jdk.test.lib.NetworkConfiguration [1] provides a static printSystemConfiguration method that could be used to print the interface configurations before throwing the exception (you would have to add `* @library /test/lib` to the test headers to be able to use it). best regards, -- daniel [1] http://hg.openjdk.java.net/jdk/jdk/file/tip/test/lib/jdk/test/lib/NetworkConfiguration.java#l383 On 21/08/2019 07:55, Nick Gasson wrote: > Hi, > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229912 > Webrev: http://cr.openjdk.java.net/~ngasson/8229912/webrev.0/ > > This test should be skipped if IPv6 is disabled on the host, and it > already has a shouldRun field to support this. But at the moment the > the setUp() method will throw inside HttpServer.create() when it's > passed an IPv6 address on a system with IPv6 disabled. Fix is to check > shouldRun in setUp and return immediately if it's false. > > Thanks, > Nick From OGATAK at jp.ibm.com Wed Aug 21 11:02:40 2019 From: OGATAK at jp.ibm.com (Kazunori Ogata) Date: Wed, 21 Aug 2019 20:02:40 +0900 Subject: RFR: JDK-8229871: Improve performance of Method.copy() and leafCopy() In-Reply-To: <80be43d7-826b-355a-6b8d-bf75ce3630e7@oracle.com> References: <80be43d7-826b-355a-6b8d-bf75ce3630e7@oracle.com> Message-ID: Hi Mandy, Thank you for reviewing the webrev. I updated it to add a space after "if" and also put four spaces for indentation (it was three). http://cr.openjdk.java.net/~ogatak/8229871/webrev.01/ Thank you so much for checking the history of fieldAccessor. I was surprised that fieldAccessor was made non-volatile in JDK5, but methodAccessor was left as volatile for 15 years after that... I agree we need benchmark data. My simple micro benchmark that repeats invoking Class.getMethods() improved performance by 70% when it made non-volatile (as shown in the following webrev). I'll try to run larger benchmarks, such as SPECjbb2015, to see real impact. http://cr.openjdk.java.net/~ogatak/8229871/webrev.02/ Regards, Ogata Mandy Chung wrote on 2019/08/21 01:21:42: > From: Mandy Chung > To: Kazunori Ogata > Cc: core-libs-dev at openjdk.java.net > Date: 2019/08/21 01:21 > Subject: [EXTERNAL] Re: RFR: JDK-8229871: Imporve performance of > Method.copy() and leafCopy() > > Hi Ogata, > > The patch looks okay. Nit: please add a space between if and (. > > About volatile methodAccessor field, I checked the history. Both > fieldAccessor and methodAccessor were started as volatile and the > fieldAccessor declaration was updated due to JDK-5044412. As you > observe, I think the methodAccessor field could be made non-volatile. > OTOH that might impact when it's inflated to spin bytecode for this > method invocation. I don't know how importance to keep its volatile vs > non-volatile in practice without doing benchmarking/real application > testing. > > Mandy > > On 8/19/19 2:51 AM, Kazunori Ogata wrote: > > Hi, > > > > May I have review for "JDK-8229871: Imporve performance of Method.copy() > > and leafCopy()"? > > > > Method.copy() and leafCopy() creates a copy of a Method object with > > sharing MethodAccessor object. Since the methodAccessor field is a > > volatile variable, copying this field needs memory fence to ensure the > > field is visible to all threads on the weak memory platforms such as POWER > > and ARM. > > > > When the methodAccessor of the root object is null (i.e., not initialized > > yet), we do not need to copy the null value because this field of the > > copied object has been initialized to null in the constructor. We can > > reduce overhead of the memory fence only when the root's methodAccessor is > > non-null. This change improved performance by 5.8% using a micro benchmark > > that repeatedly invokes Class.getMethods(). > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229871 > > > > Webrev: http://cr.openjdk.java.net/~ogatak/8229871/webrev.00/ > > > > > > By the way, why Method.methodAccessor is volatile, while > > Field.fieldAccessor and Field.overrideFieldAccessor are not volatile? I > > know the use of volatile reduces probability of creating duplicated method > > accessor, but the chance still exists. I couldn't find the difference > > between Method and Field classes to make Method.methodAccessor volatile. > > If we can make it non-volatile, it is more preferable than a quick hack > > above. > > > > > > Regards, > > Ogata > > > > From julia.boes at oracle.com Wed Aug 21 13:29:05 2019 From: julia.boes at oracle.com (Julia Boes) Date: Wed, 21 Aug 2019 14:29:05 +0100 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> Message-ID: <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> Hi all, Thanks for the review. I incorporated the following changes: - added "@since 14" tag - removed test code from the CSR specification - minor fixes in StrictMath.java, ExactArithTests.java as per Ivan's comments. The related fix in Math.java is included in this CSR: https://bugs.openjdk.java.net/browse/JDK-8229473 Updated webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.02/index.html Regards, Julia On 14/08/2019 20:45, Joe Wang wrote: > Hi Daniel, > > That makes sense. So it meant to say "converts the long to int only if > it's within the range of an integer" (to be "exact"). It may then add > "throws an exception if not". But the original is fine, just my 2 cents. > > Best, > Joe > > On 8/14/19 12:21 PM, Daniel Fuchs wrote: >> Hi Joe, >> >> On 14/08/2019 20:15, Joe Wang wrote: >>> The 2nd part is not necessary as that's what the "@throws" tag is for. >> >> Not withstanding the fact that this is a copy of the API doc from >> java.lang.Math, I'd argue that the second part is quite important. >> It's why the method is called exact, and is probably the only >> reason why you would call that method in the first place. >> So I think the 2nd part must be in the synopsis too. >> >> best regards, >> >> -- daniel >> >> On 8/14/19 9:01 AM, Julia Boes wrote: >> > >> > Hi, >> > >> > This fix adds decrementExact(), incrementExact(), and negateExact() >> to java.lang.StrictMath. The methods were added to java.lang.Math >> previously [1] and should have been added to java.lang.StrictMath for >> consistency. >> > >> > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >> > >> > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >> > >> > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >> > >> > Thanks, >> > >> > Julia >> > >> > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 > From Roger.Riggs at oracle.com Wed Aug 21 15:49:59 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 21 Aug 2019 11:49:59 -0400 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> Message-ID: <90c46082-45a7-4a0a-058a-b5ee00089342@oracle.com> Hi Julia, Looks good. Thanks, Roger On 8/21/19 9:29 AM, Julia Boes wrote: > Hi all, > > Thanks for the review. I incorporated the following changes: > > - added "@since 14" tag > > - removed test code from the CSR specification > > - minor fixes in StrictMath.java, ExactArithTests.java as per Ivan's > comments. The related fix in Math.java is included in this CSR: > https://bugs.openjdk.java.net/browse/JDK-8229473 > > Updated webrev: > http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.02/index.html > > Regards, > > Julia > > On 14/08/2019 20:45, Joe Wang wrote: >> Hi Daniel, >> >> That makes sense. So it meant to say "converts the long to int only >> if it's within the range of an integer" (to be "exact"). It may then >> add "throws an exception if not". But the original is fine, just my 2 >> cents. >> >> Best, >> Joe >> >> On 8/14/19 12:21 PM, Daniel Fuchs wrote: >>> Hi Joe, >>> >>> On 14/08/2019 20:15, Joe Wang wrote: >>>> The 2nd part is not necessary as that's what the "@throws" tag is for. >>> >>> Not withstanding the fact that this is a copy of the API doc from >>> java.lang.Math, I'd argue that the second part is quite important. >>> It's why the method is called exact, and is probably the only >>> reason why you would call that method in the first place. >>> So I think the 2nd part must be in the synopsis too. >>> >>> best regards, >>> >>> -- daniel >>> >>> On 8/14/19 9:01 AM, Julia Boes wrote: >>> > >>> > Hi, >>> > >>> > This fix adds decrementExact(), incrementExact(), and >>> negateExact() to java.lang.StrictMath. The methods were added to >>> java.lang.Math previously [1] and should have been added to >>> java.lang.StrictMath for consistency. >>> > >>> > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >>> > >>> > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >>> > >>> > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >>> > >>> > Thanks, >>> > >>> > Julia >>> > >>> > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >> From brian.burkhalter at oracle.com Wed Aug 21 16:04:15 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 21 Aug 2019 09:04:15 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <90c46082-45a7-4a0a-058a-b5ee00089342@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> <90c46082-45a7-4a0a-058a-b5ee00089342@oracle.com> Message-ID: Hi Julia, +1 Brian > On Aug 21, 2019, at 8:49 AM, Roger Riggs wrote: > > Hi Julia, > > Looks good. > > Thanks, Roger > > On 8/21/19 9:29 AM, Julia Boes wrote: >> Hi all, >> >> Thanks for the review. I incorporated the following changes: >> >> - added "@since 14" tag >> >> - removed test code from the CSR specification >> >> - minor fixes in StrictMath.java, ExactArithTests.java as per Ivan's comments. The related fix in Math.java is included in this CSR: https://bugs.openjdk.java.net/browse/JDK-8229473 >> >> Updated webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.02/index.html >> >> Regards, >> >> Julia >> >> On 14/08/2019 20:45, Joe Wang wrote: >>> Hi Daniel, >>> >>> That makes sense. So it meant to say "converts the long to int only if it's within the range of an integer" (to be "exact"). It may then add "throws an exception if not". But the original is fine, just my 2 cents. >>> >>> Best, >>> Joe >>> >>> On 8/14/19 12:21 PM, Daniel Fuchs wrote: >>>> Hi Joe, >>>> >>>> On 14/08/2019 20:15, Joe Wang wrote: >>>>> The 2nd part is not necessary as that's what the "@throws" tag is for. >>>> >>>> Not withstanding the fact that this is a copy of the API doc from >>>> java.lang.Math, I'd argue that the second part is quite important. >>>> It's why the method is called exact, and is probably the only >>>> reason why you would call that method in the first place. >>>> So I think the 2nd part must be in the synopsis too. >>>> >>>> best regards, >>>> >>>> -- daniel >>>> >>>> On 8/14/19 9:01 AM, Julia Boes wrote: >>>> > >>>> > Hi, >>>> > >>>> > This fix adds decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath. The methods were added to java.lang.Math previously [1] and should have been added to java.lang.StrictMath for consistency. >>>> > >>>> > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >>>> > >>>> > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >>>> > >>>> > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >>>> > >>>> > Thanks, >>>> > >>>> > Julia >>>> > >>>> > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >>> > From milan.mimica at gmail.com Wed Aug 21 08:27:54 2019 From: milan.mimica at gmail.com (Milan Mimica) Date: Wed, 21 Aug 2019 10:27:54 +0200 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout In-Reply-To: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> References: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> Message-ID: Hi Pavel Updated the patch with the jtreg test. The test hangs when the fix is not applied. I don't know why main/timeout=20 does not work for me. On Tue, 20 Aug 2019 at 00:08, Pavel Rappo wrote: > > Thanks for doing that. I've only skimmed through the patch and I?d recommend that no matter if the changes are adequate or not there should be a test [1]: > > "...A unit test, written for the jtreg test harness, that validates your change. The test should fail when run against a build without the change and succeed when run against a build with the change. Unit tests aren't always practical, especially for changes such as performance improvements or fixes to bugs that are highly platform-dependent, but if practical then a unit test is required." > > Please consider adding it to the patch while the changes are being (preliminary) reviewed. > > -Pavel > > ------------------------------------------------------------------------------- > [1] https://openjdk.java.net/contribute/ > > > On 19 Aug 2019, at 17:20, Milan Mimica wrote: > > > > Hello list > > > > Please find the attached patch that fixes JDK-8228580. > > > > It works the similar way UDP timeout does: calculate the initial > > timeout from retry attempt, and account for duration of every blocking > > call on the TCP socket. > > > > I am listed as Author[1] on "jdk" project. > > > > [1] https://openjdk.java.net/census#mmimica > > > > > > -- > > Milan Mimica > > > -- Milan Mimica -------------- next part -------------- A non-text attachment was scrubbed... Name: JDK-8228580.patch Type: text/x-patch Size: 9222 bytes Desc: not available URL: From Roger.Riggs at oracle.com Wed Aug 21 18:44:22 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 21 Aug 2019 14:44:22 -0400 Subject: flatMap still prevents short circuiting when using .iterator() In-Reply-To: References: Message-ID: Created an issue to track this: JDK-8229983 flatMap still prevents short circuiting when using .iterator() Regards, Roger On 8/20/19 4:55 AM, Stephen Buergler wrote: > Oops thanks. > So I think the issue is that StreamSpliterators.java has this line > bufferSink = ph.wrapSink(b::accept); > that creates a Sink that never returns true in cancellationRequested() > which is needed to get flatMap() to stop looping. > > On Thu, Aug 15, 2019 at 7:43 PM David Holmes wrote: >> Re-directing to core-libs-dev >> >> David >> >> On 15/08/2019 7:48 pm, Stephen Buergler wrote: >>> Not really sure where to send this. >>> flatMap was fixed so that it doesn't prevent short circuiting. >>> https://bugs.openjdk.java.net/browse/JDK-8075939 >>> If you replace the test cases in the ticket with versions that use >>> .iterator().next() instead of .findFirst().get() then the problem >>> still happens. >>> I just tested this with openjdk:14 on docker hub. >>> From ivan.gerasimov at ORACLE.COM Wed Aug 21 19:33:46 2019 From: ivan.gerasimov at ORACLE.COM (Ivan Gerasimov) Date: Wed, 21 Aug 2019 12:33:46 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> Message-ID: <9bd23f6b-d084-c4ef-54fa-937e6c6b231d@oracle.com> Hi Julia! This looks good to me. For all the other methods from StrictMath that have a corresponding method in Math there is a link in javadoc `@see Math#xxx`. I think, it makes sense to provide such links for all new methods for consistency. With kind regards, Ivan On 8/21/19 6:29 AM, Julia Boes wrote: > Hi all, > > Thanks for the review. I incorporated the following changes: > > - added "@since 14" tag > > - removed test code from the CSR specification > > - minor fixes in StrictMath.java, ExactArithTests.java as per Ivan's > comments. The related fix in Math.java is included in this CSR: > https://bugs.openjdk.java.net/browse/JDK-8229473 > > Updated webrev: > http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.02/index.html > > Regards, > > Julia > > On 14/08/2019 20:45, Joe Wang wrote: >> Hi Daniel, >> >> That makes sense. So it meant to say "converts the long to int only >> if it's within the range of an integer" (to be "exact"). It may then >> add "throws an exception if not". But the original is fine, just my 2 >> cents. >> >> Best, >> Joe >> >> On 8/14/19 12:21 PM, Daniel Fuchs wrote: >>> Hi Joe, >>> >>> On 14/08/2019 20:15, Joe Wang wrote: >>>> The 2nd part is not necessary as that's what the "@throws" tag is for. >>> >>> Not withstanding the fact that this is a copy of the API doc from >>> java.lang.Math, I'd argue that the second part is quite important. >>> It's why the method is called exact, and is probably the only >>> reason why you would call that method in the first place. >>> So I think the 2nd part must be in the synopsis too. >>> >>> best regards, >>> >>> -- daniel >>> >>> On 8/14/19 9:01 AM, Julia Boes wrote: >>> > >>> > Hi, >>> > >>> > This fix adds decrementExact(), incrementExact(), and >>> negateExact() to java.lang.StrictMath. The methods were added to >>> java.lang.Math previously [1] and should have been added to >>> java.lang.StrictMath for consistency. >>> > >>> > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >>> > >>> > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >>> > >>> > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >>> > >>> > Thanks, >>> > >>> > Julia >>> > >>> > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >> > -- With kind regards, Ivan Gerasimov From Roger.Riggs at oracle.com Wed Aug 21 20:37:41 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 21 Aug 2019 16:37:41 -0400 Subject: RFR 8207814: (proxy) upgrade the proxy class generator In-Reply-To: References: <4926ae56-e670-26b0-d469-8d8c55c056dc@oracle.com> <1668546107.189546.1566249563047.JavaMail.zimbra@u-pem.fr> <4fcb7663-1b56-355a-e2e8-3073405feda1@oracle.com> Message-ID: Hi Mandy, I updated the ProxyPerf and included numbers from recent runs and will push the changeset. http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ Thanks, Roger On 8/20/19 8:42 PM, Mandy Chung wrote: > Hi Roger, > > The new test case looks good.? Thanks for adding that. > > I like the renamed ProxyGenerator_v49 better.? ProxyPerf.java needs to > be updated to call the renamed class. > > Other than that, the patch looks good.? I'll rely on the test runs to > verify this patch.? No need for a new webrev. > > I filed JDK-8229959 on Remi's idea on using constant dynamic. > > thanks > Mandy > > On 8/20/19 2:08 PM, Roger Riggs wrote: >> Hi, >> >> Updated the webrev to rename the old ProxyGenerator to reflect the >> bytecode version (v49) >> and added a combo test for throwing exceptions in the handler >> (expected and unexpected). >> >> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ >> >> Thanks, Roger >> >> >> On 8/19/19 6:13 PM, Mandy Chung wrote: >>> This is a good idea to explore.? We should keep this patch to focus >>> on switching ASM.I will file a JBS issue for this suggestion. >>> >>> Mandy >>> >>> On 8/19/19 2:19 PM, Remi Forax wrote: >>>> A follow up should to use constant dynamic (introduce in Java 11) >>>> to get the j.l.r.Method object instead of pre-calculating all of >>>> them in the static init block. >>>> The idea is that a ldc on a constant dynamic with bootstrap method >>>> that takes a MethodHandle as parameter (as boostrap argument) can >>>> return the corresponding Method by using Lookup.revealDirect + >>>> reflectAs. >>>> The bootstrap method can be added to j.l.i.ConstantBootstraps >>>> >>>> This should consume less bytecode (the MethodHandle is directly >>>> encodable as a constant pool constant) and only creates the >>>> j.l.r.Method if the interface method is actually called. >>>> >>>> R?mi >>>> >>>> ----- Mail original ----- >>>>> De: "Roger Riggs" >>>>> ?: "core-libs-dev" >>>>> Envoy?: Vendredi 16 Ao?t 2019 21:15:30 >>>>> Objet: RFR 8207814: (proxy) upgrade the proxy class generator >>>>> Please review an enhancement to replace the java.lang.reflect.Proxy >>>>> class file generation. >>>>> The new generator uses ASM and generates stackmaps. The >>>>> implementation >>>>> follows >>>>> the same structure as before but has many differences as it leverages >>>>> ASM for generating the bytecode. >>>>> A Combo test is included and two JMH based benchmarks. >>>>> >>>>> The ancient ProxyGenerator_15 implementation is temporarily retained >>>>> to allow comparisons of generated class files and performance. >>>>> >>>>> Issue: >>>>> https://bugs.openjdk.java.net/browse/JDK-8207814 >>>>> >>>>> Webrev: >>>>> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/ >>>>> >>>>> (Upgrading bytecode generation is necessary for Valhalla but makes >>>>> sense >>>>> for the main line.) >>>>> >>>>> Thanks, Roger >>> >> > From andy.herrick at oracle.com Wed Aug 21 22:27:19 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Wed, 21 Aug 2019 18:27:19 -0400 Subject: jdk-14-jpackage+1-33 on jdk.java.net Message-ID: The next EA build of JPackage is available at https://jdk.java.net/jpackage/ This build ( jdk-14-jpackage+1-33 ) (2019/8/20) is the next early access release based on JDK-14 This release contains fixes to the following issues: JDK-8229788???? Error dialog displays with DLL issue when installing WinChooserTest application JDK-8225447???? Revise Debian packaging JDK-8213941???? Debian linux problems in JavaPackager JDK-8229334???? jpackage .exe packages cannot be executed due to missing DLL JDK-8227058???? Regressions related to no longer setting user.dir JDK-8226599???? use code coverage results to remove dead code JDK-8226191???? jpackager --license-file option broken on windows for jdk installers. JDK-8215381???? Investigate if current implementation of --license-file is correct for Debian packages JDK-8229138???? Add --linux-app-release option for DEB and RPM packages JDK-8229791???? Code clean up regressions JDK-8229786???? No output after WinShortcutTest.exe is launched JDK-8229750???? Fix bad merge of JDK-8215447 patch JDK-8215446???? JPackageCreateInstallerInstallDirTest fails on OLE7 JDK-8215447???? Investigate if current implementation of --license-file is correct for RPM packages JDK-8227172???? revert JDK-8225569 on windows JDK-8224788???? jpackage fails on OS X when using --runtime-image JDK-8229252???? Add descriptions to Windows jtreg tests JDK-8228744???? file associations broken on linux. JDK-8227312???? Remove pkg bundle from DMG image. JDK-8228722???? jpackage RPM tests fail on some versions of rpmbuild JDK-8222778???? Packaging Tool (JEP 343) on Linux/AArch64 JDK-8224627???? Creating installer with --runtime-image on OS X fails JDK-8226904???? current working directory wrong running jpackage app JDK-8224486???? Arguments from jpackager cfg file not processed correctly JDK-8226835???? Command window pops up building exe package JDK-8225092???? Several jpackage tests failed when run with jcov enabled /Andy From kevin.rushforth at oracle.com Thu Aug 22 00:02:54 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Wed, 21 Aug 2019 17:02:54 -0700 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: References: Message-ID: <3d92d996-eca0-7971-0716-42b885525295@oracle.com> We believe that we have addressed most of the issues, especially those affecting the generated Linux packages, both .deb and .rpm. There is one open issue around the naming of the Debian packages that we will address in the next EA release. See JDK-8228660 [1] for more information. We would love to get some feedback from Linux developers to make sure that we didn't miss anything else. Thanks. -- Kevin [1] https://bugs.openjdk.java.net/browse/JDK-8228660 On 8/21/2019 3:27 PM, Andy Herrick wrote: > The next EA build of JPackage is available at > https://jdk.java.net/jpackage/ > > This build ( jdk-14-jpackage+1-33 ) (2019/8/20) is the next early > access release based on JDK-14 > > This release contains fixes to the following issues: > > JDK-8229788???? Error dialog displays with DLL issue when installing > WinChooserTest application > JDK-8225447???? Revise Debian packaging > JDK-8213941???? Debian linux problems in JavaPackager > JDK-8229334???? jpackage .exe packages cannot be executed due to > missing DLL > JDK-8227058???? Regressions related to no longer setting user.dir > JDK-8226599???? use code coverage results to remove dead code > JDK-8226191???? jpackager --license-file option broken on windows for > jdk installers. > JDK-8215381???? Investigate if current implementation of > --license-file is correct for Debian packages > JDK-8229138???? Add --linux-app-release option for DEB and RPM packages > JDK-8229791???? Code clean up regressions > JDK-8229786???? No output after WinShortcutTest.exe is launched > JDK-8229750???? Fix bad merge of JDK-8215447 patch > JDK-8215446???? JPackageCreateInstallerInstallDirTest fails on OLE7 > JDK-8215447???? Investigate if current implementation of > --license-file is correct for RPM packages > JDK-8227172???? revert JDK-8225569 on windows > JDK-8224788???? jpackage fails on OS X when using --runtime-image > JDK-8229252???? Add descriptions to Windows jtreg tests > JDK-8228744???? file associations broken on linux. > JDK-8227312???? Remove pkg bundle from DMG image. > JDK-8228722???? jpackage RPM tests fail on some versions of rpmbuild > JDK-8222778???? Packaging Tool (JEP 343) on Linux/AArch64 > JDK-8224627???? Creating installer with --runtime-image on OS X fails > JDK-8226904???? current working directory wrong running jpackage app > JDK-8224486???? Arguments from jpackager cfg file not processed correctly > JDK-8226835???? Command window pops up building exe package > JDK-8225092???? Several jpackage tests failed when run with jcov enabled > > /Andy > From letuyang at amazon.com Thu Aug 22 00:03:35 2019 From: letuyang at amazon.com (Yang, Letu) Date: Thu, 22 Aug 2019 00:03:35 +0000 Subject: RFR 8229958: Provider.getService() scalability issue for legacy algorithms and message digests In-Reply-To: <8357a658-5690-a46a-808c-f3b43234d7ba@oracle.com> References: <8357a658-5690-a46a-808c-f3b43234d7ba@oracle.com> Message-ID: <8F8C4F63-1B53-47A3-BAE1-E85D798BDDF1@amazon.com> Thanks for the suggestion! I've submitted a new CR to security-dev. The new CR is at https://cr.openjdk.java.net/~xliu/8229958/01/webrev/ I've run all tier-1 tests again with the change. Letu ?On 8/21/19, 12:39 AM, "Alan Bateman" wrote: On 21/08/2019 08:32, Yang, Letu wrote: > Hi Ivan, > > You are right! I should make legacyChanged volatile as well. I will get it tested it with tier-1 and get back to you tomorrow. > > Letu > > Probably best to being the discussion and the next version to security-dev as that is where the JCA code is maintained. There have also been several recent discussions and patches related to synchronization issues and performance in this code. -Alan From brian.burkhalter at oracle.com Thu Aug 22 00:28:47 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 21 Aug 2019 17:28:47 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> Message-ID: <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> Hello, > On Aug 20, 2019, at 4:31 PM, Brian Burkhalter wrote: > >> On Aug 20, 2019, at 2:45 PM, Ivan Gerasimov > wrote: >> >> Would it make sense to add an argument `digits` to smallToString (like the same named argument of toString, the minimum number of digits to pad to), so it could zero-pad the result itself? >> >> This way we could avoid inserting zeros into the middle of a StringBuilder after a call to smallToString. > > Indeed I do not like the zero insertion either. I?ll investigate your idea. I modified the patch so that characters are exclusively appended to the StringBuilder thereby eliminating copying of characters which are already present after the insertion point, viz., the padding with zeros after calling smallToString() in the recursive path. A delta versus version .01 is at [1] and the diff versus the tip at [2]. Thanks, Brian [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.01-02/ [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.02/ From huizhe.wang at oracle.com Thu Aug 22 01:31:27 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 21 Aug 2019 18:31:27 -0700 Subject: RFR [14/java.xml] 8229388: ErrorHandler and ContentHandler contain ambiguous/unfinished specification Message-ID: <29f37df9-2b86-b0ca-501f-bc8a2d6ec240@oracle.com> Please review a specification claraficaiton/doc-only change to ErrorHandler and ContentHandler. JBS: https://bugs.openjdk.java.net/browse/JDK-8229388 CSR: https://bugs.openjdk.java.net/browse/JDK-8229738 webrev: http://cr.openjdk.java.net/~joehw/jdk14/8229388/webrev/ Thanks, Joe From ivan.gerasimov at oracle.com Thu Aug 22 02:38:19 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 21 Aug 2019 19:38:19 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> Message-ID: Hi Brian! A couple of comments 1) 3974???????? if (signum == 0) { 3975???????????? buf.append('0'); 3976???????????? return; 3977???????? } Shouldn't it be padded with zeroes, if digits > 0? If I'm not mistaken, it could happen if result[1] at the end of toString() happens to be ZERO. It that's true, then it may be a good idea to add a testcase for a number with many trailing zeros in a string representation. Currently, test/jdk/java/math/BigInteger/BigIntegerTest.java in stringConv() operates on random numbers, which are unlikely to have huge number of trailing zeros. 2) 4120???? /* zero is a string of NUM_ZEROS consecutive zeros. */ 4121???? private static final String zeros = "0".repeat(NUM_ZEROS); Nit in the comment:? name of the constant should be zero*s*. With kind regards, Ivan On 8/21/19 5:28 PM, Brian Burkhalter wrote: > Hello, > >> On Aug 20, 2019, at 4:31 PM, Brian Burkhalter wrote: >> >>> On Aug 20, 2019, at 2:45 PM, Ivan Gerasimov > wrote: >>> >>> Would it make sense to add an argument `digits` to smallToString (like the same named argument of toString, the minimum number of digits to pad to), so it could zero-pad the result itself? >>> >>> This way we could avoid inserting zeros into the middle of a StringBuilder after a call to smallToString. >> Indeed I do not like the zero insertion either. I?ll investigate your idea. > I modified the patch so that characters are exclusively appended to the StringBuilder thereby eliminating copying of characters which are already present after the insertion point, viz., the padding with zeros after calling smallToString() in the recursive path. A delta versus version .01 is at [1] and the diff versus the tip at [2]. > > Thanks, > > Brian > > [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.01-02/ > [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.02/ -- With kind regards, Ivan Gerasimov From vyommani at gmail.com Thu Aug 22 03:37:52 2019 From: vyommani at gmail.com (Vyom Tiwari) Date: Thu, 22 Aug 2019 09:07:52 +0530 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout In-Reply-To: References: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> Message-ID: Hi Milan, Your test need the corresponding "TcpTimeout.dns" file to run successfully, I believe you forgot to add with your patch. please check the existing tests in the same folder if you need any additional information. Thanks, Vyom On Wed, Aug 21, 2019 at 10:48 PM Milan Mimica wrote: > Hi Pavel > > Updated the patch with the jtreg test. > The test hangs when the fix is not applied. I don't know why > main/timeout=20 does not work for me. > > On Tue, 20 Aug 2019 at 00:08, Pavel Rappo wrote: > > > > Thanks for doing that. I've only skimmed through the patch and I?d > recommend that no matter if the changes are adequate or not there should be > a test [1]: > > > > "...A unit test, written for the jtreg test harness, that validates your > change. The test should fail when run against a build without the change > and succeed when run against a build with the change. Unit tests aren't > always practical, especially for changes such as performance improvements > or fixes to bugs that are highly platform-dependent, but if practical then > a unit test is required." > > > > Please consider adding it to the patch while the changes are being > (preliminary) reviewed. > > > > -Pavel > > > > > ------------------------------------------------------------------------------- > > [1] https://openjdk.java.net/contribute/ > > > > > On 19 Aug 2019, at 17:20, Milan Mimica wrote: > > > > > > Hello list > > > > > > Please find the attached patch that fixes JDK-8228580. > > > > > > It works the similar way UDP timeout does: calculate the initial > > > timeout from retry attempt, and account for duration of every blocking > > > call on the TCP socket. > > > > > > I am listed as Author[1] on "jdk" project. > > > > > > [1] https://openjdk.java.net/census#mmimica > > > > > > > > > -- > > > Milan Mimica > > > > > > > > -- > Milan Mimica > -- Thanks, Vyom From amaembo at gmail.com Thu Aug 22 04:21:51 2019 From: amaembo at gmail.com (Tagir Valeev) Date: Thu, 22 Aug 2019 11:21:51 +0700 Subject: [Ping] RFR: 8176894 Provide specialized implementation for default methods putIfAbsent, computeIfAbsent, computeIfPresent, compute, merge in TreeMap In-Reply-To: References: Message-ID: Hello everybody! A gentle reminder: please review the changeset and the CSR. Thanks! With best regards, Tagir Valeev On Mon, Jul 15, 2019 at 5:58 PM Tagir Valeev wrote: > Hello! > > Please review the following patch: > http://cr.openjdk.java.net/~tvaleev/webrev/8176894/r2/ > https://bugs.openjdk.java.net/browse/JDK-8176894 > > Also please review the associated CSR: > https://bugs.openjdk.java.net/browse/JDK-8227666 > > The patch was originally submitted by Sergey Kuksenko in March 2017 and > reviewed by some people: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046825.html > The latest patch submitted by Sergey is here: > http://cr.openjdk.java.net/~skuksenko/corelibs/utils/8176894/webrev.01/ > > I asked Sergey why it was abandoned. Seems there were no particular reason > and Sergey asked if I could pick up this work. I will be happy to finish it. > > Here's the list of differences between the latest Sergey patch and my > patch: > - A bug is fixed in putIfAbsent implementation. TreeMap.java, lines 576 > and 596: `|| oldValue == null` condition added (the null value should be > overwritten no matter what) > - A testcase is added to cover this problem (InPlaceOpsCollisions.java, > also checks HashMap and LinkedHashMap). Not sure if it's the best place for > such test though. Probably a separate file would be better? > - TreeMap.merge() implementation is added. > - TreeMap is added to the FunctionalCMEs.java test (btw this file > copyright says that it's a subject to Classpath exception which is probably > wrong?) > - Simple microbenchmark is added: TreeMapUpdate.java > > My quick benchmarking shows that optimized version is indeed faster for > the most of the tests and no regression is observed for put() method. > Here's raw results of jdk13-ea+26 and jdk13-ea+26+patch if anybody is > interested. > http://cr.openjdk.java.net/~tvaleev/jmh/JDK-8176894/ > > With best regards, > Tagir Valeev. > From julia.boes at oracle.com Thu Aug 22 09:06:22 2019 From: julia.boes at oracle.com (Julia Boes) Date: Thu, 22 Aug 2019 10:06:22 +0100 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <9bd23f6b-d084-c4ef-54fa-937e6c6b231d@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> <9bd23f6b-d084-c4ef-54fa-937e6c6b231d@oracle.com> Message-ID: <0b515032-40eb-3be0-dd99-18dcd06572c4@oracle.com> Hi Ivan, Thanks for pointing that out, the links are now added. Updated webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.03/ Regards, Julia On 21/08/2019 20:33, Ivan Gerasimov wrote: > Hi Julia! > > This looks good to me. > > For all the other methods from StrictMath that have a corresponding > method in Math there is a link in javadoc `@see Math#xxx`. > > I think, it makes sense to provide such links for all new methods for > consistency. > > With kind regards, > > Ivan > > > On 8/21/19 6:29 AM, Julia Boes wrote: >> Hi all, >> >> Thanks for the review. I incorporated the following changes: >> >> - added "@since 14" tag >> >> - removed test code from the CSR specification >> >> - minor fixes in StrictMath.java, ExactArithTests.java as per Ivan's >> comments. The related fix in Math.java is included in this CSR: >> https://bugs.openjdk.java.net/browse/JDK-8229473 >> >> Updated webrev: >> http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.02/index.html >> >> Regards, >> >> Julia >> >> On 14/08/2019 20:45, Joe Wang wrote: >>> Hi Daniel, >>> >>> That makes sense. So it meant to say "converts the long to int only >>> if it's within the range of an integer" (to be "exact"). It may then >>> add "throws an exception if not". But the original is fine, just my >>> 2 cents. >>> >>> Best, >>> Joe >>> >>> On 8/14/19 12:21 PM, Daniel Fuchs wrote: >>>> Hi Joe, >>>> >>>> On 14/08/2019 20:15, Joe Wang wrote: >>>>> The 2nd part is not necessary as that's what the "@throws" tag is >>>>> for. >>>> >>>> Not withstanding the fact that this is a copy of the API doc from >>>> java.lang.Math, I'd argue that the second part is quite important. >>>> It's why the method is called exact, and is probably the only >>>> reason why you would call that method in the first place. >>>> So I think the 2nd part must be in the synopsis too. >>>> >>>> best regards, >>>> >>>> -- daniel >>>> >>>> On 8/14/19 9:01 AM, Julia Boes wrote: >>>> > >>>> > Hi, >>>> > >>>> > This fix adds decrementExact(), incrementExact(), and >>>> negateExact() to java.lang.StrictMath. The methods were added to >>>> java.lang.Math previously [1] and should have been added to >>>> java.lang.StrictMath for consistency. >>>> > >>>> > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >>>> > >>>> > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >>>> > >>>> > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >>>> > >>>> > Thanks, >>>> > >>>> > Julia >>>> > >>>> > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >>> >> From Alan.Bateman at oracle.com Thu Aug 22 09:47:37 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 22 Aug 2019 10:47:37 +0100 Subject: RFR: 8228581: Archive BigInteger constants In-Reply-To: <861003b5-4f12-cf12-9cfe-395177a1ba2f@oracle.com> References: <861003b5-4f12-cf12-9cfe-395177a1ba2f@oracle.com> Message-ID: <5265baf6-a8e9-4dc3-1e8a-cc9957092f9f@oracle.com> On 24/07/2019 14:28, Claes Redestad wrote: > Hi, > > BigInteger has a number of pre-calculated constants that are profitable > to put up for archiving. This reduces initialization time of BigInteger > by 0.3-0.5ms, and archives ~12Kb worth of objects. > > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8228581 > Webrev: http://cr.openjdk.java.net/~redestad/8228581/open.00/ > > Webrev is applied on top of patch for > https://bugs.openjdk.java.net/browse/JDK-8228507 - which I've > tested alongside this. This looks good to me but I think it would be useful to have Joe or Brian or someone else more steeped in BigInteger to also scan the changes and recommend any additional testing. -Alan From mp at jugs.org Thu Aug 22 13:42:03 2019 From: mp at jugs.org (Michael Paus) Date: Thu, 22 Aug 2019 15:42:03 +0200 Subject: jdk-14-jpackage+1-33 on jdk.java.net Message-ID: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> Thanks for the EA version of jpackage. Great job. I wish this could still make it into Java 13. Here is a little feedback according to my practical experience with it: Add type "img", "app" or similar to --package-type. It makes the handling in scripts easier. DMG folder does not contain an alias to "Applications" as usual. DMG folder does not contain a background image. DMG file has only the default icon but not an application specific icon. PKG installer shows only the default java icon but not an application specific icon. Help message printed for --help: --icon should mention the possible file types. (Seems to be only ".icns" for the Mac) There is no further text after "Platform dependent options for creating the application package:" Is there something missing? Are all the --mac-* options not platform dependent? On Windows: The docs should describe which version of WiX should be installed and how. E.g., it is not possible to install the reccomended version on Windows 10 due to some missing .Net dependencies. Wishlist for the future: Allow to specify a single PNG file or a folder with several PNG files in various sizes as the --icon option and generate the platform specific icons internally. From kustos at gmx.net Thu Aug 22 14:21:15 2019 From: kustos at gmx.net (Philippe Marschall) Date: Thu, 22 Aug 2019 16:21:15 +0200 Subject: Remove exception from sun.rmi.runtime.Log#getSource() Message-ID: Hello First time contributor here. We have exception tracing enabled in production and see thousands of exceptions in sun.rmi.runtime.Log#getSource() to get the caller class. In my option this should use StackWalker introduced in Java 9. I could find no corresponding bug in JBS. I created a and uploaded webrev here [1] and also added the patch inline below. As for the implementation I created a custom StackWalker to be able to pass in the estimated number of frames that we traverse. For variable naming conventions I tried to stick with other StackWalker users I could find in the JDK. The stream formatting tries to follow the LVTI style guidelines. I have not written a test as the method is private. I ran the tier1 tests and they passed. I have signed the OCA. What are the next steps? --- old/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-21 14:16:47.381544386 +0200 +++ new/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-21 14:16:47.249545585 +0200 @@ -30,6 +30,7 @@ import java.io.OutputStream; import java.rmi.server.LogStream; import java.security.PrivilegedAction; +import java.util.Set; import java.util.logging.Handler; import java.util.logging.SimpleFormatter; import java.util.logging.Level; @@ -62,6 +63,8 @@ public static final Level BRIEF = Level.FINE; public static final Level VERBOSE = Level.FINER; + private static final StackWalker WALKER = StackWalker.getInstance(Set.of(), 4); + /* selects log implementation */ private static final LogFactory logFactory; static { @@ -444,10 +447,10 @@ * Obtain class and method names of code calling a log method. */ private static String[] getSource() { - StackTraceElement[] trace = (new Exception()).getStackTrace(); - return new String[] { - trace[3].getClassName(), - trace[3].getMethodName() - }; + return WALKER.walk(s -> s + .skip(3) + .map(f -> new String[] {f.getClassName(), f.getMethodName()}) + .findFirst() + .get()); } } [1] https://github.com/marschall/webrevs/raw/master/Log-getSource/webrev.zip Cheers Philippe Marschall From ivan.gerasimov at oracle.com Thu Aug 22 16:25:17 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 22 Aug 2019 09:25:17 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <0b515032-40eb-3be0-dd99-18dcd06572c4@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> <9bd23f6b-d084-c4ef-54fa-937e6c6b231d@oracle.com> <0b515032-40eb-3be0-dd99-18dcd06572c4@oracle.com> Message-ID: Thank you Julia! On 8/22/19 2:06 AM, Julia Boes wrote: > Hi Ivan, > > Thanks for pointing that out, the links are now added. > > Updated webrev: > http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.03/ > Is there a reason to change the text at lines 72-75? Since you've just added the increment/decrement/negate methods, the old text seems to be more complete. With kind regards, Ivan > Regards, > > Julia > > On 21/08/2019 20:33, Ivan Gerasimov wrote: >> Hi Julia! >> >> This looks good to me. >> >> For all the other methods from StrictMath that have a corresponding >> method in Math there is a link in javadoc `@see Math#xxx`. >> >> I think, it makes sense to provide such links for all new methods for >> consistency. >> >> With kind regards, >> >> Ivan >> >> >> On 8/21/19 6:29 AM, Julia Boes wrote: >>> Hi all, >>> >>> Thanks for the review. I incorporated the following changes: >>> >>> - added "@since 14" tag >>> >>> - removed test code from the CSR specification >>> >>> - minor fixes in StrictMath.java, ExactArithTests.java as per Ivan's >>> comments. The related fix in Math.java is included in this CSR: >>> https://bugs.openjdk.java.net/browse/JDK-8229473 >>> >>> Updated webrev: >>> http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.02/index.html >>> >>> Regards, >>> >>> Julia >>> >>> On 14/08/2019 20:45, Joe Wang wrote: >>>> Hi Daniel, >>>> >>>> That makes sense. So it meant to say "converts the long to int only >>>> if it's within the range of an integer" (to be "exact"). It may >>>> then add "throws an exception if not". But the original is fine, >>>> just my 2 cents. >>>> >>>> Best, >>>> Joe >>>> >>>> On 8/14/19 12:21 PM, Daniel Fuchs wrote: >>>>> Hi Joe, >>>>> >>>>> On 14/08/2019 20:15, Joe Wang wrote: >>>>>> The 2nd part is not necessary as that's what the "@throws" tag is >>>>>> for. >>>>> >>>>> Not withstanding the fact that this is a copy of the API doc from >>>>> java.lang.Math, I'd argue that the second part is quite important. >>>>> It's why the method is called exact, and is probably the only >>>>> reason why you would call that method in the first place. >>>>> So I think the 2nd part must be in the synopsis too. >>>>> >>>>> best regards, >>>>> >>>>> -- daniel >>>>> >>>>> On 8/14/19 9:01 AM, Julia Boes wrote: >>>>> > >>>>> > Hi, >>>>> > >>>>> > This fix adds decrementExact(), incrementExact(), and >>>>> negateExact() to java.lang.StrictMath. The methods were added to >>>>> java.lang.Math previously [1] and should have been added to >>>>> java.lang.StrictMath for consistency. >>>>> > >>>>> > Bug: https://bugs.openjdk.java.net/browse/JDK-8229485 >>>>> > >>>>> > Webrev: http://cr.openjdk.java.net/~dfuchs/jboes/8229485/webrev.01/ >>>>> > >>>>> > CSR: https://bugs.openjdk.java.net/browse/JDK-8229702 >>>>> > >>>>> > Thanks, >>>>> > >>>>> > Julia >>>>> > >>>>> > [1] https://bugs.openjdk.java.net/browse/JDK-8022109 >>>> >>> > -- With kind regards, Ivan Gerasimov From lance.andersen at oracle.com Thu Aug 22 16:56:12 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 22 Aug 2019 12:56:12 -0400 Subject: RFR [14/java.xml] 8229388: ErrorHandler and ContentHandler contain ambiguous/unfinished specification In-Reply-To: <29f37df9-2b86-b0ca-501f-bc8a2d6ec240@oracle.com> References: <29f37df9-2b86-b0ca-501f-bc8a2d6ec240@oracle.com> Message-ID: <63C0CDBB-14CB-420A-8453-D1B2EDF8F4E4@oracle.com> Hi Joe, This looks good overall. Best Lance > On Aug 21, 2019, at 9:31 PM, Joe Wang wrote: > > Please review a specification claraficaiton/doc-only change to ErrorHandler and ContentHandler. > > JBS: https://bugs.openjdk.java.net/browse/JDK-8229388 > CSR: https://bugs.openjdk.java.net/browse/JDK-8229738 > webrev: http://cr.openjdk.java.net/~joehw/jdk14/8229388/webrev/ > > Thanks, > Joe > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mandy.chung at oracle.com Thu Aug 22 17:56:19 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 22 Aug 2019 10:56:19 -0700 Subject: Remove exception from sun.rmi.runtime.Log#getSource() In-Reply-To: References: Message-ID: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> Hi Philippe, This is a good use of StackWalker. ? getSource can simply return StackFrame and avoid the creation of String[]. Stuart will give you better guidance related to RMI testing. I see that test/jdk/sun/rmi/runtime/Log has a few RMI logging tests. RMI tests are in tier3.? You can run jdk_rmi test group to verify this patch. I notice that pre-1.4 RMI logging support.? I wonder if this is time to remove it. Mandy On 8/22/19 7:21 AM, Philippe Marschall wrote: > Hello > > First time contributor here. > > We have exception tracing enabled in production and see thousands of > exceptions in sun.rmi.runtime.Log#getSource() to get the caller class. > In my option this should use StackWalker introduced in Java 9. I could > find no corresponding bug in JBS. > > I created a and uploaded webrev here [1] and also added the patch inline > below. As for the implementation I created a custom StackWalker to be > able to pass in the estimated number of frames that we traverse. For > variable naming conventions I tried to stick with other StackWalker > users I could find in the JDK. The stream formatting tries to follow the > LVTI style guidelines. > > I have not written a test as the method is private. I ran the tier1 > tests and they passed. > > I have signed the OCA. > > What are the next steps? > > > --- old/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-21 > 14:16:47.381544386 +0200 > +++ new/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-21 > 14:16:47.249545585 +0200 > @@ -30,6 +30,7 @@ > ?import java.io.OutputStream; > ?import java.rmi.server.LogStream; > ?import java.security.PrivilegedAction; > +import java.util.Set; > ?import java.util.logging.Handler; > ?import java.util.logging.SimpleFormatter; > ?import java.util.logging.Level; > @@ -62,6 +63,8 @@ > ???? public static final Level BRIEF = Level.FINE; > ???? public static final Level VERBOSE = Level.FINER; > > +??? private static final StackWalker WALKER = > StackWalker.getInstance(Set.of(), 4); > + > ???? /* selects log implementation */ > ???? private static final LogFactory logFactory; > ???? static { > @@ -444,10 +447,10 @@ > ????? * Obtain class and method names of code calling a log method. > ????? */ > ???? private static String[] getSource() { > -??????? StackTraceElement[] trace = (new Exception()).getStackTrace(); > -??????? return new String[] { > -??????????? trace[3].getClassName(), > -??????????? trace[3].getMethodName() > -??????? }; > +??????? return WALKER.walk(s -> s > +???????????????????????????????? .skip(3) > +???????????????????????????????? .map(f -> new String[] > {f.getClassName(), f.getMethodName()}) > +???????????????????????????????? .findFirst() > +???????????????????????????????? .get()); > ???? } > ?} > > ?[1] > https://github.com/marschall/webrevs/raw/master/Log-getSource/webrev.zip > > Cheers > Philippe Marschall > From brian.burkhalter at oracle.com Thu Aug 22 18:04:27 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 22 Aug 2019 11:04:27 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> Message-ID: <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> Hi Ivan, Please see the delta [1] and absolute [2] webrevs. > On Aug 21, 2019, at 7:38 PM, Ivan Gerasimov wrote: > > A couple of comments > > 1) > 3974 if (signum == 0) { > 3975 buf.append('0'); > 3976 return; > 3977 } > > Shouldn't it be padded with zeroes, if digits > 0? > If I'm not mistaken, it could happen if result[1] at the end of toString() happens to be ZERO. Good catch: you are absolutely correct. > It that's true, then it may be a good idea to add a testcase for a number with many trailing zeros in a string representation. Currently, test/jdk/java/math/BigInteger/BigIntegerTest.java in stringConv() operates on random numbers, which are unlikely to have huge number of trailing zeros. I added testing this to stringConv(). The test fails without the most recent delta applied to the implementation. > 2) > 4120 /* zero is a string of NUM_ZEROS consecutive zeros. */ > 4121 private static final String zeros = "0".repeat(NUM_ZEROS); > > Nit in the comment: name of the constant should be zeros. I changed the variable name to ZEROS as it is a constant. Thanks, Brian [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.02-03/ [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.03/ From milan.mimica at gmail.com Thu Aug 22 07:20:56 2019 From: milan.mimica at gmail.com (Milan Mimica) Date: Thu, 22 Aug 2019 09:20:56 +0200 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout In-Reply-To: References: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> Message-ID: Hi Indeed I have forgotten. Re-attached, with aesthetic fixes to the test. On Thu, 22 Aug 2019 at 05:38, Vyom Tiwari wrote: > > Hi Milan, > > Your test need the corresponding "TcpTimeout.dns" file to run successfully, I believe you forgot to add with your patch. > please check the existing tests in the same folder if you need any additional information. > > Thanks, > Vyom > > On Wed, Aug 21, 2019 at 10:48 PM Milan Mimica wrote: >> >> Hi Pavel >> >> Updated the patch with the jtreg test. >> The test hangs when the fix is not applied. I don't know why >> main/timeout=20 does not work for me. >> >> On Tue, 20 Aug 2019 at 00:08, Pavel Rappo wrote: >> > >> > Thanks for doing that. I've only skimmed through the patch and I?d recommend that no matter if the changes are adequate or not there should be a test [1]: >> > >> > "...A unit test, written for the jtreg test harness, that validates your change. The test should fail when run against a build without the change and succeed when run against a build with the change. Unit tests aren't always practical, especially for changes such as performance improvements or fixes to bugs that are highly platform-dependent, but if practical then a unit test is required." >> > >> > Please consider adding it to the patch while the changes are being (preliminary) reviewed. >> > >> > -Pavel >> > >> > ------------------------------------------------------------------------------- >> > [1] https://openjdk.java.net/contribute/ >> > >> > > On 19 Aug 2019, at 17:20, Milan Mimica wrote: >> > > >> > > Hello list >> > > >> > > Please find the attached patch that fixes JDK-8228580. >> > > >> > > It works the similar way UDP timeout does: calculate the initial >> > > timeout from retry attempt, and account for duration of every blocking >> > > call on the TCP socket. >> > > >> > > I am listed as Author[1] on "jdk" project. >> > > >> > > [1] https://openjdk.java.net/census#mmimica >> > > >> > > >> > > -- >> > > Milan Mimica >> > > >> > >> >> >> -- >> Milan Mimica > > > > -- > Thanks, > Vyom -- Milan Mimica -------------- next part -------------- A non-text attachment was scrubbed... Name: JDK-8228580.patch Type: text/x-patch Size: 11177 bytes Desc: not available URL: From Roger.Riggs at oracle.com Thu Aug 22 19:59:35 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Thu, 22 Aug 2019 15:59:35 -0400 Subject: Remove exception from sun.rmi.runtime.Log#getSource() In-Reply-To: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> References: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> Message-ID: <863a683d-e451-ffd1-cb44-4c4988ef225c@oracle.com> Hi Philippe, I'll be happy to sponsor the fix. Mandy's suggestion makes sense to me, please update the patch. I filed https://bugs.openjdk.java.net/browse/JDK-8230058 to track the change. Regards, Roger On 8/22/19 1:56 PM, Mandy Chung wrote: > Hi Philippe, > > This is a good use of StackWalker. ? getSource can simply return > StackFrame and avoid the creation of String[]. > > Stuart will give you better guidance related to RMI testing. > > I see that test/jdk/sun/rmi/runtime/Log has a few RMI logging tests. > RMI tests are in tier3.? You can run jdk_rmi test group to verify > this patch. > > I notice that pre-1.4 RMI logging support.? I wonder if this is > time to remove it. > > Mandy > > On 8/22/19 7:21 AM, Philippe Marschall wrote: >> Hello >> >> First time contributor here. >> >> We have exception tracing enabled in production and see thousands of >> exceptions in sun.rmi.runtime.Log#getSource() to get the caller class. >> In my option this should use StackWalker introduced in Java 9. I could >> find no corresponding bug in JBS. >> >> I created a and uploaded webrev here [1] and also added the patch inline >> below. As for the implementation I created a custom StackWalker to be >> able to pass in the estimated number of frames that we traverse. For >> variable naming conventions I tried to stick with other StackWalker >> users I could find in the JDK. The stream formatting tries to follow the >> LVTI style guidelines. >> >> I have not written a test as the method is private. I ran the tier1 >> tests and they passed. >> >> I have signed the OCA. >> >> What are the next steps? >> >> >> --- old/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-21 >> 14:16:47.381544386 +0200 >> +++ new/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-21 >> 14:16:47.249545585 +0200 >> @@ -30,6 +30,7 @@ >> ?import java.io.OutputStream; >> ?import java.rmi.server.LogStream; >> ?import java.security.PrivilegedAction; >> +import java.util.Set; >> ?import java.util.logging.Handler; >> ?import java.util.logging.SimpleFormatter; >> ?import java.util.logging.Level; >> @@ -62,6 +63,8 @@ >> ???? public static final Level BRIEF = Level.FINE; >> ???? public static final Level VERBOSE = Level.FINER; >> >> +??? private static final StackWalker WALKER = >> StackWalker.getInstance(Set.of(), 4); >> + >> ???? /* selects log implementation */ >> ???? private static final LogFactory logFactory; >> ???? static { >> @@ -444,10 +447,10 @@ >> ????? * Obtain class and method names of code calling a log method. >> ????? */ >> ???? private static String[] getSource() { >> -??????? StackTraceElement[] trace = (new Exception()).getStackTrace(); >> -??????? return new String[] { >> -??????????? trace[3].getClassName(), >> -??????????? trace[3].getMethodName() >> -??????? }; >> +??????? return WALKER.walk(s -> s >> +???????????????????????????????? .skip(3) >> +???????????????????????????????? .map(f -> new String[] >> {f.getClassName(), f.getMethodName()}) >> +???????????????????????????????? .findFirst() >> +???????????????????????????????? .get()); >> ???? } >> ?} >> >> ?[1] >> https://github.com/marschall/webrevs/raw/master/Log-getSource/webrev.zip >> >> Cheers >> Philippe Marschall >> > From ivan.gerasimov at oracle.com Thu Aug 22 20:24:15 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 22 Aug 2019 13:24:15 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> Message-ID: Thank you Brian, this looks much better! I have a few further suggestions how to simplify the code. 1) If this BigInteger is negative, it is negated in two places: @ 3943 and either @ 4003 or @ 4061. It is better to keep abs value at the very beginning and make private toString(...) and smallToString() to only accept non-negative numbers. 2) Once the 1) is done, it is possible to remove lines 3948-3954, and always call private toString(...), which will immediately delegate to smallToString() if necessary.? This is just to make the code shorter. 3) In padWithZeros(), the condition check `if (digits > 0 && len < digits) {` is not necessary. Actually, I would suggest to make a single argument, say, numLeadingZeros (in the current code it is `m`). 4) I think that logic with making the argument `digits` == -1 for the first chunk of digits is over-complication:? `digits` can always be safely set to 1 in the initial call to the private toString() or smallToString(). Then the variable atBeginning is not needed at all. 5) If 3) and 4) are done, the two lines 3988 and 3989 can be reduced to `padWithZeros(buf, digits);` Here's the patch, which illustrates all the suggestions above: http://cr.openjdk.java.net/~igerasim/8229845/00/webrev/ (I have only run the tests from test/jdk/java/math/BigInteger to verify it). With kind regards, Ivan On 8/22/19 11:04 AM, Brian Burkhalter wrote: > Hi Ivan, > > Please see the delta [1] and absolute [2] webrevs. > >> On Aug 21, 2019, at 7:38 PM, Ivan Gerasimov >> > wrote: >> >> A couple of comments >> >> 1) >> 3974 if (signum == 0) { >> 3975 buf.append('0'); >> 3976 return; >> 3977 } >> >> Shouldn't it be padded with zeroes, if digits > 0? >> If I'm not mistaken, it could happen if result[1] at the end of >> toString() happens to be ZERO. > > Good catch: you are absolutely correct. > >> It that's true, then it may be a good idea to add a testcase for a >> number with many trailing zeros in a string representation. >> Currently, test/jdk/java/math/BigInteger/BigIntegerTest.java in >> stringConv() operates on random numbers, which are unlikely to have >> huge number of trailing zeros. > > I added testing this to stringConv(). The test fails without the most > recent delta applied to the implementation. > >> 2) >> 4120 /* zero is a string of NUM_ZEROS consecutive zeros. */ >> 4121 private static final String zeros = "0".repeat(NUM_ZEROS); >> >> Nit in the comment:? name of the constant should be zero*s*. > > I changed the variable name to ZEROS as it is a constant. > > Thanks, > > Brian > > [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.02-03/ > [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.03/ > -- With kind regards, Ivan Gerasimov From andrewluotechnologies at outlook.com Fri Aug 23 05:22:44 2019 From: andrewluotechnologies at outlook.com (Andrew Luo) Date: Fri, 23 Aug 2019 05:22:44 +0000 Subject: [PATCH] Add const to input parameter for JNU_IsInstanceOfByName In-Reply-To: <8b5e9d1c-9ad1-a903-ef09-5a0b37a7f49c@oracle.com> References: <8b5e9d1c-9ad1-a903-ef09-5a0b37a7f49c@oracle.com> Message-ID: Thanks for reviewing. Can someone help sponsor/commit the patch for me? Thanks, -Andrew diff -r 70fab3a8ff02 src/java.base/share/native/libjava/jni_util.c --- a/src/java.base/share/native/libjava/jni_util.c Tue Jul 16 07:29:12 2019 +0900 +++ b/src/java.base/share/native/libjava/jni_util.c Mon Jul 15 16:07:35 2019 -0700 @@ -1096,7 +1096,7 @@ } JNIEXPORT jint JNICALL -JNU_IsInstanceOfByName(JNIEnv *env, jobject object, char* classname) +JNU_IsInstanceOfByName(JNIEnv *env, jobject object, const char* classname) { jclass cls; if ((*env)->EnsureLocalCapacity(env, 1) < 0) diff -r 70fab3a8ff02 src/java.base/share/native/libjava/jni_util.h --- a/src/java.base/share/native/libjava/jni_util.h Tue Jul 16 07:29:12 2019 +0900 +++ b/src/java.base/share/native/libjava/jni_util.h Mon Jul 15 16:07:35 2019 -0700 @@ -208,7 +208,7 @@ * has been thrown. */ JNIEXPORT jint JNICALL -JNU_IsInstanceOfByName(JNIEnv *env, jobject object, char *classname); +JNU_IsInstanceOfByName(JNIEnv *env, jobject object, const char *classname); /* Get or set class and instance fields. -----Original Message----- From: Alan Bateman Sent: Friday, July 19, 2019 4:03 AM To: Andrew Luo ; core-libs-dev Subject: Re: [PATCH] Add const to input parameter for JNU_IsInstanceOfByName On 16/07/2019 00:10, Andrew Luo wrote: > Hi Everyone, > > I'm making some const-correctness fixes to some downstream libraries that use JNU_* functions, and noticed that JNU_IsInstanceOfByName takes in the class name by char* instead of const char* when it does not need to modify the string. It would be useful to change this so that we don't have to (unnecessarily) const-cast every time and can safely pass string literals to this function. Patch is inline below - any comments/feedback welcome. This looks okay to me. -Alan. From julia.boes at oracle.com Fri Aug 23 10:36:39 2019 From: julia.boes at oracle.com (Julia Boes) Date: Fri, 23 Aug 2019 11:36:39 +0100 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> <9bd23f6b-d084-c4ef-54fa-937e6c6b231d@oracle.com> <0b515032-40eb-3be0-dd99-18dcd06572c4@oracle.com> Message-ID: <8d6e2808-2f58-7c46-ed07-aaaace3f0f52@oracle.com> Hi Ivan, The change of the javadoc was made per Brian's request for consistency with java.lang.Math, see the description of the bug: https://bugs.openjdk.java.net/browse/JDK-8229485 Best, Julia On 22/08/2019 17:25, Ivan Gerasimov wrote: > Is there a reason to change the text at lines 72-75? > > Since you've just added the increment/decrement/negate methods, the > old text seems to be more complete. > > With kind regards, > > Ivan From claes.redestad at oracle.com Fri Aug 23 13:08:51 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Fri, 23 Aug 2019 15:08:51 +0200 Subject: RFR: 8230043: Lazily load libverify Message-ID: Hi, please review this cleanup to untangle the old bytecode verifier (libverify). It's currently linked and loaded eagerly and early during bootstrap. Webrev: http://cr.openjdk.java.net/~redestad/8230043/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8230043 - removes dependency on libverify from libjava by moving the check_format.c functions into libjava (they don't need to be exported via JNI) - fixed build to not link libjava with libverify - removes the eager initialization of libverify in os::native_java_library - removes the verify_stubs and directs verifier.cpp to load and call VerifyClassForMajorVersion in libverify directly. The initialization is synchronized on a new mutex, Verify_lock - remove the unused VerifyClass entry point and simplify code in the verifier by removing some indirections Testing: tier1-4 Thanks! /Claes From ivan.gerasimov at oracle.com Fri Aug 23 14:15:30 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 23 Aug 2019 07:15:30 -0700 Subject: RFR: 8229485: Add decrementExact(), incrementExact(), and negateExact() to java.lang.StrictMath In-Reply-To: <8d6e2808-2f58-7c46-ed07-aaaace3f0f52@oracle.com> References: <50bd56d4-6239-9cd0-cf5c-e0d656b1f2f2@oracle.com> <20691c01-aa30-c5b9-0faf-832cbcce1437@oracle.com> <7f3e23db-24cb-306e-1505-3af7629581cc@oracle.com> <2b8553b5-5c5d-f353-902f-e90a7e5192e5@oracle.com> <9bd23f6b-d084-c4ef-54fa-937e6c6b231d@oracle.com> <0b515032-40eb-3be0-dd99-18dcd06572c4@oracle.com> <8d6e2808-2f58-7c46-ed07-aaaace3f0f52@oracle.com> Message-ID: <51ec5549-d26f-2656-9d12-33ec37d048f0@oracle.com> Hi Julia! On 8/23/19 3:36 AM, Julia Boes wrote: > Hi Ivan, > > The change of the javadoc was made per Brian's request for consistency > with java.lang.Math, see the description of the bug: > https://bugs.openjdk.java.net/browse/JDK-8229485 > Ah, I didn't realize that the operations listed in that paragraph are those that *do not* have a corresponding -Exact method. The fix looks good then, thanks. With kind regards, Ivan > Best, > > Julia > > On 22/08/2019 17:25, Ivan Gerasimov wrote: >> Is there a reason to change the text at lines 72-75? >> >> Since you've just added the increment/decrement/negate methods, the >> old text seems to be more complete. >> >> With kind regards, >> >> Ivan > -- With kind regards, Ivan Gerasimov From kustos at gmx.net Fri Aug 23 14:38:38 2019 From: kustos at gmx.net (Philippe Marschall) Date: Fri, 23 Aug 2019 16:38:38 +0200 Subject: Remove exception from sun.rmi.runtime.Log#getSource() In-Reply-To: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> References: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> Message-ID: <9eeaa431-0719-f15c-3cfe-947b244de14a@gmx.net> On 22.08.19 19:56, Mandy Chung wrote: > Hi Philippe, > > This is a good use of StackWalker. ? getSource can simply return > StackFrame and avoid the creation of String[]. Updated webrev [1] and inline diff at the end. Something I noted is that we could replace sun.rmi.runtime.Log.LogStreamLog.unqualifiedName(String) with Class#getSimpleName() which is cached since JDK-8187123. That would remove an additional bit of allocation. However only in the pre-1.4 logging case, which I assume is uncommon. In addition that would require us to create a StackWalker with Option#RETAIN_CLASS_REFERENCE. If we do not want to do this in the jul case we would have to create a LogFactory specific #getSource implementation with a different StackWalker. I am not sure this is worth it. > Stuart will give you better guidance related to RMI testing. > > I see that test/jdk/sun/rmi/runtime/Log has a few RMI logging tests. > RMI tests are in tier3.? You can run jdk_rmi test group to verify > this patch. I am new to this, I did make run-test TEST=jdk_rmi and all tests passed. > I notice that pre-1.4 RMI logging support.? I wonder if this is > time to remove it. I would love to do this but I would assume that requires at least a different issue and probably a change note that the property and feature are gone. I assume deprecating java.rmi.server.LogStream for removal is not an option. I'll be away from a keyboard for a week so I won't be able to answer. --- old/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-23 15:43:28.452810308 +0200 +++ new/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-23 15:43:28.320811517 +0200 @@ -28,8 +28,10 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.io.OutputStream; +import java.lang.StackWalker.StackFrame; import java.rmi.server.LogStream; import java.security.PrivilegedAction; +import java.util.Set; import java.util.logging.Handler; import java.util.logging.SimpleFormatter; import java.util.logging.Level; @@ -62,6 +64,8 @@ public static final Level BRIEF = Level.FINE; public static final Level VERBOSE = Level.FINER; + private static final StackWalker WALKER = StackWalker.getInstance(Set.of(), 4); + /* selects log implementation */ private static final LogFactory logFactory; static { @@ -217,16 +221,16 @@ public void log(Level level, String message) { if (isLoggable(level)) { - String[] source = getSource(); - logger.logp(level, source[0], source[1], + StackFrame sourceFrame = getSource(); + logger.logp(level, sourceFrame.getClassName(), sourceFrame.getMethodName(), Thread.currentThread().getName() + ": " + message); } } public void log(Level level, String message, Throwable thrown) { if (isLoggable(level)) { - String[] source = getSource(); - logger.logp(level, source[0], source[1], + StackFrame sourceFrame = getSource(); + logger.logp(level, sourceFrame.getClassName(), sourceFrame.getMethodName(), Thread.currentThread().getName() + ": " + message, thrown); } @@ -390,9 +394,9 @@ public void log(Level messageLevel, String message) { if (isLoggable(messageLevel)) { - String[] source = getSource(); - stream.println(unqualifiedName(source[0]) + - "." + source[1] + ": " + message); + StackFrame sourceFrame = getSource(); + stream.println(unqualifiedName(sourceFrame.getClassName()) + + "." + sourceFrame.getMethodName() + ": " + message); } } @@ -403,9 +407,9 @@ * RemoteServer.getLog */ synchronized (stream) { - String[] source = getSource(); - stream.println(unqualifiedName(source[0]) + "." + - source[1] + ": " + message); + StackFrame sourceFrame = getSource(); + stream.println(unqualifiedName(sourceFrame.getClassName()) + "." + + sourceFrame.getMethodName() + ": " + message); thrown.printStackTrace(stream); } } @@ -441,13 +445,12 @@ } /** - * Obtain class and method names of code calling a log method. + * Obtain stack frame of code calling a log method. */ - private static String[] getSource() { - StackTraceElement[] trace = (new Exception()).getStackTrace(); - return new String[] { - trace[3].getClassName(), - trace[3].getMethodName() - }; + private static StackFrame getSource() { + return WALKER.walk(s -> s + .skip(3) + .findFirst() + .get()); } } [1] https://github.com/marschall/webrevs/raw/master/Log-getSource-02/webrev.zip Philippe From claes.redestad at oracle.com Fri Aug 23 14:54:41 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Fri, 23 Aug 2019 16:54:41 +0200 Subject: RFR: 8228581: Archive BigInteger constants In-Reply-To: <5265baf6-a8e9-4dc3-1e8a-cc9957092f9f@oracle.com> References: <861003b5-4f12-cf12-9cfe-395177a1ba2f@oracle.com> <5265baf6-a8e9-4dc3-1e8a-cc9957092f9f@oracle.com> Message-ID: <5aa5cd2d-ef01-c487-836d-ef86f895af14@oracle.com> On 2019-08-22 11:47, Alan Bateman wrote: > On 24/07/2019 14:28, Claes Redestad wrote: >> Webrev: http://cr.openjdk.java.net/~redestad/8228581/open.00/ >> > This looks good to me but I think it would be useful to have Joe or > Brian or someone else more steeped in BigInteger to also scan the > changes and recommend any additional testing. > > -Alan Thanks Alan, however, I've chatted with Brian since this one conflicts with changes in JDK-8229845[1]: some of the optimizations there reduce the amount of objects created during initialization, which mean we won't profit as much from archiving, so I'll hold this back until JDK-8229845 is integrated, rebase and evaluate that this is still a worthwhile enhancement. Thanks! /Claes [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/061914.html From erik.joelsson at oracle.com Fri Aug 23 15:29:27 2019 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Fri, 23 Aug 2019 08:29:27 -0700 Subject: RFR: 8230043: Lazily load libverify In-Reply-To: References: Message-ID: Build change looks good. /Erik On 2019-08-23 06:08, Claes Redestad wrote: > Hi, > > please review this cleanup to untangle the old bytecode verifier > (libverify). It's currently linked and loaded eagerly and early during > bootstrap. > > Webrev: http://cr.openjdk.java.net/~redestad/8230043/webrev.00/ > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8230043 > > - removes dependency on libverify from libjava by moving the > check_format.c functions into libjava (they don't need to be exported > via JNI) > - fixed build to not link libjava with libverify > - removes the eager initialization of libverify in > os::native_java_library > - removes the verify_stubs and directs verifier.cpp to load and call > VerifyClassForMajorVersion in libverify directly. The initialization > is synchronized on a new mutex, Verify_lock > - remove the unused VerifyClass entry point and simplify code in the > verifier by removing some indirections > > Testing: tier1-4 > > Thanks! > > /Claes From claes.redestad at oracle.com Fri Aug 23 15:39:14 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Fri, 23 Aug 2019 17:39:14 +0200 Subject: RFR: 8230043: Lazily load libverify In-Reply-To: References: Message-ID: <15f5b4d3-0e27-f48a-d209-4cdaf6876eeb@oracle.com> On 2019-08-23 17:29, Erik Joelsson wrote: > Build change looks good. > > /Erik Thanks for reviewing! /Claes From Roger.Riggs at oracle.com Fri Aug 23 15:44:11 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Fri, 23 Aug 2019 11:44:11 -0400 Subject: Remove exception from sun.rmi.runtime.Log#getSource() In-Reply-To: <9eeaa431-0719-f15c-3cfe-947b244de14a@gmx.net> References: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> <9eeaa431-0719-f15c-3cfe-947b244de14a@gmx.net> Message-ID: <2db89d34-8d95-68c3-7510-1c95149ce9ba@oracle.com> Hi Philippe, The change looks good, I'll run it through our tests and push if its all ok. (Pending anyone else's comments.) On 8/23/19 10:38 AM, Philippe Marschall wrote: > > > On 22.08.19 19:56, Mandy Chung wrote: >> Hi Philippe, >> >> This is a good use of StackWalker. ? getSource can simply return >> StackFrame and avoid the creation of String[]. > > Updated webrev [1] and inline diff at the end. > > Something I noted is that we could replace > sun.rmi.runtime.Log.LogStreamLog.unqualifiedName(String) with > Class#getSimpleName() which is cached since JDK-8187123. That would > remove an additional bit of allocation. However only in the pre-1.4 > logging case, which I assume is uncommon. In addition that would require > us to create a StackWalker with Option#RETAIN_CLASS_REFERENCE. If we do > not want to do this in the jul case we would have to create a LogFactory > specific #getSource implementation with a different StackWalker. I am > not sure this is worth it. > >> Stuart will give you better guidance related to RMI testing. >> >> I see that test/jdk/sun/rmi/runtime/Log has a few RMI logging tests. >> RMI tests are in tier3.? You can run jdk_rmi test group to verify >> this patch. > > I am new to this, I did > > make run-test TEST=jdk_rmi > > and all tests passed. That's a start, running the complete suite of tests may catch something else or another dependency outside of the specific rmi tests. > >> I notice that pre-1.4 RMI logging support.? I wonder if this is >> time to remove it. > > I would love to do this but I would assume that requires at least a > different issue and probably a change note that the property and feature > are gone. I assume deprecating java.rmi.server.LogStream for removal is > not an option. Right, that's a separate issue and takes work and process to remove. > > > I'll be away from a keyboard for a week so I won't be able to answer. ok, Enjoy Thanks, Roger > > > --- old/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-23 > 15:43:28.452810308 +0200 > +++ new/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-23 > 15:43:28.320811517 +0200 > @@ -28,8 +28,10 @@ > ?import java.io.ByteArrayOutputStream; > ?import java.io.PrintStream; > ?import java.io.OutputStream; > +import java.lang.StackWalker.StackFrame; > ?import java.rmi.server.LogStream; > ?import java.security.PrivilegedAction; > +import java.util.Set; > ?import java.util.logging.Handler; > ?import java.util.logging.SimpleFormatter; > ?import java.util.logging.Level; > @@ -62,6 +64,8 @@ > ???? public static final Level BRIEF = Level.FINE; > ???? public static final Level VERBOSE = Level.FINER; > > +??? private static final StackWalker WALKER = > StackWalker.getInstance(Set.of(), 4); > + > ???? /* selects log implementation */ > ???? private static final LogFactory logFactory; > ???? static { > @@ -217,16 +221,16 @@ > > ???????? public void log(Level level, String message) { > ???????????? if (isLoggable(level)) { > -??????????????? String[] source = getSource(); > -??????????????? logger.logp(level, source[0], source[1], > +??????????????? StackFrame sourceFrame = getSource(); > +??????????????? logger.logp(level, sourceFrame.getClassName(), > sourceFrame.getMethodName(), > ??????????????????????????? Thread.currentThread().getName() + ": " + > message); > ???????????? } > ???????? } > > ???????? public void log(Level level, String message, Throwable thrown) { > ???????????? if (isLoggable(level)) { > -??????????????? String[] source = getSource(); > -??????????????? logger.logp(level, source[0], source[1], > +??????????????? StackFrame sourceFrame = getSource(); > +??????????????? logger.logp(level, sourceFrame.getClassName(), > sourceFrame.getMethodName(), > ???????????????????? Thread.currentThread().getName() + ": " + > ??????????????????????????? message, thrown); > ???????????? } > @@ -390,9 +394,9 @@ > > ???????? public void log(Level messageLevel, String message) { > ???????????? if (isLoggable(messageLevel)) { > -??????????????? String[] source = getSource(); > -??????????????? stream.println(unqualifiedName(source[0]) + > -?????????????????????????????? "." + source[1] + ": " + message); > +??????????????? StackFrame sourceFrame = getSource(); > + > stream.println(unqualifiedName(sourceFrame.getClassName()) + > +?????????????????????????????? "." + sourceFrame.getMethodName() + ": " > + message); > ???????????? } > ???????? } > > @@ -403,9 +407,9 @@ > ????????????????? * RemoteServer.getLog > ????????????????? */ > ???????????????? synchronized (stream) { > -??????????????????? String[] source = getSource(); > -??????????????????? stream.println(unqualifiedName(source[0]) + "." + > -?????????????????????????????????? source[1] + ": " + message); > +??????????????????? StackFrame sourceFrame = getSource(); > + > stream.println(unqualifiedName(sourceFrame.getClassName()) + "." + > +??????????????????????????????????? sourceFrame.getMethodName() + ": " > + message); > ???????????????????? thrown.printStackTrace(stream); > ???????????????? } > ???????????? } > @@ -441,13 +445,12 @@ > ???? } > > ???? /** > -???? * Obtain class and method names of code calling a log method. > +???? * Obtain stack frame of code calling a log method. > ????? */ > -??? private static String[] getSource() { > -??????? StackTraceElement[] trace = (new Exception()).getStackTrace(); > -??????? return new String[] { > -??????????? trace[3].getClassName(), > -??????????? trace[3].getMethodName() > -??????? }; > +??? private static StackFrame getSource() { > +??????? return WALKER.walk(s -> s > +???????????????????????????????? .skip(3) > +???????????????????????????????? .findFirst() > +???????????????????????????????? .get()); > ???? } > ?} > > ?[1] > https://github.com/marschall/webrevs/raw/master/Log-getSource-02/webrev.zip > > > Philippe From Roger.Riggs at oracle.com Fri Aug 23 16:55:05 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Fri, 23 Aug 2019 12:55:05 -0400 Subject: [PATCH] Add const to input parameter for JNU_IsInstanceOfByName In-Reply-To: References: <8b5e9d1c-9ad1-a903-ef09-5a0b37a7f49c@oracle.com> Message-ID: <452213de-629a-e259-303e-63bda924b7b7@oracle.com> Hi Andrew, ok, I'll sponsor it. Roger On 8/23/19 1:22 AM, Andrew Luo wrote: > Thanks for reviewing. > > Can someone help sponsor/commit the patch for me? > > Thanks, > > -Andrew > > diff -r 70fab3a8ff02 src/java.base/share/native/libjava/jni_util.c > --- a/src/java.base/share/native/libjava/jni_util.c Tue Jul 16 07:29:12 2019 +0900 > +++ b/src/java.base/share/native/libjava/jni_util.c Mon Jul 15 16:07:35 2019 -0700 > @@ -1096,7 +1096,7 @@ > } > > JNIEXPORT jint JNICALL > -JNU_IsInstanceOfByName(JNIEnv *env, jobject object, char* classname) > +JNU_IsInstanceOfByName(JNIEnv *env, jobject object, const char* classname) > { > jclass cls; > if ((*env)->EnsureLocalCapacity(env, 1) < 0) > diff -r 70fab3a8ff02 src/java.base/share/native/libjava/jni_util.h > --- a/src/java.base/share/native/libjava/jni_util.h Tue Jul 16 07:29:12 2019 +0900 > +++ b/src/java.base/share/native/libjava/jni_util.h Mon Jul 15 16:07:35 2019 -0700 > @@ -208,7 +208,7 @@ > * has been thrown. > */ > JNIEXPORT jint JNICALL > -JNU_IsInstanceOfByName(JNIEnv *env, jobject object, char *classname); > +JNU_IsInstanceOfByName(JNIEnv *env, jobject object, const char *classname); > > > /* Get or set class and instance fields. > > -----Original Message----- > From: Alan Bateman > Sent: Friday, July 19, 2019 4:03 AM > To: Andrew Luo ; core-libs-dev > Subject: Re: [PATCH] Add const to input parameter for JNU_IsInstanceOfByName > > On 16/07/2019 00:10, Andrew Luo wrote: >> Hi Everyone, >> >> I'm making some const-correctness fixes to some downstream libraries that use JNU_* functions, and noticed that JNU_IsInstanceOfByName takes in the class name by char* instead of const char* when it does not need to modify the string. It would be useful to change this so that we don't have to (unnecessarily) const-cast every time and can safely pass string literals to this function. Patch is inline below - any comments/feedback welcome. > This looks okay to me. > > -Alan. From mandy.chung at oracle.com Fri Aug 23 17:08:18 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 23 Aug 2019 10:08:18 -0700 Subject: Remove exception from sun.rmi.runtime.Log#getSource() In-Reply-To: <2db89d34-8d95-68c3-7510-1c95149ce9ba@oracle.com> References: <899eba3c-a82c-1ef4-ce37-54caa4560a61@oracle.com> <9eeaa431-0719-f15c-3cfe-947b244de14a@gmx.net> <2db89d34-8d95-68c3-7510-1c95149ce9ba@oracle.com> Message-ID: <3f6c522c-242e-4ea3-a0e7-baddabd9975e@oracle.com> This patch looks okay to me. Mandy On 8/23/19 8:44 AM, Roger Riggs wrote: > Hi Philippe, > > The change looks good, I'll run it through our tests and push if its > all ok. > (Pending anyone else's comments.) > > On 8/23/19 10:38 AM, Philippe Marschall wrote: >> >> >> On 22.08.19 19:56, Mandy Chung wrote: >>> Hi Philippe, >>> >>> This is a good use of StackWalker. ? getSource can simply return >>> StackFrame and avoid the creation of String[]. >> >> Updated webrev [1] and inline diff at the end. >> >> Something I noted is that we could replace >> sun.rmi.runtime.Log.LogStreamLog.unqualifiedName(String) with >> Class#getSimpleName() which is cached since JDK-8187123. That would >> remove an additional bit of allocation. However only in the pre-1.4 >> logging case, which I assume is uncommon. In addition that would require >> us to create a StackWalker with Option#RETAIN_CLASS_REFERENCE. If we do >> not want to do this in the jul case we would have to create a LogFactory >> specific #getSource implementation with a different StackWalker. I am >> not sure this is worth it. >> >>> Stuart will give you better guidance related to RMI testing. >>> >>> I see that test/jdk/sun/rmi/runtime/Log has a few RMI logging tests. >>> RMI tests are in tier3.? You can run jdk_rmi test group to verify >>> this patch. >> >> I am new to this, I did >> >> make run-test TEST=jdk_rmi >> >> and all tests passed. > That's a start, running the complete suite of tests may catch > something else or another dependency outside of the specific rmi tests. >> >>> I notice that pre-1.4 RMI logging support.? I wonder if this is >>> time to remove it. >> >> I would love to do this but I would assume that requires at least a >> different issue and probably a change note that the property and feature >> are gone. I assume deprecating java.rmi.server.LogStream for removal is >> not an option. > Right, that's a separate issue and takes work and process to remove. >> >> >> I'll be away from a keyboard for a week so I won't be able to answer. > > ok, Enjoy > > Thanks, Roger > >> >> >> --- old/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-23 >> 15:43:28.452810308 +0200 >> +++ new/src/java.rmi/share/classes/sun/rmi/runtime/Log.java 2019-08-23 >> 15:43:28.320811517 +0200 >> @@ -28,8 +28,10 @@ >> ?import java.io.ByteArrayOutputStream; >> ?import java.io.PrintStream; >> ?import java.io.OutputStream; >> +import java.lang.StackWalker.StackFrame; >> ?import java.rmi.server.LogStream; >> ?import java.security.PrivilegedAction; >> +import java.util.Set; >> ?import java.util.logging.Handler; >> ?import java.util.logging.SimpleFormatter; >> ?import java.util.logging.Level; >> @@ -62,6 +64,8 @@ >> ???? public static final Level BRIEF = Level.FINE; >> ???? public static final Level VERBOSE = Level.FINER; >> >> +??? private static final StackWalker WALKER = >> StackWalker.getInstance(Set.of(), 4); >> + >> ???? /* selects log implementation */ >> ???? private static final LogFactory logFactory; >> ???? static { >> @@ -217,16 +221,16 @@ >> >> ???????? public void log(Level level, String message) { >> ???????????? if (isLoggable(level)) { >> -??????????????? String[] source = getSource(); >> -??????????????? logger.logp(level, source[0], source[1], >> +??????????????? StackFrame sourceFrame = getSource(); >> +??????????????? logger.logp(level, sourceFrame.getClassName(), >> sourceFrame.getMethodName(), >> ??????????????????????????? Thread.currentThread().getName() + ": " + >> message); >> ???????????? } >> ???????? } >> >> ???????? public void log(Level level, String message, Throwable >> thrown) { >> ???????????? if (isLoggable(level)) { >> -??????????????? String[] source = getSource(); >> -??????????????? logger.logp(level, source[0], source[1], >> +??????????????? StackFrame sourceFrame = getSource(); >> +??????????????? logger.logp(level, sourceFrame.getClassName(), >> sourceFrame.getMethodName(), >> ???????????????????? Thread.currentThread().getName() + ": " + >> ??????????????????????????? message, thrown); >> ???????????? } >> @@ -390,9 +394,9 @@ >> >> ???????? public void log(Level messageLevel, String message) { >> ???????????? if (isLoggable(messageLevel)) { >> -??????????????? String[] source = getSource(); >> -??????????????? stream.println(unqualifiedName(source[0]) + >> -?????????????????????????????? "." + source[1] + ": " + message); >> +??????????????? StackFrame sourceFrame = getSource(); >> + >> stream.println(unqualifiedName(sourceFrame.getClassName()) + >> +?????????????????????????????? "." + sourceFrame.getMethodName() + ": " >> + message); >> ???????????? } >> ???????? } >> >> @@ -403,9 +407,9 @@ >> ????????????????? * RemoteServer.getLog >> ????????????????? */ >> ???????????????? synchronized (stream) { >> -??????????????????? String[] source = getSource(); >> -??????????????????? stream.println(unqualifiedName(source[0]) + "." + >> -?????????????????????????????????? source[1] + ": " + message); >> +??????????????????? StackFrame sourceFrame = getSource(); >> + >> stream.println(unqualifiedName(sourceFrame.getClassName()) + "." + >> +??????????????????????????????????? sourceFrame.getMethodName() + ": " >> + message); >> ???????????????????? thrown.printStackTrace(stream); >> ???????????????? } >> ???????????? } >> @@ -441,13 +445,12 @@ >> ???? } >> >> ???? /** >> -???? * Obtain class and method names of code calling a log method. >> +???? * Obtain stack frame of code calling a log method. >> ????? */ >> -??? private static String[] getSource() { >> -??????? StackTraceElement[] trace = (new Exception()).getStackTrace(); >> -??????? return new String[] { >> -??????????? trace[3].getClassName(), >> -??????????? trace[3].getMethodName() >> -??????? }; >> +??? private static StackFrame getSource() { >> +??????? return WALKER.walk(s -> s >> +???????????????????????????????? .skip(3) >> +???????????????????????????????? .findFirst() >> +???????????????????????????????? .get()); >> ???? } >> ?} >> >> ?[1] >> https://github.com/marschall/webrevs/raw/master/Log-getSource-02/webrev.zip >> >> >> Philippe > From brian.burkhalter at oracle.com Fri Aug 23 17:11:15 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 23 Aug 2019 10:11:15 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> Message-ID: <369C2F54-F0C9-4253-83A3-75C7F98AEF17@oracle.com> Hi Ivan, > On Aug 22, 2019, at 1:24 PM, Ivan Gerasimov wrote: > > I have a few further suggestions how to simplify the code. > > [?] Those are all good suggestions: thanks! > Here's the patch, which illustrates all the suggestions above: > http://cr.openjdk.java.net/~igerasim/8229845/00/webrev/ > (I have only run the tests from test/jdk/java/math/BigInteger to verify it). This patch has a problem: 4023 padWithZeros(buf, digits - s.length() + (numGroups - 1) * digitsPerLong[radix]); It is missing parentheses: 4023 padWithZeros(buf, digits - (s.length() + (numGroups - 1) * digitsPerLong[radix])); I was unable to find this by debugging but implemented your suggestions by hand and then found it by diff-ing the patches. My updated versions with your suggestions incorporated are: [1] delta, [2] absolute. I also increased the size of some of the values tested at line 798 of BigIntegerTest. Thanks, Brian [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.03-04/ [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.04/ From huizhe.wang at oracle.com Fri Aug 23 17:58:10 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 23 Aug 2019 10:58:10 -0700 Subject: RFR [14/java.xml] 8229388: ErrorHandler and ContentHandler contain ambiguous/unfinished specification In-Reply-To: <63C0CDBB-14CB-420A-8453-D1B2EDF8F4E4@oracle.com> References: <29f37df9-2b86-b0ca-501f-bc8a2d6ec240@oracle.com> <63C0CDBB-14CB-420A-8453-D1B2EDF8F4E4@oracle.com> Message-ID: Thanks Lance! On 8/22/19 9:56 AM, Lance Andersen wrote: > Hi Joe, > > This looks good overall. > > Best > Lance >> On Aug 21, 2019, at 9:31 PM, Joe Wang > > wrote: >> >> Please review a specification claraficaiton/doc-only change to >> ErrorHandler and ContentHandler. >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8229388 >> CSR: https://bugs.openjdk.java.net/browse/JDK-8229738 >> webrev: http://cr.openjdk.java.net/~joehw/jdk14/8229388/webrev/ >> >> Thanks, >> Joe >> > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From brian.burkhalter at oracle.com Fri Aug 23 18:23:30 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 23 Aug 2019 11:23:30 -0700 Subject: RFR: 8228507: Archive FDBigInteger In-Reply-To: <56dfa19a-76c7-3318-bb6f-7e1a04c9cb44@oracle.com> References: <56dfa19a-76c7-3318-bb6f-7e1a04c9cb44@oracle.com> Message-ID: <56746D44-A746-4A81-9317-FF87EF5A2EEE@oracle.com> Hi Claes, Looks good. One picayune comment: maybe move lines 155-157 to just before line 79. Thanks, Brian > On Jul 24, 2019, at 2:42 AM, Claes Redestad wrote: > > any double<->String conversion will trigger load of > jdk.internal.math.FDBigInteger, which has a static > initializer pre-calculating a relatively large number > of values. > > Archiving these pre-calculated values reduces the time > spent in FDBigInteger. from a couple of > milliseconds down to "nothing". > > Bug: https://bugs.openjdk.java.net/browse/JDK-8228507 > Webrev: http://cr.openjdk.java.net/~redestad/8228507/open.00/ > > Testing: tier1-3 From brian.burkhalter at oracle.com Fri Aug 23 18:26:21 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 23 Aug 2019 11:26:21 -0700 Subject: RFR: 8228581: Archive BigInteger constants In-Reply-To: <5aa5cd2d-ef01-c487-836d-ef86f895af14@oracle.com> References: <861003b5-4f12-cf12-9cfe-395177a1ba2f@oracle.com> <5265baf6-a8e9-4dc3-1e8a-cc9957092f9f@oracle.com> <5aa5cd2d-ef01-c487-836d-ef86f895af14@oracle.com> Message-ID: Hi Claes, > On Aug 23, 2019, at 7:54 AM, Claes Redestad wrote: > > On 2019-08-22 11:47, Alan Bateman wrote: >> On 24/07/2019 14:28, Claes Redestad wrote: >>> Webrev: http://cr.openjdk.java.net/~redestad/8228581/open.00/ >>> >> This looks good to me but I think it would be useful to have Joe or Brian or someone else more steeped in BigInteger to also scan the changes and recommend any additional testing. >> -Alan > > Thanks Alan, > > however, I've chatted with Brian since this one conflicts with changes > in JDK-8229845[1]: some of the optimizations there reduce the amount of > objects created during initialization, which mean we won't profit as > much from archiving, so I'll hold this back until JDK-8229845 is > integrated, rebase and evaluate that this is still a worthwhile > enhancement. If it?s OK with you, I will hold off scanning the changes for this issue until [1] has been resolved one way or another. Thanks, Brian [1] https://bugs.openjdk.java.net/browse/JDK-8229845 From brian.burkhalter at oracle.com Fri Aug 23 18:33:20 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 23 Aug 2019 11:33:20 -0700 Subject: 8187898: PrintStream should override FilterOutputStream#write(byte[]) with a method that has no throws clause In-Reply-To: References: <86A0C35F-93C1-4F45-8723-72B723024B39@oracle.com> <2d6a465b-8f1d-6365-42f7-446381197474@oracle.com> <71C745EA-D0C0-44FE-BBF8-0F9119078AD5@oracle.com> <714892D5-194F-4856-95F1-E38C6D7FF714@oracle.com> <91BF9F6F-5969-40AF-8E51-92D5E045F6D9@oracle.com> <532398EA-B7F8-4803-A038-A0F54DCD460F@oracle.com> <426428C0-F710-4262-9E5A-247D0D267059@oracle.com> <3B543968-6426-4FDC-AF27-D3962BA4814E@oracle.com> <8b8eea87-8b5d-8561-7058-633184ce8976@oracle.com> <533DF576-7B8B-4BC7-BB09-50609116AA56@oracle.com> <064ec92d-7e6d-b499-be9f-7578a1a5fb39@oracle.com> <4f71aae6-8250-67aa-c4ee-d206037af50e@oracle.com> Message-ID: Ping ? ! > On Aug 13, 2019, at 2:28 PM, Brian Burkhalter wrote: > > Reprising discussion of [1] from last month. I updated the patch [2] which now hopefully accounts for the various comments. Specifically the specification of the PrintStream.write(byte[]) override was clarified as follows: > > A) If auto-flush is enabled data will be flushed. > > B) API Note: > * No IOException is actually thrown but the error flag is set instead; > * Refer user to writeBytes(byte[]) and write(byte[],int,int). > > C) Implementation Requirements: > * Equivalent to this.write(buf, 0, buf.length), not super.write(buf, 0, buf.length). > > The implementation is updated as well per the foregoing statement. > > Thanks, > > Brian > > [1] https://bugs.openjdk.java.net/browse/JDK-8187898 > [2] http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.04/ From ivan.gerasimov at oracle.com Fri Aug 23 19:41:10 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 23 Aug 2019 12:41:10 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <369C2F54-F0C9-4253-83A3-75C7F98AEF17@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> <369C2F54-F0C9-4253-83A3-75C7F98AEF17@oracle.com> Message-ID: <7eba7229-6d77-f771-5099-4d2d667c0a4f@oracle.com> Hi Brian. This looks good to me, thanks! One minor comment.? Here: 3990???????????? if (digits > 0) { 3991???????????????? padWithZeros(buf, digits); 3992???????????? } else { 3993???????????????? buf.append('0'); 3994???????????? } I cannot really see how digits may be <= 0, so it seems to me it can be safely replaced by just one line `padWithZeros(buf, digits);`. Alternatively, the entire branch `if (signum == 0) {` can be removed from smallToString (so that this method will only work with strictly positive numbers), and done only for results[1] at line 4083 because it is the only possible source of ZERO values in the process. It also seems that the arithmetic in the very internal loop at 4005-4017 can be slightly optimized, but this probably can be left for another enhancement. With kind regards, Ivan On 8/23/19 10:11 AM, Brian Burkhalter wrote: > Hi Ivan, > >> On Aug 22, 2019, at 1:24 PM, Ivan Gerasimov >> > wrote: >> >> I have a few further suggestions how to simplify the code. >> >> [?] > > Those are all good suggestions: thanks! > >> Here's the patch, which illustrates all the suggestions above: >> http://cr.openjdk.java.net/~igerasim/8229845/00/webrev/ >> (I have only run the tests from test/jdk/java/math/BigInteger to >> verify it). > > This patch has a problem: > 4023 padWithZeros(buf, digits - s.length() + (numGroups - 1) * > digitsPerLong[radix]); > It is missing parentheses: > > 4023 ? ? ? ? padWithZeros(buf, digits - (s.length() + (numGroups - 1) > * digitsPerLong[radix])); > > I was unable to find this by debugging but implemented your > suggestions by hand and then found it by diff-ing the patches. My > updated versions with your suggestions incorporated are: [1] delta, > [2] absolute. I also increased the size of some of the values tested > at line 798 of BigIntegerTest. > > Thanks, > > Brian > > [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.03-04/ > [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.04/ > -- With kind regards, Ivan Gerasimov From brian.burkhalter at oracle.com Fri Aug 23 20:33:31 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 23 Aug 2019 13:33:31 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <7eba7229-6d77-f771-5099-4d2d667c0a4f@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> <369C2F54-F0C9-4253-83A3-75C7F98AEF17@oracle.com> <7eba7229-6d77-f771-5099-4d2d667c0a4f@oracle.com> Message-ID: <64A2F7FA-99CD-4B3F-AE7C-9C619B93317B@oracle.com> Hi Ivan, > On Aug 23, 2019, at 12:41 PM, Ivan Gerasimov wrote: > > One minor comment. Here: > 3990 if (digits > 0) { > 3991 padWithZeros(buf, digits); > 3992 } else { > 3993 buf.append('0'); > 3994 } > > I cannot really see how digits may be <= 0, so it seems to me it can be safely replaced by just one line `padWithZeros(buf, digits);`. Actually I don?t see how digits may be non-positive for signum == 0 either. I?ve reduced the above to one line (L3990) in [1]. That is the only change versus version .04. > Alternatively, the entire branch `if (signum == 0) {` can be removed from smallToString (so that this method will only work with strictly positive numbers), and done only for results[1] at line 4083 because it is the only possible source of ZERO values in the process. > > It also seems that the arithmetic in the very internal loop at 4005-4017 can be slightly optimized, but this probably can be left for another enhancement. I think I?ll leave it as is for now. Thanks! Brian [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.05/ From ivan.gerasimov at oracle.com Fri Aug 23 22:18:18 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 23 Aug 2019 15:18:18 -0700 Subject: 8229845: Decrease memory consumption of BigInteger.toString() In-Reply-To: <64A2F7FA-99CD-4B3F-AE7C-9C619B93317B@oracle.com> References: <29F736D3-F358-49B0-9D94-53814BF56951@oracle.com> <40fb586e-0e26-6cdc-6f53-8e6bbe28a02e@oracle.com> <830F4393-FD97-483C-B01C-BB4B54312D18@oracle.com> <48EF88A7-9B73-46B7-864C-BFDF4D7E64A3@oracle.com> <2658E45D-5868-4BC2-9560-85B22A871272@oracle.com> <369C2F54-F0C9-4253-83A3-75C7F98AEF17@oracle.com> <7eba7229-6d77-f771-5099-4d2d667c0a4f@oracle.com> <64A2F7FA-99CD-4B3F-AE7C-9C619B93317B@oracle.com> Message-ID: Thank you Brian! This looks good to me. With kind regards, Ivan On 8/23/19 1:33 PM, Brian Burkhalter wrote: > Hi Ivan, > >> On Aug 23, 2019, at 12:41 PM, Ivan Gerasimov >> > wrote: >> >> One minor comment.? Here: >> 3990 if (digits > 0) { >> 3991 padWithZeros(buf, digits); >> 3992 } else { >> 3993 buf.append('0'); >> 3994 } >> >> I cannot really see how digits may be <= 0, so it seems to me it can >> be safely replaced by just one line `padWithZeros(buf, digits);`. > > Actually I don?t see how digits may be non-positive for signum == 0 > either. I?ve reduced the above to one line (L3990) in [1]. That is the > only change versus version .04. > >> Alternatively, the entire branch `if (signum == 0) {` can be removed >> from smallToString (so that this method will only work with strictly >> positive numbers), and done only for results[1] at line 4083 because >> it is the only possible source of ZERO values in the process. >> >> It also seems that the arithmetic in the very internal loop at >> 4005-4017 can be slightly optimized, but this probably can be left >> for another enhancement. > > I think I?ll leave it as is for now. > > Thanks! > > Brian > > [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.05/ -- With kind regards, Ivan Gerasimov From Alan.Bateman at oracle.com Sat Aug 24 08:00:50 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 24 Aug 2019 09:00:50 +0100 Subject: RFR: 8230043: Lazily load libverify In-Reply-To: References: Message-ID: <9f721650-dfa1-71f4-4165-286af665a823@oracle.com> On 23/08/2019 14:08, Claes Redestad wrote: > Hi, > > please review this cleanup to untangle the old bytecode verifier > (libverify). It's currently linked and loaded eagerly and early during > bootstrap. > > Webrev: http://cr.openjdk.java.net/~redestad/8230043/webrev.00/ > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8230043 > This mostly looks good to me. One thing that I'm wondering if whether the fixClassname usages could be replaced with verifyFixClassname as the former will abort the replace when a UTF-8 sequence can't be decoded. I think the comments (which pre-date your changes) also need to be re-examined as verifyFixClassname as it will return JNI_FALSE when the scan is aborted. -Alan. From claes.redestad at oracle.com Sun Aug 25 19:35:52 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Sun, 25 Aug 2019 21:35:52 +0200 Subject: RFR: 8230043: Lazily load libverify In-Reply-To: <9f721650-dfa1-71f4-4165-286af665a823@oracle.com> References: <9f721650-dfa1-71f4-4165-286af665a823@oracle.com> Message-ID: Hi Alan, On 2019-08-24 10:00, Alan Bateman wrote: > On 23/08/2019 14:08, Claes Redestad wrote: >> Hi, >> >> please review this cleanup to untangle the old bytecode verifier >> (libverify). It's currently linked and loaded eagerly and early during >> bootstrap. >> >> Webrev: http://cr.openjdk.java.net/~redestad/8230043/webrev.00/ >> Bug:??? https://bugs.openjdk.java.net/browse/JDK-8230043 >> > This mostly looks good to me. thanks for looking at this. > > One thing that I'm wondering if whether the fixClassname usages could be > replaced with verifyFixClassname as the former will abort the replace > when a UTF-8 sequence can't be decoded. I think the comments (which > pre-date your changes) also need to be re-examined as verifyFixClassname > as it will return JNI_FALSE when the scan is aborted. > Both functions abort similarly if UTF-8 sequences can't be decoded. The fix- version just gets rid of logic to check for slashes, which is redundant at all existing call sites except the Class.forName one. The fact we return JNI_FALSE when verifyFixClassname fails is a bit odd: this means we'll go into verifyClassname, fail the same way, and still throw a CNFE, just with a slightly different message. /Claes From claes.redestad at oracle.com Sun Aug 25 19:45:55 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Sun, 25 Aug 2019 21:45:55 +0200 Subject: RFC: DMH lambda form arguments by jlink In-Reply-To: References: Message-ID: (bcc jdk-dev, add core-libs-dev) Hi Andrey, I think you might be right that L_L of invoke virtual is non-sensical and should be removed. I vaguely recall that it at one point have been coded so that the receiver was implied for these forms when translating. Also worth noting that the intent was to remove the hardcoded "default" signatures as the technique to record the set of LFs generated by typical applications matured. I think we might be at that point now, and should evaluate if all these "defaults" in GenerateJLIClassesPlugin can be removed. Thanks! /Claes On 2019-08-23 19:28, Andrey Petushkov wrote: > Dear JDK developers, > > (I'm apologising if posted to wrong alias, please forward as appropriate) > > The question is about lambda form cache, created by jlink. More precisely > by jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java. > It appears to me that it has a bug in set of signatures, specifically in > attempt to create LF for invocation of invokevirtual type with signature of > "L_L" [1]. According to documentation [2] and supported by the code the > arguments to lambda form must be the arguments of the target method > prepended by DMH itself. Hence the invokevirtual linkage should always be > supplied with at least two oop arguments coming first (DMH and receiver) > > If I'm correct this bug is totally harmless, since such lambda form > although buggy (the native wrapper for respective MethodHandle intrinsic > have register clash between receiver (receiver_reg) and MemberName > (member_reg) at [3]) it will never be actually used, because the actual MH > invoke will not have such signature. But for the sake of consistency I'd > rather remove the signature in question. > > The problem is actually found by jtreg tests on aarch32 platform [4] > (please don't confuse with arm port) where it happen to exist assert > checking for mentioned register clash [5] > > Will be happy if someone could confirm if this is indeed correct > description of what's happening or point to mistake in analysis, as > appropriate > > Thanks, > Andrey > > [1] > http://hg.openjdk.java.net/jdk/jdk/file/00bf1e66de11/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java#l151 > [2] https://wiki.openjdk.java.net/display/HotSpot/Direct+method+handles > [3] > http://hg.openjdk.java.net/jdk/jdk/file/00bf1e66de11/src/hotspot/cpu/x86/methodHandles_x86.cpp#l293 > [4] > https://mail.openjdk.java.net/pipermail/aarch32-port-dev/2018-September/001093.html > [5] > http://cr.openjdk.java.net/~apetushkov/aarch32jdk11%2b28/src/hotspot/cpu/aarch32/methodHandles_aarch32.cpp.html > line > 269 > From david.holmes at oracle.com Mon Aug 26 05:12:15 2019 From: david.holmes at oracle.com (David Holmes) Date: Mon, 26 Aug 2019 15:12:15 +1000 Subject: RFR: 8230043: Lazily load libverify In-Reply-To: References: Message-ID: Hi Claes, This cleanup all appears fine to me. The unused Mutex declarations might be better handled in a separate RFE but I don't insist. You could file the RFE and still fix together in this one changeset. > Testing: tier1-4 Do you know which tests actually test the older verifier? Just thinking that it might be a good idea to make them more obvious. Thanks, David On 23/08/2019 11:08 pm, Claes Redestad wrote: > Hi, > > please review this cleanup to untangle the old bytecode verifier > (libverify). It's currently linked and loaded eagerly and early during > bootstrap. > > Webrev: http://cr.openjdk.java.net/~redestad/8230043/webrev.00/ > Bug:??? https://bugs.openjdk.java.net/browse/JDK-8230043 > > - removes dependency on libverify from libjava by moving the > check_format.c functions into libjava (they don't need to be exported > via JNI) > - fixed build to not link libjava with libverify > - removes the eager initialization of libverify in > os::native_java_library > - removes the verify_stubs and directs verifier.cpp to load and call > VerifyClassForMajorVersion in libverify directly. The initialization > is synchronized on a new mutex, Verify_lock > - remove the unused VerifyClass entry point and simplify code in the > verifier by removing some indirections > > Testing: tier1-4 > > Thanks! > > /Claes From claes.redestad at oracle.com Mon Aug 26 10:46:18 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 26 Aug 2019 12:46:18 +0200 Subject: RFR: 8230043: Lazily load libverify In-Reply-To: References: Message-ID: Hi David, On 2019-08-26 07:12, David Holmes wrote: > Hi Claes, > > This cleanup all appears fine to me. > > The unused Mutex declarations might be better handled in a separate RFE > but I don't insist. You could file the RFE and still fix together in > this one changeset. fair enough: https://bugs.openjdk.java.net/browse/JDK-8230140 > >> Testing: tier1-4 > > Do you know which tests actually test the older verifier? Just thinking > that it might be a good idea to make them more obvious. I'm not too familiar with the testing in this area, but was told there are quite a few JCK tests that test the byte code verifiers, libverify included, and that we run the full set of those in tier3. Thanks /Claes From sgehwolf at redhat.com Mon Aug 26 15:54:04 2019 From: sgehwolf at redhat.com (Severin Gehwolf) Date: Mon, 26 Aug 2019 17:54:04 +0200 Subject: [8u] RFR: 8213734: SAXParser.parse(File, ..) does not close resources when Exception occurs. Message-ID: <0a64931ab640afd557f4bd46aa7bb05512bc79d6.camel@redhat.com> Hi, Please review this 8u backport. The OpenJDK 11u patch does not apply cleanly after path-reshuffeling due to a) test and code for jaxp are split in JDK 8 b) Some rejects in comments - copyright and last modified date. I've omitted rejected comments. I can manually add them if that's preferred. See below. Bug: https://bugs.openjdk.java.net/browse/JDK-8213734 webrevs: jdk: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8213734/jdk8/jdk/01/webrev/ jaxp: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8213734/jdk8/jaxp/01/webrev/ Testing: tier1 on Linux x86_64. javax/xml/jaxp tests. New test on Windows without the fix fails and passes with it. Thanks to Simon Tooke who helped testing this patch on Windows. Rejects: $ cat src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java.rej --- XMLEntityManager.java +++ XMLEntityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -89,7 +89,7 @@ * @author K.Venugopal SUN Microsystems * @author Neeraj Bajaj SUN Microsystems * @author Sunitha Reddy SUN Microsystems - * @LastModified: Oct 2017 + * @LastModified: Nov 2018 */ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { Thoughts? Thanks, Severin From andy.herrick at oracle.com Mon Aug 26 16:40:45 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Mon, 26 Aug 2019 12:40:45 -0400 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> References: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> Message-ID: <001261e9-e8a0-1150-a6c5-03a99cfa9a37@oracle.com> Thanks for your feedback. I wanted to let you know we are, or soon will be, looking these issues, so I am responding before I have had a chance to look at them all ... On 8/22/2019 9:42 AM, Michael Paus wrote: > Thanks for the EA version of jpackage. Great job. I wish this could > still make it into Java 13. > > Here is a little feedback according to my practical experience with it: > > Add type "img", "app" or similar to --package-type. > It makes the handling in scripts easier. I totally agree, and would propose "app-image" as a valid target "package-type" on all platforms, meaning the same thing as currently implemented when no package-type is specified (then the default value of "package-type" would just be "app-image" > > DMG folder does not contain an alias to "Applications" as usual. I can see this as well, and will inquire of our installer experts how to implement this. > > DMG folder does not contain a background image. This has been discussed before - without resolution yet. Do we need a new mac specific option to declare a background image ? > > DMG file has only the default icon but not an application specific icon. I think I see what you mean, the dmg file in finder shows the default dmg icon, when clicked on, the new finder windows shows the dmg file with the custom icon properly. > > PKG installer shows only the default java icon but not an application > specific icon. The original pkg file shows a default "pkg" icon, but when clicked on the pkg installer shows the default packager javacup icon, instead of the icon specified by --icon option. > > Help message printed for --help: > > --icon should mention the possible file types. (Seems to be only > ".icns" for the Mac) Yes - there is only one icon format per platform (and it is ".icns" on macOS).? This should be better documented. > > There is no further text after > "Platform dependent options for creating the application package:" > Is there something missing? Are all the --mac-* options not platform > dependent? All the --mac-* options are "option for creating the application launcher" (since the need to go into the Info.plist) so there are none left in the "Platform dependent options for creating the application package:".? We should probably skip this header line if it has no content. (Similarly, there are no "Platform dependent option for creating the application launcher" on linux.) > > > On Windows: > > The docs should describe which version of WiX should be installed and > how. E.g., > > it is not possible to install the reccomended version on Windows 10 > due to some > > missing .Net dependencies. I haven't used Windows 10 myself , but soon will.? I filed a bug this morning that when no wix is found in the path, no appropriate error message is shown. This error message might be a good place to state exactly what versions of wix are required on each version of Windows. > > > Wishlist for the future: > > Allow to specify a single PNG file or a folder with several PNG files > in various sizes > as the --icon option and generate the platform specific icons internally. Yes - we had others comment on the inability to use images of multiple sizes, and need to look into that as well. Auto-generating the proper icon format from a standard image format is also worth considering. I will be filing issues on most of the above this week, as I investigate further. /Andy From tvasset at cisco.com Mon Aug 26 18:27:19 2019 From: tvasset at cisco.com (Tom Vasset (tvasset)) Date: Mon, 26 Aug 2019 18:27:19 +0000 Subject: WiX customization Message-ID: Hi, I've been experimenting with jpackage for packaging an app with both a win and a mac installer. For the windows installer, are there ways to customize the WiX files produced by jpackage? A simple example is to get rid of the default red WiX icons in the installer and replace them with product specific ones (which I would think anyone building an msi would want to do). I've tried to find documentation for how to work with the --resource-dir option (which seems to allow a script to be run), but I can find no examples of how to use it anywhere... Regards, Tom From OGATAK at jp.ibm.com Tue Aug 27 06:41:40 2019 From: OGATAK at jp.ibm.com (Kazunori Ogata) Date: Tue, 27 Aug 2019 15:41:40 +0900 Subject: RFR: JDK-8229871: Improve performance of Method.copy() and leafCopy() In-Reply-To: References: <80be43d7-826b-355a-6b8d-bf75ce3630e7@oracle.com> Message-ID: Hi Mandy, Let me post interim results of the performance evaluation, though I'm still measuring benchmarks and analyzing them. For SPECjbb2015, skipping storing null (webrev.01) was faster than making methodAccessor non-volatile (webrev.02). The improvements of each of the patches in maxJOPS/criticalJOPS were 2.6%/3.9% and 1.8%/2.9%, respectively. This is only an average of six runs. For DaCapo, the results were mixed. In some benchmark, both of the changes degraded performance. In some others, webrev.01 was better, but weberv.02 was better in some others. I'll continue evaluation, but it is helpful if you could give me some hints on why webrev.01 can be better than webrev.02 in SPECjbb2015. Regards, Ogata Kazunori Ogata/Japan/IBM wrote on 2019/08/21 20:02:41: > From: Kazunori Ogata/Japan/IBM > To: Mandy Chung > Cc: core-libs-dev at openjdk.java.net > Date: 2019/08/21 20:02 > Subject: Re: RFR: JDK-8229871: Improve performance of Method.copy() and leafCopy() > > Hi Mandy, > > Thank you for reviewing the webrev. I updated it to add a space after > "if" and also put four spaces for indentation (it was three). > > http://cr.openjdk.java.net/~ogatak/8229871/webrev.01/ > > Thank you so much for checking the history of fieldAccessor. I was > surprised that fieldAccessor was made non-volatile in JDK5, but > methodAccessor was left as volatile for 15 years after that... > > I agree we need benchmark data. My simple micro benchmark that repeats > invoking Class.getMethods() improved performance by 70% when it made non- > volatile (as shown in the following webrev). I'll try to run larger > benchmarks, such as SPECjbb2015, to see real impact. > > http://cr.openjdk.java.net/~ogatak/8229871/webrev.02/ > > Regards, > Ogata > > Mandy Chung wrote on 2019/08/21 01:21:42: > > > From: Mandy Chung > > To: Kazunori Ogata > > Cc: core-libs-dev at openjdk.java.net > > Date: 2019/08/21 01:21 > > Subject: [EXTERNAL] Re: RFR: JDK-8229871: Imporve performance of > > Method.copy() and leafCopy() > > > > Hi Ogata, > > > > The patch looks okay. Nit: please add a space between if and (. > > > > About volatile methodAccessor field, I checked the history. Both > > fieldAccessor and methodAccessor were started as volatile and the > > fieldAccessor declaration was updated due to JDK-5044412. As you > > observe, I think the methodAccessor field could be made non-volatile. > > OTOH that might impact when it's inflated to spin bytecode for this > > method invocation. I don't know how importance to keep its volatile vs > > non-volatile in practice without doing benchmarking/real application > > testing. > > > > Mandy > > > > On 8/19/19 2:51 AM, Kazunori Ogata wrote: > > > Hi, > > > > > > May I have review for "JDK-8229871: Imporve performance of Method.copy() > > > and leafCopy()"? > > > > > > Method.copy() and leafCopy() creates a copy of a Method object with > > > sharing MethodAccessor object. Since the methodAccessor field is a > > > volatile variable, copying this field needs memory fence to ensure the > > > field is visible to all threads on the weak memory platforms such as POWER > > > and ARM. > > > > > > When the methodAccessor of the root object is null (i.e., not initialized > > > yet), we do not need to copy the null value because this field of the > > > copied object has been initialized to null in the constructor. We can > > > reduce overhead of the memory fence only when the root's methodAccessor is > > > non-null. This change improved performance by 5.8% using a micro benchmark > > > that repeatedly invokes Class.getMethods(). > > > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8229871 > > > > > > Webrev: http://cr.openjdk.java.net/~ogatak/8229871/webrev.00/ > > > > > > > > > By the way, why Method.methodAccessor is volatile, while > > > Field.fieldAccessor and Field.overrideFieldAccessor are not volatile? I > > > know the use of volatile reduces probability of creating duplicated method > > > accessor, but the chance still exists. I couldn't find the difference > > > between Method and Field classes to make Method.methodAccessor volatile. > > > If we can make it non-volatile, it is more preferable than a quick hack > > > above. > > > > > > > > > Regards, > > > Ogata > > > > > > > From tobias.oelgarte at gmail.com Tue Aug 27 06:44:20 2019 From: tobias.oelgarte at gmail.com (Tobias Oelgarte) Date: Tue, 27 Aug 2019 08:44:20 +0200 Subject: WiX customization In-Reply-To: References: Message-ID: I would also be interested in that. At least I would like to know where I can find the default files used by jpackage and how to override/modify them if needed. The current documentation only mentions the --resource-dir option, but does not provide any detailed information. Am 26.08.2019 um 20:27 schrieb Tom Vasset (tvasset): > Hi, > > I've been experimenting with jpackage for packaging an app with both a win and a mac installer. > > For the windows installer, are there ways to customize the WiX files produced by jpackage? A simple example is to get rid of the default red WiX icons in the installer and replace them with product specific ones (which I would think anyone building an msi would want to do). > > I've tried to find documentation for how to work with the --resource-dir option (which seems to allow a script to be run), but I can find no examples of how to use it anywhere... > > Regards, > > Tom From Schnoor.Jonas at scheidt-bachmann-st.de Tue Aug 27 08:06:55 2019 From: Schnoor.Jonas at scheidt-bachmann-st.de (Schnoor Jonas) Date: Tue, 27 Aug 2019 08:06:55 +0000 Subject: AW: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <001261e9-e8a0-1150-a6c5-03a99cfa9a37@oracle.com> References: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> <001261e9-e8a0-1150-a6c5-03a99cfa9a37@oracle.com> Message-ID: <6EC507C4A8A6514C8C72779A588B2DDD3DC5D3D9@KI-VS-EX.ki.lan> First of all: Thank you very much for JPackage. This looks very promising. To give some feedback: I just tried JPackage on Windows 10 and I believe I ran into this bug: https://bugs.openjdk.java.net/browse/JDK-8211299 It says the bug is fixed but I do not see anything written to either System.out or System.err. To make sure it was not something I am doing inside my application I tested it with a simple "Hello World" example and got the same result. When executing the JAR file directly using java -jar I get the expected output in the CMD window. Can someone confirm this? Is this expected behaviour? BTW: When running the application inside the Git Bash (with MinGW) the output is displayed. But inside a Powershell/CMD window the output is _not_ displayed. If the application is started from a batch file no output is displayed either. -- Jonas Please see our data privacy policy: https://www.scheidt-bachmann.de/en/data-privacy/ Important Notice: This E-Mail and any files attached are confidential and may contain privileged information. If you are not the intended recipient, do not forward or disclose this E-Mail, open any attachments, make any copies or save this E-Mail anywhere. Please delete this E-Mail from your system and notify the sender (as applicable also by phone +49 2166 266-0). Thank you very much. To send this email we must process the following personal data: Your email address, first name and surname. Your data is processed solely for the purpose of sending this email and passed on to third parties only for this purpose. You have been included in the circle of recipients for our emails due to your professional, social or political position. If this position changes, or you inform us that you do not want to receive emails from us, or you object to the further processing of your data, we will delete your data and no longer use it. From frank.yuan at oracle.com Tue Aug 27 09:06:52 2019 From: frank.yuan at oracle.com (Frank Yuan) Date: Tue, 27 Aug 2019 17:06:52 +0800 Subject: RFR (14) [testbug]: runs zero test, 8230002 and 8230010 Message-ID: <008701d55cb6$c6bf5990$543e0cb0$@oracle.com> Hi all We found 2 jaxp tests, which didn't run indeed. Bugs: https://bugs.openjdk.java.net/browse/JDK-8230002 Annotation @Test was missed in TestNG test. https://bugs.openjdk.java.net/browse/JDK-8230010 The old test was left during it was converted to TestNG test. Webrev: http://cr.openjdk.java.net/~fyuan/8230002_8230010/webrev.00/ Thanks Frank From vyommani at gmail.com Tue Aug 27 09:59:44 2019 From: vyommani at gmail.com (Vyom Tiwari) Date: Tue, 27 Aug 2019 15:29:44 +0530 Subject: RFR (14) [testbug]: runs zero test, 8230002 and 8230010 In-Reply-To: <008701d55cb6$c6bf5990$543e0cb0$@oracle.com> References: <008701d55cb6$c6bf5990$543e0cb0$@oracle.com> Message-ID: Hi Frank, Changes looks good to me. Thanks, Vyom On Tue, Aug 27, 2019 at 2:37 PM Frank Yuan wrote: > Hi all > > > > We found 2 jaxp tests, which didn't run indeed. > > > > Bugs: > > https://bugs.openjdk.java.net/browse/JDK-8230002 > > Annotation @Test was missed in TestNG test. > > > > https://bugs.openjdk.java.net/browse/JDK-8230010 > > The old test was left during it was converted to TestNG test. > > > > Webrev: > > http://cr.openjdk.java.net/~fyuan/8230002_8230010/webrev.00/ > > > > Thanks > > Frank > > -- Thanks, Vyom From andy.herrick at oracle.com Tue Aug 27 12:18:06 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Tue, 27 Aug 2019 08:18:06 -0400 Subject: AW: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <6EC507C4A8A6514C8C72779A588B2DDD3DC5D3D9@KI-VS-EX.ki.lan> References: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> <001261e9-e8a0-1150-a6c5-03a99cfa9a37@oracle.com> <6EC507C4A8A6514C8C72779A588B2DDD3DC5D3D9@KI-VS-EX.ki.lan> Message-ID: to address this we added the option --win-console. I'm not sure why the comments in JDK-8211299 are marked as confidential (so you can't see them), but using --win-console option makes running the app more like running "java.exe" instead of "javaw.exe" (where stderr/stdout will not show). I added a non-confidential comment to JDK-8211299 to that effect. /Andy On 8/27/2019 4:06 AM, Schnoor Jonas wrote: > First of all: Thank you very much for JPackage. This looks very promising. > > To give some feedback: I just tried JPackage on Windows 10 and I believe I ran into this bug: https://bugs.openjdk.java.net/browse/JDK-8211299 > It says the bug is fixed but I do not see anything written to either System.out or System.err. > To make sure it was not something I am doing inside my application I tested it with a simple "Hello World" example and got the same result. > When executing the JAR file directly using java -jar I get the expected output in the CMD window. > > Can someone confirm this? Is this expected behaviour? > > BTW: When running the application inside the Git Bash (with MinGW) the output is displayed. But inside a Powershell/CMD window the output is _not_ displayed. > If the application is started from a batch file no output is displayed either. > > -- Jonas > > Please see our data privacy policy: https://www.scheidt-bachmann.de/en/data-privacy/ > Important Notice: This E-Mail and any files attached are confidential and may contain privileged information. > If you are not the intended recipient, do not forward or disclose this E-Mail, open any attachments, make any copies or save this E-Mail anywhere. > Please delete this E-Mail from your system and notify the sender (as applicable also by phone +49 2166 266-0). Thank you very much. > > To send this email we must process the following personal data: Your email address, first name and surname. > Your data is processed solely for the purpose of sending this email and passed on to third parties only for this purpose. > You have been included in the circle of recipients for our emails due to your professional, social or political position. If this position changes, or you inform us that you do not want to receive emails from us, or you object to the further processing of your data, we will delete your data and no longer use it. From andy.herrick at oracle.com Tue Aug 27 12:48:10 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Tue, 27 Aug 2019 08:48:10 -0400 Subject: WiX customization In-Reply-To: References: Message-ID: <79dba944-aca3-90f6-bf1a-e81ee03282c0@oracle.com> We are just beginning to work on user documentation, and --resource-dir is one area that will need extensive documentation and examples. (not to mention probably some bug fixes like JDK-8224833 ). basically the proceedure would be as follows: 1.) build your installer first using the --temp-root and --verbose args. 2.) look for verbose output that says something like: > Using default package resource []? (add > to the resource-dir to customize). > you can look in temp-root-path/config to find all the default resources it used, and customize them as you require 2.a) there may also be output that something like: > no default package resource? [script to run after application image is > populated]? (add -post-image.wsf to the resource-dir to > customize). Then you can add you own -post-image.wsf? (though there will be no default script in temp-root-path/config to customize). 3.) now add --resource-dir option, create and put in it (or as in 2.a, "-post-image.wsf>") 4.) now run jpackage again and this time it will take the custom-resource instead of the default. /Andy On 8/27/2019 2:44 AM, Tobias Oelgarte wrote: > I would also be interested in that. At least I would like to know > where I can find the default files used by jpackage and how to > override/modify them if needed. > > The current documentation only mentions the --resource-dir option, but > does not provide any detailed information. > > Am 26.08.2019 um 20:27 schrieb Tom Vasset (tvasset): >> Hi, >> >> I've been experimenting with jpackage for packaging an app with both >> a win and a mac installer. >> >> For the windows installer, are there ways to customize the WiX files >> produced by jpackage? A simple example is to get rid of the default >> red WiX icons in the installer and replace them with product specific >> ones (which I would think anyone building an msi would want to do). >> >> I've tried to find documentation for how to work with the >> --resource-dir option (which seems to allow a script to be run), but >> I can find no examples of how to use it anywhere... >> >> Regards, >> >> Tom > From mandy.chung at oracle.com Tue Aug 27 14:34:11 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 27 Aug 2019 07:34:11 -0700 Subject: RFR: JDK-8229871: Improve performance of Method.copy() and leafCopy() In-Reply-To: References: <80be43d7-826b-355a-6b8d-bf75ce3630e7@oracle.com> Message-ID: <46930b4e-fd48-4638-c2bb-ecde19fe6296@oracle.com> Claes - do you have thoughts on this performance difference? Mandy On 8/26/19 11:41 PM, Kazunori Ogata wrote: > Hi Mandy, > > Let me post interim results of the performance evaluation, though I'm > still measuring benchmarks and analyzing them. > > For SPECjbb2015, skipping storing null (webrev.01) was faster than making > methodAccessor non-volatile (webrev.02). The improvements of each of the > patches in maxJOPS/criticalJOPS were 2.6%/3.9% and 1.8%/2.9%, > respectively. This is only an average of six runs. > > For DaCapo, the results were mixed. In some benchmark, both of the > changes degraded performance. In some others, webrev.01 was better, but > weberv.02 was better in some others. > > I'll continue evaluation, but it is helpful if you could give me some > hints on why webrev.01 can be better than webrev.02 in SPECjbb2015. > > > Regards, > Ogata > > Kazunori Ogata/Japan/IBM wrote on 2019/08/21 20:02:41: > >> From: Kazunori Ogata/Japan/IBM >> To: Mandy Chung >> Cc: core-libs-dev at openjdk.java.net >> Date: 2019/08/21 20:02 >> Subject: Re: RFR: JDK-8229871: Improve performance of Method.copy() and > leafCopy() >> Hi Mandy, >> >> Thank you for reviewing the webrev. I updated it to add a space after >> "if" and also put four spaces for indentation (it was three). >> >> http://cr.openjdk.java.net/~ogatak/8229871/webrev.01/ >> >> Thank you so much for checking the history of fieldAccessor. I was >> surprised that fieldAccessor was made non-volatile in JDK5, but >> methodAccessor was left as volatile for 15 years after that... >> >> I agree we need benchmark data. My simple micro benchmark that repeats >> invoking Class.getMethods() improved performance by 70% when it made > non- >> volatile (as shown in the following webrev). I'll try to run larger >> benchmarks, such as SPECjbb2015, to see real impact. >> >> http://cr.openjdk.java.net/~ogatak/8229871/webrev.02/ >> >> Regards, >> Ogata >> >> Mandy Chung wrote on 2019/08/21 01:21:42: >> >>> From: Mandy Chung >>> To: Kazunori Ogata >>> Cc: core-libs-dev at openjdk.java.net >>> Date: 2019/08/21 01:21 >>> Subject: [EXTERNAL] Re: RFR: JDK-8229871: Imporve performance of >>> Method.copy() and leafCopy() >>> >>> Hi Ogata, >>> >>> The patch looks okay. Nit: please add a space between if and (. >>> >>> About volatile methodAccessor field, I checked the history. Both >>> fieldAccessor and methodAccessor were started as volatile and the >>> fieldAccessor declaration was updated due to JDK-5044412. As you >>> observe, I think the methodAccessor field could be made non-volatile. >>> OTOH that might impact when it's inflated to spin bytecode for this >>> method invocation. I don't know how importance to keep its volatile > vs >>> non-volatile in practice without doing benchmarking/real application >>> testing. >>> >>> Mandy >>> >>> On 8/19/19 2:51 AM, Kazunori Ogata wrote: >>>> Hi, >>>> >>>> May I have review for "JDK-8229871: Imporve performance of > Method.copy() >>>> and leafCopy()"? >>>> >>>> Method.copy() and leafCopy() creates a copy of a Method object with >>>> sharing MethodAccessor object. Since the methodAccessor field is a >>>> volatile variable, copying this field needs memory fence to ensure > the >>>> field is visible to all threads on the weak memory platforms such as > POWER >>>> and ARM. >>>> >>>> When the methodAccessor of the root object is null (i.e., not > initialized >>>> yet), we do not need to copy the null value because this field of > the >>>> copied object has been initialized to null in the constructor. We > can >>>> reduce overhead of the memory fence only when the root's > methodAccessor is >>>> non-null. This change improved performance by 5.8% using a micro > benchmark >>>> that repeatedly invokes Class.getMethods(). >>>> >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8229871 >>>> >>>> Webrev: http://cr.openjdk.java.net/~ogatak/8229871/webrev.00/ >>>> >>>> >>>> By the way, why Method.methodAccessor is volatile, while >>>> Field.fieldAccessor and Field.overrideFieldAccessor are not > volatile? I >>>> know the use of volatile reduces probability of creating duplicated > method >>>> accessor, but the chance still exists. I couldn't find the > difference >>>> between Method and Field classes to make Method.methodAccessor > volatile. >>>> If we can make it non-volatile, it is more preferable than a quick > hack >>>> above. >>>> >>>> >>>> Regards, >>>> Ogata >>>> >>> > From swpalmer at gmail.com Tue Aug 27 14:59:21 2019 From: swpalmer at gmail.com (Scott Palmer) Date: Tue, 27 Aug 2019 10:59:21 -0400 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <6EC507C4A8A6514C8C72779A588B2DDD3DC5D3D9@KI-VS-EX.ki.lan> References: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> <001261e9-e8a0-1150-a6c5-03a99cfa9a37@oracle.com> <6EC507C4A8A6514C8C72779A588B2DDD3DC5D3D9@KI-VS-EX.ki.lan> Message-ID: <43970D73-DDFB-4590-B405-216F3F3E47B2@gmail.com> Unless you added the --win-console option, I think this is expected. Windows has a rather silly concept of console vs. window applications. To avoid a console window popping up when you don?t expected it, the default launcher is in ?window? mode, not ?console? mode. You need to know which kind of windows application you are building. Command line tools like javac would need to be packaged with the --win-console option. Scott > On Aug 27, 2019, at 4:06 AM, Schnoor Jonas wrote: > > First of all: Thank you very much for JPackage. This looks very promising. > > To give some feedback: I just tried JPackage on Windows 10 and I believe I ran into this bug: https://bugs.openjdk.java.net/browse/JDK-8211299 > It says the bug is fixed but I do not see anything written to either System.out or System.err. > To make sure it was not something I am doing inside my application I tested it with a simple "Hello World" example and got the same result. > When executing the JAR file directly using java -jar I get the expected output in the CMD window. > > Can someone confirm this? Is this expected behaviour? > > BTW: When running the application inside the Git Bash (with MinGW) the output is displayed. But inside a Powershell/CMD window the output is _not_ displayed. > If the application is started from a batch file no output is displayed either. > > -- Jonas From alexey.semenyuk at oracle.com Tue Aug 27 15:29:17 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Tue, 27 Aug 2019 11:29:17 -0400 Subject: WiX customization In-Reply-To: <79dba944-aca3-90f6-bf1a-e81ee03282c0@oracle.com> References: <79dba944-aca3-90f6-bf1a-e81ee03282c0@oracle.com> Message-ID: <0e7b666c-0061-55c8-c7fa-f31556cb813b@oracle.com> The default WiX source file used by jpackage is [1]. WiX variables set by jpackage and referenced from this file have "Jp" prefix. The meaning of the variables is explained in doc comment of [2] file. It is also documented what WiX source files are generated by jpackage. So if you need to customize WiX files generated by jpackage before jpackage runs WiX compiler, you can do one of the following from your custom "-post-image.wsf>" script: 1. Replace the default main.wxs with your own file; 2. Edit the default main.wxs produced by jpackage. You can use powershell scripting for this. See [3] [1] http://hg.openjdk.java.net/jdk/sandbox/file/e356758160cd/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs [2] http://hg.openjdk.java.net/jdk/sandbox/file/e356758160cd/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java [3] https://superuser.com/questions/592786/powershell-script-to-update-xml-file-content - Alexey On 8/27/2019 8:48 AM, Andy Herrick wrote: > We are just beginning to work on user documentation, and > --resource-dir is one area that will need extensive documentation and > examples. (not to mention probably some bug fixes like JDK-8224833 > ). > > basically the proceedure would be as follows: > > 1.) build your installer first using the --temp-root > and --verbose args. > > 2.) look for verbose output that says something like: > >> Using default package resource []? (add >> to the resource-dir to customize). >> > you can look in temp-root-path/config to find all the default > resources it used, and customize them as you require > > 2.a) there may also be output that something like: > >> no default package resource? [script to run after application image >> is populated]? (add -post-image.wsf to the resource-dir to >> customize). > Then you can add you own -post-image.wsf? (though there will > be no default script in temp-root-path/config to customize). > > 3.) now add --resource-dir option, create > and put in it (or as in 2.a, > "-post-image.wsf>") > > 4.) now run jpackage again and this time it will take the > custom-resource instead of the default. > > /Andy > > On 8/27/2019 2:44 AM, Tobias Oelgarte wrote: >> I would also be interested in that. At least I would like to know >> where I can find the default files used by jpackage and how to >> override/modify them if needed. >> >> The current documentation only mentions the --resource-dir option, >> but does not provide any detailed information. >> >> Am 26.08.2019 um 20:27 schrieb Tom Vasset (tvasset): >>> Hi, >>> >>> I've been experimenting with jpackage for packaging an app with both >>> a win and a mac installer. >>> >>> For the windows installer, are there ways to customize the WiX files >>> produced by jpackage? A simple example is to get rid of the default >>> red WiX icons in the installer and replace them with product >>> specific ones (which I would think anyone building an msi would want >>> to do). >>> >>> I've tried to find documentation for how to work with the >>> --resource-dir option (which seems to allow a script to be run), but >>> I can find no examples of how to use it anywhere... >>> >>> Regards, >>> >>> Tom >> From huizhe.wang at oracle.com Tue Aug 27 17:05:22 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 27 Aug 2019 10:05:22 -0700 Subject: RFR (14) [testbug]: runs zero test, 8230002 and 8230010 In-Reply-To: <008701d55cb6$c6bf5990$543e0cb0$@oracle.com> References: <008701d55cb6$c6bf5990$543e0cb0$@oracle.com> Message-ID: <93c8e032-f185-c8e9-1ba2-758321f428aa@oracle.com> Hi Frank, Thanks for fixing this. How did you find this out? Are you running some kind of tools? I hope that's the case since then we could be sure there were no other cases in the test suite. The patch looks good. It's fortunate we haven't broken anything ;-) The test passed just fine. Best, Joe On 8/27/19 2:06 AM, Frank Yuan wrote: > Hi all > > > > We found 2 jaxp tests, which didn't run indeed. > > > > Bugs: > > https://bugs.openjdk.java.net/browse/JDK-8230002 > > Annotation @Test was missed in TestNG test. > > > > https://bugs.openjdk.java.net/browse/JDK-8230010 > > The old test was left during it was converted to TestNG test. > > > > Webrev: > > http://cr.openjdk.java.net/~fyuan/8230002_8230010/webrev.00/ > > > > Thanks > > Frank > From huizhe.wang at oracle.com Tue Aug 27 17:20:51 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 27 Aug 2019 10:20:51 -0700 Subject: RFR [14/java.xml] 8230094: CCE in createXMLEventWriter(Result) over an arbitrary XMLStreamWriter Message-ID: <55e22dc5-570e-7fd9-427e-2db5232ec72f@oracle.com> Please review a patch for an issue where a custom impl of XMLStreamWriter caused a CCE. The problem was that our implementation was changed to an internally extended interface. We could consider making it external, but for now, we'll do with a check. Note that there's no material change in XMLOutputFactoryImpl.java except a minor one at line 160. JBS: https://bugs.openjdk.java.net/browse/JDK-8230094 webrev: http://cr.openjdk.java.net/~joehw/jdk14/8230094/webrev/ Thanks, Joe From brian.burkhalter at oracle.com Tue Aug 27 18:00:24 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 27 Aug 2019 11:00:24 -0700 Subject: 8229333: java/io/File/SetLastModified.java timed out Message-ID: The failure reported in [1] was observed to occur on two Mac minis with HDDs. Given the large file access it is possibly due to slow disk access. The suggested fix is to increase the timeout [2]. If it is still observed at a later date a new issue can be filed. Thanks, Brian [1] https://bugs.openjdk.java.net/browse/JDK-8229333 [2] diff: @@ -22,11 +22,13 @@ */ /* @test - @bug 4091757 6652379 8177809 - @summary Basic test for setLastModified method + * @bug 4091757 6652379 8177809 + * @summary Basic test for setLastModified method + * @run main/timeout=180 SetLastModified */ -import java.io.*; +import java.io.File; +import java.io.FileOutputStream; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; From ivan.gerasimov at oracle.com Tue Aug 27 18:21:07 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 27 Aug 2019 11:21:07 -0700 Subject: RFR (S) 8226831 : Use Objects.equals() when appropriate Message-ID: Hello! null-aware comparison of Objects is widely used, so it's tempting to use Objects.equals for that. Unfortunately, there are concerns w.r.t performance (see JDK-8015417), so it seems to better avoid this kind of refactoring in the performance critical code. Please find the webrev with a few places cleaned up (I had more, but decided to limit this patch due to the concern mentioned above). BUGURL: https://bugs.openjdk.java.net/browse/JDK-8226831 WEBREV: http://cr.openjdk.java.net/~igerasim/8226831/00/webrev/ Thanks in advance! -- With kind regards, Ivan Gerasimov From milan.mimica at gmail.com Tue Aug 27 11:35:53 2019 From: milan.mimica at gmail.com (Milan Mimica) Date: Tue, 27 Aug 2019 13:35:53 +0200 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout In-Reply-To: References: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> Message-ID: Hi I agree that makes it more simple, but doing it this way ensures more precise timeout, subtracting the remaining time from global timeout value. I still rely on read() to throw SocketTimeoutException. The solution you suggest would potentially make each read() operation wait almost up to global timoeut value, totaling in a much larger execution time from user's perspective. I was following the pattern how it was done for UDP requests. It uses the same logic. On Tue, 27 Aug 2019 at 10:52, Vyom Tewari26 wrote: > > Hi Milan, > > Thanks for attaching the .dns file, I gone through the changes and it looks like you don't need "readWithTimeout" method to manipulate timeout and throw SocketTimeoutException explicitly. > > ################################### > if (timeoutLeft <= 0) > + throw new SocketTimeoutException(); > ################################### > > Once you set the timeout on socket( sock.setSoTimeout(timeout)), the a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException will be thrown. > > My suggestion is to just set the timeout on socket and remove rest of the additional changes in inner 'Tcp' class. > > Thanks, > Vyom > > > ----- Original message ----- > From: Milan Mimica > Sent by: "core-libs-dev" > To: Vyom Tiwari > Cc: core-libs-dev > Subject: [EXTERNAL] Re: [PATCH] JDK-8228580 DnsClient TCP socket timeout > Date: Fri, Aug 23, 2019 1:17 AM > > Hi > > Indeed I have forgotten. Re-attached, with aesthetic fixes to the test. > > On Thu, 22 Aug 2019 at 05:38, Vyom Tiwari wrote: > > > > Hi Milan, > > > > Your test need the corresponding "TcpTimeout.dns" file to run successfully, I believe you forgot to add with your patch. > > please check the existing tests in the same folder if you need any additional information. > > > > Thanks, > > Vyom > > > > On Wed, Aug 21, 2019 at 10:48 PM Milan Mimica wrote: > >> > >> Hi Pavel > >> > >> Updated the patch with the jtreg test. > >> The test hangs when the fix is not applied. I don't know why > >> main/timeout=20 does not work for me. > >> > >> On Tue, 20 Aug 2019 at 00:08, Pavel Rappo wrote: > >> > > >> > Thanks for doing that. I've only skimmed through the patch and I?d recommend that no matter if the changes are adequate or not there should be a test [1]: > >> > > >> > "...A unit test, written for the jtreg test harness, that validates your change. The test should fail when run against a build without the change and succeed when run against a build with the change. Unit tests aren't always practical, especially for changes such as performance improvements or fixes to bugs that are highly platform-dependent, but if practical then a unit test is required." > >> > > >> > Please consider adding it to the patch while the changes are being (preliminary) reviewed. > >> > > >> > -Pavel > >> > > >> > ------------------------------------------------------------------------------- > >> > [1] https://openjdk.java.net/contribute/ > >> > > >> > > On 19 Aug 2019, at 17:20, Milan Mimica wrote: > >> > > > >> > > Hello list > >> > > > >> > > Please find the attached patch that fixes JDK-8228580. > >> > > > >> > > It works the similar way UDP timeout does: calculate the initial > >> > > timeout from retry attempt, and account for duration of every blocking > >> > > call on the TCP socket. > >> > > > >> > > I am listed as Author[1] on "jdk" project. > >> > > > >> > > [1] https://openjdk.java.net/census#mmimica > >> > > > >> > > > >> > > -- > >> > > Milan Mimica > >> > > > >> > > >> > >> > >> -- > >> Milan Mimica > > > > > > > > -- > > Thanks, > > Vyom > > > > -- > Milan Mimica > > > > -- Milan Mimica From Roger.Riggs at oracle.com Tue Aug 27 19:41:50 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Tue, 27 Aug 2019 15:41:50 -0400 Subject: RFR (S) 8226831 : Use Objects.equals() when appropriate In-Reply-To: References: Message-ID: Hi Ivan, These look fine. Regards, Roger On 8/27/19 2:21 PM, Ivan Gerasimov wrote: > Hello! > > null-aware comparison of Objects is widely used, so it's tempting to > use Objects.equals for that. > > Unfortunately, there are concerns w.r.t performance (see JDK-8015417), > so it seems to better avoid this kind of refactoring in the > performance critical code. > > Please find the webrev with a few places cleaned up (I had more, but > decided to limit this patch due to the concern mentioned above). > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8226831 > WEBREV: http://cr.openjdk.java.net/~igerasim/8226831/00/webrev/ > > Thanks in advance! > From alexey.semenyuk at oracle.com Tue Aug 27 20:13:50 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Tue, 27 Aug 2019 16:13:50 -0400 Subject: RFR: JDK-8228660: .deb files generated by jpackage don't follow naming convention In-Reply-To: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> Message-ID: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - fix implementation of --linux-app-release CLI option for Debian packaging; - use value of --linux-app-release CLI option to construct Debian package name. [1] https://bugs.openjdk.java.net/browse/JDK-8228660 [2] http://cr.openjdk.java.net/~asemenyuk/8228660/webrev.03 Thanks, Alexey From brian.burkhalter at oracle.com Tue Aug 27 20:12:59 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 27 Aug 2019 13:12:59 -0700 Subject: RFR (S) 8226831 : Use Objects.equals() when appropriate In-Reply-To: References: Message-ID: <5D9D52B5-7CDF-4EC8-A7DC-9AEBD635A44A@oracle.com> Hi Ivan, +1 Brian > On Aug 27, 2019, at 12:41 PM, Roger Riggs wrote: > > Hi Ivan, > > These look fine. > > Regards, Roger > > > On 8/27/19 2:21 PM, Ivan Gerasimov wrote: >> Hello! >> >> null-aware comparison of Objects is widely used, so it's tempting to use Objects.equals for that. >> >> Unfortunately, there are concerns w.r.t performance (see JDK-8015417), so it seems to better avoid this kind of refactoring in the performance critical code. >> >> Please find the webrev with a few places cleaned up (I had more, but decided to limit this patch due to the concern mentioned above). >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8226831 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8226831/00/webrev/ >> >> Thanks in advance! >> > From andy.herrick at oracle.com Tue Aug 27 20:29:13 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Tue, 27 Aug 2019 16:29:13 -0400 Subject: RFR: JDK-8228660: .deb files generated by jpackage don't follow naming convention In-Reply-To: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> Message-ID: <484b3918-fc0d-17b3-8b6a-026b5dc4ee84@oracle.com> looks good. /Andy On 8/27/2019 4:13 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - fix implementation of --linux-app-release CLI option for Debian > packaging; > - use value of --linux-app-release CLI option to construct Debian > package name. > > [1] https://bugs.openjdk.java.net/browse/JDK-8228660 > > [2] http://cr.openjdk.java.net/~asemenyuk/8228660/webrev.03 > > Thanks, > Alexey > From kevin.rushforth at oracle.com Tue Aug 27 20:48:20 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Tue, 27 Aug 2019 13:48:20 -0700 Subject: RFR: JDK-8228660: .deb files generated by jpackage don't follow naming convention In-Reply-To: <484b3918-fc0d-17b3-8b6a-026b5dc4ee84@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> <484b3918-fc0d-17b3-8b6a-026b5dc4ee84@oracle.com> Message-ID: <92767681-db85-9f39-0be4-d53bc78c439a@oracle.com> Looks good to me, too. -- Kevin On 8/27/2019 1:29 PM, Andy Herrick wrote: > looks good. > > /Andy > > On 8/27/2019 4:13 PM, Alexey Semenyuk wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - fix implementation of --linux-app-release CLI option for Debian >> packaging; >> - use value of --linux-app-release CLI option to construct Debian >> package name. >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8228660 >> >> [2] http://cr.openjdk.java.net/~asemenyuk/8228660/webrev.03 >> >> Thanks, >> Alexey >> From ivan.gerasimov at oracle.com Tue Aug 27 22:00:44 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 27 Aug 2019 15:00:44 -0700 Subject: RFR (S) 8226831 : Use Objects.equals() when appropriate In-Reply-To: <5D9D52B5-7CDF-4EC8-A7DC-9AEBD635A44A@oracle.com> References: <5D9D52B5-7CDF-4EC8-A7DC-9AEBD635A44A@oracle.com> Message-ID: Thank you Roger and Brian! The fix has been pushed. With kind regards, Ivan On 8/27/19 1:12 PM, Brian Burkhalter wrote: > Hi Ivan, > > +1 > > Brian > >> On Aug 27, 2019, at 12:41 PM, Roger Riggs wrote: >> >> Hi Ivan, >> >> These look fine. >> >> Regards, Roger >> >> >> On 8/27/19 2:21 PM, Ivan Gerasimov wrote: >>> Hello! >>> >>> null-aware comparison of Objects is widely used, so it's tempting to use Objects.equals for that. >>> >>> Unfortunately, there are concerns w.r.t performance (see JDK-8015417), so it seems to better avoid this kind of refactoring in the performance critical code. >>> >>> Please find the webrev with a few places cleaned up (I had more, but decided to limit this patch due to the concern mentioned above). >>> >>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8226831 >>> WEBREV: http://cr.openjdk.java.net/~igerasim/8226831/00/webrev/ >>> >>> Thanks in advance! >>> > -- With kind regards, Ivan Gerasimov From alexander.matveev at oracle.com Tue Aug 27 22:43:29 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Tue, 27 Aug 2019 15:43:29 -0700 Subject: RFR: JDK-8228660: .deb files generated by jpackage don't follow naming convention In-Reply-To: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> Message-ID: <5f85aac8-da7c-2667-d9fb-d4e034038833@oracle.com> Looks good. Thanks, Alexander On 8/27/2019 1:13 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - fix implementation of --linux-app-release CLI option for Debian > packaging; > - use value of --linux-app-release CLI option to construct Debian > package name. > > [1] https://bugs.openjdk.java.net/browse/JDK-8228660 > > [2] http://cr.openjdk.java.net/~asemenyuk/8228660/webrev.03 > > Thanks, > Alexey > From alexey.semenyuk at oracle.com Tue Aug 27 23:25:24 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Tue, 27 Aug 2019 19:25:24 -0400 Subject: RFR: JDK-8224833: jpackages differences between platforms In-Reply-To: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> Message-ID: <041b0464-32bf-9f43-5e64-8c7313cc6d52@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8224833 [2] http://cr.openjdk.java.net/~asemenyuk/8224833/webrev.00/ Thanks, Alexey From alexander.matveev at oracle.com Wed Aug 28 00:29:21 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Tue, 27 Aug 2019 17:29:21 -0700 Subject: RFR: JDK-8224833: jpackages differences between platforms In-Reply-To: <041b0464-32bf-9f43-5e64-8c7313cc6d52@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> <041b0464-32bf-9f43-5e64-8c7313cc6d52@oracle.com> Message-ID: <01f16aaa-d013-cefb-d5ac-f49bb255ab2e@oracle.com> Looks good. Thanks, Alexander On 8/27/2019 4:25 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8224833 > > [2] http://cr.openjdk.java.net/~asemenyuk/8224833/webrev.00/ > > Thanks, > Alexey > From joe.darcy at oracle.com Wed Aug 28 01:28:05 2019 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 27 Aug 2019 18:28:05 -0700 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base Message-ID: Hello, Recent work for JDK-8202385: "Annotation to mark serial-related fields and methods" added the java.io.Serial annotation type to the platform. The intention of this new annotation type is to allow serialization-related fields and methods to be marked as documentation and to allow stricter compile-time checking, analogous to the checking done for @Override. Implementing those stricter serialization-related checks will be done under JDK-8202056. Please review the application of java.io.Serial to types in the base module other than security types: ??? JDK-8229997: Apply java.io.Serial annotations in java.base ??? http://cr.openjdk.java.net/~darcy/8229997.0/ (Security-related types in the base module are being handled under JDK-8229999.) As a reminder, the 5 serialization-related methods and 2 fields are: ??? * private void writeObject(java.io.ObjectOutputStream stream) throws IOException ??? * private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException ??? * private void readObjectNoData() throws ObjectStreamException ??? * ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException ??? * ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException ??? * private static final ObjectStreamField[] serialPersistentFields ??? * private static final long serialVersionUID Due to the separate source code management policies for java.util.concurrent, I did not include that package in this exercise. Likewise, applying the annotation to some of the time-zone related files caused build failures so I excluded those types as well. Thanks, -Joe From frank.yuan at oracle.com Wed Aug 28 02:11:56 2019 From: frank.yuan at oracle.com (Frank Yuan) Date: Wed, 28 Aug 2019 10:11:56 +0800 Subject: RFR (14) [testbug]: runs zero test, 8230002 and 8230010 In-Reply-To: <93c8e032-f185-c8e9-1ba2-758321f428aa@oracle.com> References: <008701d55cb6$c6bf5990$543e0cb0$@oracle.com> <93c8e032-f185-c8e9-1ba2-758321f428aa@oracle.com> Message-ID: <02e801d55d45$fa049ab0$ee0dd010$@oracle.com> Amy found them by grepping in all jtr log, she will setup a regular check since the issue raised from time to time. For this patch, then I will push it. Thanks Frank -----Original Message----- From: Joe Wang [mailto:huizhe.wang at oracle.com] Sent: Wednesday, August 28, 2019 1:05 AM To: Frank Yuan; 'core-libs-dev' Subject: Re: RFR (14) [testbug]: runs zero test, 8230002 and 8230010 Hi Frank, Thanks for fixing this. How did you find this out? Are you running some kind of tools? I hope that's the case since then we could be sure there were no other cases in the test suite. The patch looks good. It's fortunate we haven't broken anything ;-) The test passed just fine. Best, Joe On 8/27/19 2:06 AM, Frank Yuan wrote: > Hi all > > > > We found 2 jaxp tests, which didn't run indeed. > > > > Bugs: > > https://bugs.openjdk.java.net/browse/JDK-8230002 > > Annotation @Test was missed in TestNG test. > > > > https://bugs.openjdk.java.net/browse/JDK-8230010 > > The old test was left during it was converted to TestNG test. > > > > Webrev: > > http://cr.openjdk.java.net/~fyuan/8230002_8230010/webrev.00/ > > > > Thanks > > Frank > From Schnoor.Jonas at scheidt-bachmann-st.de Wed Aug 28 05:33:25 2019 From: Schnoor.Jonas at scheidt-bachmann-st.de (Schnoor Jonas) Date: Wed, 28 Aug 2019 05:33:25 +0000 Subject: AW: AW: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: References: <0951dc05-9bd4-7f3c-f672-4671ee932ec0@jugs.org> <001261e9-e8a0-1150-a6c5-03a99cfa9a37@oracle.com> <6EC507C4A8A6514C8C72779A588B2DDD3DC5D3D9@KI-VS-EX.ki.lan> Message-ID: <6EC507C4A8A6514C8C72779A588B2DDD3DC5D7CE@KI-VS-EX.ki.lan> Adding --win-console does indeed solve the problem. Thank you. Coming from JPackager (the version backported by GluonHQ to Java 11 - see [1]) - which does not have that option - I must have overlooked that in the help output of JPackage. -- Jonas [1] https://mail.openjdk.java.net/pipermail/openjfx-dev/2018-September/022500.html -----Urspr?ngliche Nachricht----- Von: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] Im Auftrag von Andy Herrick Gesendet: Dienstag, 27. August 2019 14:18 An: core-libs-dev at openjdk.java.net Betreff: Re: AW: jdk-14-jpackage+1-33 on jdk.java.net to address this we added the option --win-console. I'm not sure why the comments in JDK-8211299 are marked as confidential (so you can't see them), but using --win-console option makes running the app more like running "java.exe" instead of "javaw.exe" (where stderr/stdout will not show). I added a non-confidential comment to JDK-8211299 to that effect. /Andy On 8/27/2019 4:06 AM, Schnoor Jonas wrote: > First of all: Thank you very much for JPackage. This looks very promising. > > To give some feedback: I just tried JPackage on Windows 10 and I believe I ran into this bug: https://bugs.openjdk.java.net/browse/JDK-8211299 > It says the bug is fixed but I do not see anything written to either System.out or System.err. > To make sure it was not something I am doing inside my application I tested it with a simple "Hello World" example and got the same result. > When executing the JAR file directly using java -jar I get the expected output in the CMD window. > > Can someone confirm this? Is this expected behaviour? > > BTW: When running the application inside the Git Bash (with MinGW) the output is displayed. But inside a Powershell/CMD window the output is _not_ displayed. > If the application is started from a batch file no output is displayed either. > > -- Jonas > > Please see our data privacy policy: https://www.scheidt-bachmann.de/en/data-privacy/ > Important Notice: This E-Mail and any files attached are confidential and may contain privileged information. > If you are not the intended recipient, do not forward or disclose this E-Mail, open any attachments, make any copies or save this E-Mail anywhere. > Please delete this E-Mail from your system and notify the sender (as applicable also by phone +49 2166 266-0). Thank you very much. > > To send this email we must process the following personal data: Your email address, first name and surname. > Your data is processed solely for the purpose of sending this email and passed on to third parties only for this purpose. > You have been included in the circle of recipients for our emails due to your professional, social or political position. If this position changes, or you inform us that you do not want to receive emails from us, or you object to the further processing of your data, we will delete your data and no longer use it. Please see our data privacy policy: https://www.scheidt-bachmann.de/en/data-privacy/ Important Notice: This E-Mail and any files attached are confidential and may contain privileged information. If you are not the intended recipient, do not forward or disclose this E-Mail, open any attachments, make any copies or save this E-Mail anywhere. Please delete this E-Mail from your system and notify the sender (as applicable also by phone +49 2166 266-0). Thank you very much. To send this email we must process the following personal data: Your email address, first name and surname. Your data is processed solely for the purpose of sending this email and passed on to third parties only for this purpose. You have been included in the circle of recipients for our emails due to your professional, social or political position. If this position changes, or you inform us that you do not want to receive emails from us, or you object to the further processing of your data, we will delete your data and no longer use it. From Alan.Bateman at oracle.com Wed Aug 28 06:39:43 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 28 Aug 2019 07:39:43 +0100 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base In-Reply-To: References: Message-ID: <961d73ad-d60e-d0dd-d848-4d629ff75822@oracle.com> On 28/08/2019 02:28, Joe Darcy wrote: > Hello, > > Recent work for JDK-8202385: "Annotation to mark serial-related fields > and methods" added the java.io.Serial annotation type to the platform. > The intention of this new annotation type is to allow > serialization-related fields and methods to be marked as documentation > and to allow stricter compile-time checking, analogous to the checking > done for @Override. Implementing those stricter serialization-related > checks will be done under JDK-8202056. > > Please review the application of java.io.Serial to types in the base > module other than security types: > > ??? JDK-8229997: Apply java.io.Serial annotations in java.base > ??? http://cr.openjdk.java.net/~darcy/8229997.0/ There are exception classes in java.base that are generated at build time so I think you'll need to update make/scripts/genExceptions.sh to ensure that the serialVersionUID in those classes are annotated. -Alan From claes.redestad at oracle.com Wed Aug 28 09:24:30 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Wed, 28 Aug 2019 11:24:30 +0200 Subject: RFC: DMH lambda form arguments by jlink In-Reply-To: References: Message-ID: <4c17491a-7b93-fcae-da2b-60c987db6ad9@oracle.com> Filed: https://bugs.openjdk.java.net/browse/JDK-8230302 to deal with the bug that the plugin can and does generate some invalid DMHs https://bugs.openjdk.java.net/browse/JDK-8230301 to re-examine the ability to hardcode default sets of DMHs, invokers etc. This can and should be controlled by generating and providing a property file to jlink, which we currently do at build time. /Claes On 2019-08-25 21:45, Claes Redestad wrote: > (bcc jdk-dev, add core-libs-dev) > > Hi Andrey, > > I think you might be right that L_L of invoke virtual is non-sensical > and should be removed. I vaguely recall that it at one point have been > coded so that the receiver was implied for these forms when translating. > > Also worth noting that the intent was to remove the hardcoded "default" > signatures as the technique to record the set of LFs generated by > typical applications matured. I think we might be at that point now, and > should evaluate if all these "defaults" in GenerateJLIClassesPlugin can > be removed. > > Thanks! > > /Claes > > On 2019-08-23 19:28, Andrey Petushkov wrote: >> Dear JDK developers, >> >> (I'm apologising if posted to wrong alias, please forward as appropriate) >> >> The question is about lambda form cache, created by jlink. More precisely >> by jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java. >> It appears to me that it has a bug in set of signatures, specifically in >> attempt to create LF for invocation of invokevirtual type with >> signature of >> "L_L" [1]. According to documentation [2] and supported by the code the >> arguments to lambda form must be the arguments of the target method >> prepended by DMH itself. Hence the invokevirtual linkage should always be >> supplied with at least two oop arguments coming first (DMH and receiver) >> >> If I'm correct this bug is totally harmless, since such lambda form >> although buggy (the native wrapper for respective MethodHandle intrinsic >> have register clash between receiver (receiver_reg) and MemberName >> (member_reg) at [3]) it will never be actually used, because the >> actual MH >> invoke will not have such signature. But for the sake of consistency I'd >> rather remove the signature in question. >> >> The problem is actually found by jtreg tests on aarch32 platform [4] >> (please don't confuse with arm port) where it happen to exist assert >> checking for mentioned register clash [5] >> >> Will be happy if someone could confirm if this is indeed correct >> description of what's happening or point to mistake in analysis, as >> appropriate >> >> Thanks, >> Andrey >> >> [1] >> http://hg.openjdk.java.net/jdk/jdk/file/00bf1e66de11/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java#l151 >> >> [2] https://wiki.openjdk.java.net/display/HotSpot/Direct+method+handles >> [3] >> http://hg.openjdk.java.net/jdk/jdk/file/00bf1e66de11/src/hotspot/cpu/x86/methodHandles_x86.cpp#l293 >> >> [4] >> https://mail.openjdk.java.net/pipermail/aarch32-port-dev/2018-September/001093.html >> >> [5] >> http://cr.openjdk.java.net/~apetushkov/aarch32jdk11%2b28/src/hotspot/cpu/aarch32/methodHandles_aarch32.cpp.html >> >> line >> 269 >> From andy.herrick at oracle.com Wed Aug 28 12:12:23 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Wed, 28 Aug 2019 08:12:23 -0400 Subject: RFR: JDK-8224833: jpackages differences between platforms In-Reply-To: <041b0464-32bf-9f43-5e64-8c7313cc6d52@oracle.com> References: <36daddf2-82f2-a4fd-9891-d6b2e8cc3b45@oracle.com> <041b0464-32bf-9f43-5e64-8c7313cc6d52@oracle.com> Message-ID: This looks fine. /Andy On 8/27/2019 7:25 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8224833 > > [2] http://cr.openjdk.java.net/~asemenyuk/8224833/webrev.00/ > > Thanks, > Alexey > From andy.herrick at oracle.com Wed Aug 28 13:36:39 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Wed, 28 Aug 2019 09:36:39 -0400 Subject: RFR: JDK-8229979: jpackage cleanup src files, help text, and javadoc Message-ID: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8229979 [2] http://cr.openjdk.java.net/~herrick/8229979/ Thanks, Andy From claes.redestad at oracle.com Wed Aug 28 14:38:03 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Wed, 28 Aug 2019 16:38:03 +0200 Subject: RFR: 8230302: GenerateJLIClassesPlugin can generate invalid DirectMethodHandle methods Message-ID: Hi, we currently spin code for a non-sensical invokeVirtual DMH, so let's remove that. Such methods are benign since we won't ever attempt to resolve such nonsensical forms, but surely a waste of space. This patch tightens checks conservatively (could possibly apply the same restriction to invokeSpecial?) and adds a few negative tests using inputs that jlink should refuse. Webrev: http://cr.openjdk.java.net/~redestad/8230302/webrev.00/ Testing: tier1+2 Thanks! /Claes From kevin.rushforth at oracle.com Wed Aug 28 14:46:22 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Wed, 28 Aug 2019 07:46:22 -0700 Subject: RFR: JDK-8229979: jpackage cleanup src files, help text, and javadoc In-Reply-To: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> References: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> Message-ID: <2825c3e8-15ac-4db1-b739-d454c4773cfd@oracle.com> Looks good. -- Kevin On 8/28/2019 6:36 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229979 > > [2] http://cr.openjdk.java.net/~herrick/8229979/ > > Thanks, > Andy > > From lance.andersen at oracle.com Wed Aug 28 15:12:31 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 28 Aug 2019 11:12:31 -0400 Subject: RFR [14/java.xml] 8230094: CCE in createXMLEventWriter(Result) over an arbitrary XMLStreamWriter In-Reply-To: <55e22dc5-570e-7fd9-427e-2db5232ec72f@oracle.com> References: <55e22dc5-570e-7fd9-427e-2db5232ec72f@oracle.com> Message-ID: <538836BD-1219-4833-9AEA-0357A062CE24@oracle.com> Hi Joe, The change and test look OK > On Aug 27, 2019, at 1:20 PM, Joe Wang wrote: > > Please review a patch for an issue where a custom impl of XMLStreamWriter caused a CCE. The problem was that our implementation was changed to an internally extended interface. We could consider making it external, but for now, we'll do with a check. > > Note that there's no material change in XMLOutputFactoryImpl.java except a minor one at line 160. took a moment to spot the change here :-) Best Lance > > JBS: https://bugs.openjdk.java.net/browse/JDK-8230094 > webrev: http://cr.openjdk.java.net/~joehw/jdk14/8230094/webrev/ > > Thanks, > Joe Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From alexey.semenyuk at oracle.com Wed Aug 28 15:47:03 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Wed, 28 Aug 2019 11:47:03 -0400 Subject: RFR: JDK-8229979: jpackage cleanup src files, help text, and javadoc In-Reply-To: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> References: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> Message-ID: <1a1e5240-467c-462a-3a3b-f6ee6c418c11@oracle.com> Looks good. Some files in the review contain no diffs though, like http://cr.openjdk.java.net/~herrick/8229979/webrev.01/test/jdk/tools/jpackage/windows/exe/WinUpgradeUUIDTest.java.sdiff.html. Why are they in the review? - Alexey On 8/28/2019 9:36 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8229979 > > [2] http://cr.openjdk.java.net/~herrick/8229979/ > > Thanks, > Andy > > From joe.darcy at oracle.com Wed Aug 28 16:08:18 2019 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 28 Aug 2019 09:08:18 -0700 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base In-Reply-To: <961d73ad-d60e-d0dd-d848-4d629ff75822@oracle.com> References: <961d73ad-d60e-d0dd-d848-4d629ff75822@oracle.com> Message-ID: Hi Alan, On 8/27/2019 11:39 PM, Alan Bateman wrote: > On 28/08/2019 02:28, Joe Darcy wrote: >> Hello, >> >> Recent work for JDK-8202385: "Annotation to mark serial-related >> fields and methods" added the java.io.Serial annotation type to the >> platform. The intention of this new annotation type is to allow >> serialization-related fields and methods to be marked as >> documentation and to allow stricter compile-time checking, analogous >> to the checking done for @Override. Implementing those stricter >> serialization-related checks will be done under JDK-8202056. >> >> Please review the application of java.io.Serial to types in the base >> module other than security types: >> >> ??? JDK-8229997: Apply java.io.Serial annotations in java.base >> ??? http://cr.openjdk.java.net/~darcy/8229997.0/ > There are exception classes in java.base that are generated at build > time so I think you'll need to update make/scripts/genExceptions.sh to > ensure that the serialVersionUID in those classes are annotated. > The intention here is to be "mostly exhaustive" rather than "entirely exhaustive" in applying the annotation type so I'd prefer to defer updating generated exceptions to future work. From some off-list discussions with Stuart and Roger, the envisioned nature of the compile-time checking is that the full suite of new checks would only be enabled if the annotations are present. Some additional checking would occur without the annotation, such as an ineffectual serialVersionUID in an enum type. Thanks, -Joe From martinrb at google.com Wed Aug 28 16:23:04 2019 From: martinrb at google.com (Martin Buchholz) Date: Wed, 28 Aug 2019 09:23:04 -0700 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base In-Reply-To: References: Message-ID: Should Serial.java have an @since 14 ? From Alan.Bateman at oracle.com Wed Aug 28 16:23:57 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 28 Aug 2019 17:23:57 +0100 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base In-Reply-To: References: <961d73ad-d60e-d0dd-d848-4d629ff75822@oracle.com> Message-ID: On 28/08/2019 17:08, Joe Darcy wrote: > The intention here is to be "mostly exhaustive" rather than "entirely > exhaustive" in applying the annotation type so I'd prefer to defer > updating generated exceptions to future work. Okay, although all you need is: $ hg diff make diff -r e17f768b3b71 make/scripts/genExceptions.sh --- a/make/scripts/genExceptions.sh??? Wed Aug 28 10:56:50 2019 -0400 +++ b/make/scripts/genExceptions.sh??? Wed Aug 28 17:22:10 2019 +0100 @@ -60,6 +60,7 @@ ???? extends ${SUPER} ?{ +??? @java.io.Serial ???? private static final long serialVersionUID = $SVUID; ?__END__ From joe.darcy at oracle.com Wed Aug 28 16:38:04 2019 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 28 Aug 2019 09:38:04 -0700 Subject: JDK 14 RFR of JDK-8230074: Improve specification for {Math, StrictMath}.negateExact Message-ID: <9639ed90-b72c-9654-ca3b-e2a6d1baddf4@oracle.com> Hello, Please review the small amendment to make the specifications for some of the "exact" methods in Math and StrictMath more explicit in their exceptional behavior: ??? JDK-8230074: Improve specification for {Math, StrictMath}.negateExact ??? http://cr.openjdk.java.net/~darcy/8230074.0/ Patch below. Thanks, -Joe --- old/src/java.base/share/classes/java/lang/Math.java 2019-08-28 09:31:35.640999999 -0700 +++ new/src/java.base/share/classes/java/lang/Math.java 2019-08-28 09:31:35.500999999 -0700 @@ -952,6 +952,7 @@ ???? /** ????? * Returns the argument incremented by one, throwing an exception if the ????? * result overflows an {@code int}. +???? * The overflow only occurs for {@linkplain Integer#MAX_VALUE the maximum value}. ????? * ????? * @param a the value to increment ????? * @return the result @@ -970,6 +971,7 @@ ???? /** ????? * Returns the argument incremented by one, throwing an exception if the ????? * result overflows a {@code long}. +???? * The overflow only occurs for {@linkplain Long#MAX_VALUE the maximum value}. ????? * ????? * @param a the value to increment ????? * @return the result @@ -988,6 +990,7 @@ ???? /** ????? * Returns the argument decremented by one, throwing an exception if the ????? * result overflows an {@code int}. +???? * The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to decrement ????? * @return the result @@ -1006,6 +1009,7 @@ ???? /** ????? * Returns the argument decremented by one, throwing an exception if the ????? * result overflows a {@code long}. +???? * The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to decrement ????? * @return the result @@ -1024,6 +1028,7 @@ ???? /** ????? * Returns the negation of the argument, throwing an exception if the ????? * result overflows an {@code int}. +???? * The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to negate ????? * @return the result @@ -1042,6 +1047,7 @@ ???? /** ????? * Returns the negation of the argument, throwing an exception if the ????? * result overflows a {@code long}. +???? * The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to negate ????? * @return the result --- old/src/java.base/share/classes/java/lang/StrictMath.java 2019-08-28 09:31:35.996999999 -0700 +++ new/src/java.base/share/classes/java/lang/StrictMath.java 2019-08-28 09:31:35.856999999 -0700 @@ -837,6 +837,7 @@ ???? /** ????? * Returns the argument incremented by one, ????? * throwing an exception if the result overflows an {@code int}. +???? * The overflow only occurs for {@linkplain Integer#MAX_VALUE the maximum value}. ????? * ????? * @param a the value to increment ????? * @return the result @@ -851,6 +852,7 @@ ???? /** ????? * Returns the argument incremented by one, ????? * throwing an exception if the result overflows a {@code long}. +???? * The overflow only occurs for {@linkplain Long#MAX_VALUE the maximum value}. ????? * ????? * @param a the value to increment ????? * @return the result @@ -865,6 +867,7 @@ ???? /** ????? * Returns the argument decremented by one, ????? * throwing an exception if the result overflows an {@code int}. +???? * The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to decrement ????? * @return the result @@ -879,6 +882,7 @@ ???? /** ????? * Returns the argument decremented by one, ????? * throwing an exception if the result overflows a {@code long}. +???? * The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to decrement ????? * @return the result @@ -893,6 +897,7 @@ ???? /** ????? * Returns the negation of the argument, ????? * throwing an exception if the result overflows an {@code int}. +???? * The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to negate ????? * @return the result @@ -907,6 +912,7 @@ ???? /** ????? * Returns the negation of the argument, ????? * throwing an exception if the result overflows a {@code long}. +???? * The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}. ????? * ????? * @param a the value to negate ????? * @return the result From Roger.Riggs at oracle.com Wed Aug 28 16:40:26 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 28 Aug 2019 12:40:26 -0400 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base In-Reply-To: References: Message-ID: <7a006467-e121-f849-a528-b9eea0a7191f@oracle.com> Hi Joe, Looks fine, Roger On 8/27/19 9:28 PM, Joe Darcy wrote: > Hello, > > Recent work for JDK-8202385: "Annotation to mark serial-related fields > and methods" added the java.io.Serial annotation type to the platform. > The intention of this new annotation type is to allow > serialization-related fields and methods to be marked as documentation > and to allow stricter compile-time checking, analogous to the checking > done for @Override. Implementing those stricter serialization-related > checks will be done under JDK-8202056. > > Please review the application of java.io.Serial to types in the base > module other than security types: > > ??? JDK-8229997: Apply java.io.Serial annotations in java.base > ??? http://cr.openjdk.java.net/~darcy/8229997.0/ > > (Security-related types in the base module are being handled under > JDK-8229999.) > > As a reminder, the 5 serialization-related methods and 2 fields are: > > ??? * private void writeObject(java.io.ObjectOutputStream stream) > throws IOException > ??? * private void readObject(java.io.ObjectInputStream stream) throws > IOException, ClassNotFoundException > ??? * private void readObjectNoData() throws ObjectStreamException > ??? * ANY-ACCESS-MODIFIER Object writeReplace() throws > ObjectStreamException > ??? * ANY-ACCESS-MODIFIER Object readResolve() throws > ObjectStreamException > ??? * private static final ObjectStreamField[] serialPersistentFields > ??? * private static final long serialVersionUID > > Due to the separate source code management policies for > java.util.concurrent, I did not include that package in this exercise. > Likewise, applying the annotation to some of the time-zone related > files caused build failures so I excluded those types as well. > > > Thanks, > > -Joe > From andy.herrick at oracle.com Wed Aug 28 16:43:01 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Wed, 28 Aug 2019 12:43:01 -0400 Subject: RFR: JDK-8229979: jpackage cleanup src files, help text, and javadoc In-Reply-To: <1a1e5240-467c-462a-3a3b-f6ee6c418c11@oracle.com> References: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> <1a1e5240-467c-462a-3a3b-f6ee6c418c11@oracle.com> Message-ID: <53d5b33c-699e-cba8-9a52-8a137df86405@oracle.com> On 8/28/2019 11:47 AM, Alexey Semenyuk wrote: > Looks good. > > Some files in the review contain no diffs though, like > http://cr.openjdk.java.net/~herrick/8229979/webrev.01/test/jdk/tools/jpackage/windows/exe/WinUpgradeUUIDTest.java.sdiff.html. > Why are they in the review? I ran a script to remove extraneous trailing spaces and fix file permission.? The result is that the file changed, but webrev has nothing to show.? I built the webrev with a file list so all changed files are these, even if there is no visible change. /ANdy > > - Alexey > > On 8/28/2019 9:36 AM, Andy Herrick wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8229979 >> >> [2] http://cr.openjdk.java.net/~herrick/8229979/ >> >> Thanks, >> Andy >> >> > From alexey.semenyuk at oracle.com Wed Aug 28 16:45:02 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Wed, 28 Aug 2019 12:45:02 -0400 Subject: RFR: JDK-8229979: jpackage cleanup src files, help text, and javadoc In-Reply-To: <53d5b33c-699e-cba8-9a52-8a137df86405@oracle.com> References: <3ecf0abd-e683-64b1-8215-6ee111c4b4d3@oracle.com> <1a1e5240-467c-462a-3a3b-f6ee6c418c11@oracle.com> <53d5b33c-699e-cba8-9a52-8a137df86405@oracle.com> Message-ID: <73b8b826-b428-8e36-e5db-b051dd589917@oracle.com> Understood. Thank you for explanation. - Alexey On 8/28/2019 12:43 PM, Andy Herrick wrote: > > On 8/28/2019 11:47 AM, Alexey Semenyuk wrote: >> Looks good. >> >> Some files in the review contain no diffs though, like >> http://cr.openjdk.java.net/~herrick/8229979/webrev.01/test/jdk/tools/jpackage/windows/exe/WinUpgradeUUIDTest.java.sdiff.html. >> Why are they in the review? > > I ran a script to remove extraneous trailing spaces and fix file > permission.? The result is that the file changed, but webrev has > nothing to show.? I built the webrev with a file list so all changed > files are these, even if there is no visible change. > > /ANdy > >> >> - Alexey >> >> On 8/28/2019 9:36 AM, Andy Herrick wrote: >>> Please review the jpackage fix for bug [1] at [2]. >>> >>> This is a fix for the JDK-8200758-branch branch of the open sandbox >>> repository (jpackage). >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8229979 >>> >>> [2] http://cr.openjdk.java.net/~herrick/8229979/ >>> >>> Thanks, >>> Andy >>> >>> >> From mandy.chung at oracle.com Wed Aug 28 17:11:58 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 28 Aug 2019 10:11:58 -0700 Subject: RFR: 8230302: GenerateJLIClassesPlugin can generate invalid DirectMethodHandle methods In-Reply-To: References: Message-ID: On 8/28/19 7:38 AM, Claes Redestad wrote: > Hi, > > we currently spin code for a non-sensical invokeVirtual DMH, so let's > remove that. > > Such methods are benign since we won't ever attempt to resolve such > nonsensical forms, but surely a waste of space. This patch tightens > checks conservatively (could possibly apply the same restriction to > invokeSpecial?) and adds a few negative tests using inputs that jlink > should refuse. > I also think same check (first parameter is the receiver) can be applied to invokespecial for DMH. > Webrev: http://cr.openjdk.java.net/~redestad/8230302/webrev.00/ > This looks okay.??? It'd be good to move away from hardcoded defaults as tracked by JDK-8230301. Mandy From claes.redestad at oracle.com Wed Aug 28 17:41:36 2019 From: claes.redestad at oracle.com (Claes Redestad) Date: Wed, 28 Aug 2019 19:41:36 +0200 Subject: RFR: 8230302: GenerateJLIClassesPlugin can generate invalid DirectMethodHandle methods In-Reply-To: References: Message-ID: <7c4a8209-c493-8d4b-9f2d-211694eafe38@oracle.com> Hi Mandy, On 2019-08-28 19:11, Mandy Chung wrote: > > > On 8/28/19 7:38 AM, Claes Redestad wrote: >> Hi, >> >> we currently spin code for a non-sensical invokeVirtual DMH, so let's >> remove that. >> >> Such methods are benign since we won't ever attempt to resolve such >> nonsensical forms, but surely a waste of space. This patch tightens >> checks conservatively (could possibly apply the same restriction to >> invokeSpecial?) and adds a few negative tests using inputs that jlink >> should refuse. >> > > I also think same check (first parameter is the receiver) can be applied > to invokespecial for DMH. While tightening this up would be good, I also want to make absolutely certain there aren't any edge cases that we're missing where omitting the receiver would actually be fine. I need to study the specification a bit more (and add more tests), so for now I think I'd like to leave things as is. Again, while it might be possible to make the plugin generate a LF that doesn't make sense, it's AFAICT not possible to construct a DMH at runtime that would pick that up, so making things stricter is mainly about good hygiene. > >> Webrev: http://cr.openjdk.java.net/~redestad/8230302/webrev.00/ >> > > This looks okay. Thanks! > It'd be good to move away from hardcoded defaults as > tracked by JDK-8230301. Yes, I have that lined up, running tests etc. I just need to ensure there are no regressions, but since we now have build-time profile guidance on what to pregenerate it seems most of the things in the defaults are now either redundant or dead weight. /Claes From lance.andersen at oracle.com Wed Aug 28 17:51:11 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 28 Aug 2019 13:51:11 -0400 Subject: 8229333: java/io/File/SetLastModified.java timed out In-Reply-To: References: Message-ID: Looks fine Brian, fingers crossed the little bugger does not come back :-) > On Aug 27, 2019, at 2:00 PM, Brian Burkhalter wrote: > > The failure reported in [1] was observed to occur on two Mac minis with HDDs. Given the large file access it is possibly due to slow disk access. The suggested fix is to increase the timeout [2]. If it is still observed at a later date a new issue can be filed. > > Thanks, > > Brian > > [1] https://bugs.openjdk.java.net/browse/JDK-8229333 > [2] diff: > > @@ -22,11 +22,13 @@ > */ > > /* @test > - @bug 4091757 6652379 8177809 > - @summary Basic test for setLastModified method > + * @bug 4091757 6652379 8177809 > + * @summary Basic test for setLastModified method > + * @run main/timeout=180 SetLastModified > */ > > -import java.io.*; > +import java.io.File; > +import java.io.FileOutputStream; > import java.nio.ByteBuffer; > import java.nio.channels.FileChannel; Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From brian.burkhalter at oracle.com Wed Aug 28 17:55:32 2019 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 28 Aug 2019 10:55:32 -0700 Subject: JDK 14 RFR of JDK-8230074: Improve specification for {Math, StrictMath}.negateExact In-Reply-To: <9639ed90-b72c-9654-ca3b-e2a6d1baddf4@oracle.com> References: <9639ed90-b72c-9654-ca3b-e2a6d1baddf4@oracle.com> Message-ID: Hi Joe, Looks fine. Brian > On Aug 28, 2019, at 9:38 AM, Joe Darcy wrote: > > Please review the small amendment to make the specifications for some of the "exact" methods in Math and StrictMath more explicit in their exceptional behavior: > > JDK-8230074: Improve specification for {Math, StrictMath}.negateExact > http://cr.openjdk.java.net/~darcy/8230074.0/ > > Patch below. From huizhe.wang at oracle.com Wed Aug 28 19:04:34 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 28 Aug 2019 12:04:34 -0700 Subject: RFR [14/java.xml] 8230094: CCE in createXMLEventWriter(Result) over an arbitrary XMLStreamWriter In-Reply-To: <538836BD-1219-4833-9AEA-0357A062CE24@oracle.com> References: <55e22dc5-570e-7fd9-427e-2db5232ec72f@oracle.com> <538836BD-1219-4833-9AEA-0357A062CE24@oracle.com> Message-ID: <0075efe8-eaaa-b801-9738-d4d3f8c42e64@oracle.com> On 8/28/19 8:12 AM, Lance Andersen wrote: > Hi Joe, > > The change and test look OK Thanks Lance! > >> On Aug 27, 2019, at 1:20 PM, Joe Wang > > wrote: >> >> Please review a patch for an issue where a custom impl of >> XMLStreamWriter caused a CCE. The problem was that our implementation >> was changed to an internally extended interface. We could consider >> making it external, but for now, we'll do with a check. >> >> Note that there's no material change in XMLOutputFactoryImpl.java >> except a minor one at line 160. > > took a moment to spot the change here :-) It's hidden in there ;-) Best, Joe > > Best > Lance >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8230094 >> webrev: http://cr.openjdk.java.net/~joehw/jdk14/8230094/webrev/ >> >> Thanks, >> Joe > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle?Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From ivan.gerasimov at oracle.com Thu Aug 29 06:20:33 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 28 Aug 2019 23:20:33 -0700 Subject: RFR (S) 8230338 : Accurate error message about bad Unicode block name Message-ID: <742a59eb-6234-59dc-db8c-3277fdff019b@oracle.com> Hello! When Pattern.compile complains about a wrong Unicode block name, it includes the prefix "In" twice, like this: ''Unknown character property name {*In*/Is*In*BadBlockName} near index NN '' Would you please help review a trivial fix, which makes the message more accurate? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230338 WEBREV: http://cr.openjdk.java.net/~igerasim/8230338/00/webrev/ Thanks in advance! -- With kind regards, Ivan Gerasimov From amaembo at gmail.com Thu Aug 29 06:37:52 2019 From: amaembo at gmail.com (Tagir Valeev) Date: Thu, 29 Aug 2019 13:37:52 +0700 Subject: flatMap still prevents short circuiting when using .iterator() In-Reply-To: References: Message-ID: This is a little bit tricky problem. Now it's guaranteed that every stream returned by a function passed into flatMap will be closed. However, if we avoid buffering for the iterator() method, it would be impossible to guarantee this as an iterator can be abandoned at any time. E.g. now a utility method like this is guaranteed to close all the resources no matter how you use the Stream: Stream allLines(List paths) { return paths.stream().flatMap(p -> {try{return Files.lines(p);} catch(IOException ex) {return null;}}); } However, if short-circuiting behavior for an iterator() is implemented, and iterator() is abandoned in the middle of an iteration, then you may end up having a resource leak. With best regards, Tagir Valeev. On Thu, Aug 22, 2019 at 1:45 AM Roger Riggs wrote: > Created an issue to track this: > > JDK-8229983 flatMap > still prevents short circuiting when using .iterator() > > Regards, Roger > > On 8/20/19 4:55 AM, Stephen Buergler wrote: > > Oops thanks. > > So I think the issue is that StreamSpliterators.java has this line > > bufferSink = ph.wrapSink(b::accept); > > that creates a Sink that never returns true in cancellationRequested() > > which is needed to get flatMap() to stop looping. > > > > On Thu, Aug 15, 2019 at 7:43 PM David Holmes > wrote: > >> Re-directing to core-libs-dev > >> > >> David > >> > >> On 15/08/2019 7:48 pm, Stephen Buergler wrote: > >>> Not really sure where to send this. > >>> flatMap was fixed so that it doesn't prevent short circuiting. > >>> https://bugs.openjdk.java.net/browse/JDK-8075939 > >>> If you replace the test cases in the ticket with versions that use > >>> .iterator().next() instead of .findFirst().get() then the problem > >>> still happens. > >>> I just tested this with openjdk:14 on docker hub. > >>> > > From Roger.Riggs at oracle.com Thu Aug 29 13:39:47 2019 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Thu, 29 Aug 2019 09:39:47 -0400 Subject: RFR (S) 8230338 : Accurate error message about bad Unicode block name In-Reply-To: <742a59eb-6234-59dc-db8c-3277fdff019b@oracle.com> References: <742a59eb-6234-59dc-db8c-3277fdff019b@oracle.com> Message-ID: Looks fine Ivan, Thanks, Roger On 8/29/19 2:20 AM, Ivan Gerasimov wrote: > Hello! > > When Pattern.compile complains about a wrong Unicode block name, it > includes the prefix "In" twice, like this: > ''Unknown character property name {*In*/Is*In*BadBlockName} near index > NN '' > > Would you please help review a trivial fix, which makes the message > more accurate? > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230338 > WEBREV: http://cr.openjdk.java.net/~igerasim/8230338/00/webrev/ > > Thanks in advance! > From sverre.moe at gmail.com Thu Aug 29 14:30:40 2019 From: sverre.moe at gmail.com (Sverre Moe) Date: Thu, 29 Aug 2019 16:30:40 +0200 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <3d92d996-eca0-7971-0716-42b885525295@oracle.com> References: <3d92d996-eca0-7971-0716-42b885525295@oracle.com> Message-ID: It is not working creating native installer on Windows. It will not take neither exe nor msi as --package-type on Windows. jdk.jpackage.internal.PackagerException: Error: Invalid or unsupported package type: [exe]. at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:614) at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:513) at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:97) at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:51) The jpackage help output on Windows lists both exe and msi as valid package types. The JDK-8228660 is marked as resolved. I reckon it will make it into the next build. /Sverre tor. 22. aug. 2019 kl. 02:03 skrev Kevin Rushforth < kevin.rushforth at oracle.com>: > We believe that we have addressed most of the issues, especially those > affecting the generated Linux packages, both .deb and .rpm. There is one > open issue around the naming of the Debian packages that we will address > in the next EA release. See JDK-8228660 [1] for more information. > > We would love to get some feedback from Linux developers to make sure > that we didn't miss anything else. > > Thanks. > > -- Kevin > > [1] https://bugs.openjdk.java.net/browse/JDK-8228660 > > > On 8/21/2019 3:27 PM, Andy Herrick wrote: > > The next EA build of JPackage is available at > > https://jdk.java.net/jpackage/ > > > > This build ( jdk-14-jpackage+1-33 ) (2019/8/20) is the next early > > access release based on JDK-14 > > > > This release contains fixes to the following issues: > > > > JDK-8229788 Error dialog displays with DLL issue when installing > > WinChooserTest application > > JDK-8225447 Revise Debian packaging > > JDK-8213941 Debian linux problems in JavaPackager > > JDK-8229334 jpackage .exe packages cannot be executed due to > > missing DLL > > JDK-8227058 Regressions related to no longer setting user.dir > > JDK-8226599 use code coverage results to remove dead code > > JDK-8226191 jpackager --license-file option broken on windows for > > jdk installers. > > JDK-8215381 Investigate if current implementation of > > --license-file is correct for Debian packages > > JDK-8229138 Add --linux-app-release option for DEB and RPM packages > > JDK-8229791 Code clean up regressions > > JDK-8229786 No output after WinShortcutTest.exe is launched > > JDK-8229750 Fix bad merge of JDK-8215447 patch > > JDK-8215446 JPackageCreateInstallerInstallDirTest fails on OLE7 > > JDK-8215447 Investigate if current implementation of > > --license-file is correct for RPM packages > > JDK-8227172 revert JDK-8225569 on windows > > JDK-8224788 jpackage fails on OS X when using --runtime-image > > JDK-8229252 Add descriptions to Windows jtreg tests > > JDK-8228744 file associations broken on linux. > > JDK-8227312 Remove pkg bundle from DMG image. > > JDK-8228722 jpackage RPM tests fail on some versions of rpmbuild > > JDK-8222778 Packaging Tool (JEP 343) on Linux/AArch64 > > JDK-8224627 Creating installer with --runtime-image on OS X fails > > JDK-8226904 current working directory wrong running jpackage app > > JDK-8224486 Arguments from jpackager cfg file not processed correctly > > JDK-8226835 Command window pops up building exe package > > JDK-8225092 Several jpackage tests failed when run with jcov enabled > > > > /Andy > > > > From ivan.gerasimov at oracle.com Thu Aug 29 14:40:38 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 29 Aug 2019 07:40:38 -0700 Subject: RFR (S) 8230338 : Accurate error message about bad Unicode block name In-Reply-To: References: <742a59eb-6234-59dc-db8c-3277fdff019b@oracle.com> Message-ID: <0ec29e19-2d67-bbf0-23a4-54873347a0fb@oracle.com> Thank you Roger! On 8/29/19 6:39 AM, Roger Riggs wrote: > Looks fine Ivan, > > Thanks, Roger > > -- With kind regards, Ivan Gerasimov From kevin.rushforth at oracle.com Thu Aug 29 15:34:10 2019 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Thu, 29 Aug 2019 08:34:10 -0700 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: References: <3d92d996-eca0-7971-0716-42b885525295@oracle.com> Message-ID: <36feb3a6-e24c-6239-4563-cada989f20c7@oracle.com> Hi Sverre, Do you have a WiX installed on your machine? That is a prerequisite. Andy: Do we have a bug filed to produce a better error message in this case? If not, we need to file one. -- Kevin On 8/29/2019 7:30 AM, Sverre Moe wrote: > It is not working creating native installer on Windows. > > It will not take neither exe nor msi as --package-type on Windows. > jdk.jpackage.internal.PackagerException: Error: Invalid or unsupported > package type: [exe]. > ? ? ? ? at > jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:614) > ? ? ? ? at > jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:513) > ? ? ? ? at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:97) > ? ? ? ? at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:51) > > The jpackage help output on Windows lists both exe and msi as valid > package types. > > The JDK-8228660 is marked as resolved. I reckon it will make it into > the next build. > > /Sverre > > > tor. 22. aug. 2019 kl. 02:03 skrev Kevin Rushforth > >: > > We believe that we have addressed most of the issues, especially > those > affecting the generated Linux packages, both .deb and .rpm. There > is one > open issue around the naming of the Debian packages that we will > address > in the next EA release. See JDK-8228660 [1] for more information. > > We would love to get some feedback from Linux developers to make sure > that we didn't miss anything else. > > Thanks. > > -- Kevin > > [1] https://bugs.openjdk.java.net/browse/JDK-8228660 > > > On 8/21/2019 3:27 PM, Andy Herrick wrote: > > The next EA build of JPackage is available at > > https://jdk.java.net/jpackage/ > > > > This build ( jdk-14-jpackage+1-33 ) (2019/8/20) is the next early > > access release based on JDK-14 > > > > This release contains fixes to the following issues: > > > > JDK-8229788???? Error dialog displays with DLL issue when > installing > > WinChooserTest application > > JDK-8225447???? Revise Debian packaging > > JDK-8213941???? Debian linux problems in JavaPackager > > JDK-8229334???? jpackage .exe packages cannot be executed due to > > missing DLL > > JDK-8227058???? Regressions related to no longer setting user.dir > > JDK-8226599???? use code coverage results to remove dead code > > JDK-8226191???? jpackager --license-file option broken on > windows for > > jdk installers. > > JDK-8215381???? Investigate if current implementation of > > --license-file is correct for Debian packages > > JDK-8229138???? Add --linux-app-release option for DEB and RPM > packages > > JDK-8229791???? Code clean up regressions > > JDK-8229786???? No output after WinShortcutTest.exe is launched > > JDK-8229750???? Fix bad merge of JDK-8215447 patch > > JDK-8215446???? JPackageCreateInstallerInstallDirTest fails on OLE7 > > JDK-8215447???? Investigate if current implementation of > > --license-file is correct for RPM packages > > JDK-8227172???? revert JDK-8225569 on windows > > JDK-8224788???? jpackage fails on OS X when using --runtime-image > > JDK-8229252???? Add descriptions to Windows jtreg tests > > JDK-8228744???? file associations broken on linux. > > JDK-8227312???? Remove pkg bundle from DMG image. > > JDK-8228722???? jpackage RPM tests fail on some versions of rpmbuild > > JDK-8222778???? Packaging Tool (JEP 343) on Linux/AArch64 > > JDK-8224627???? Creating installer with --runtime-image on OS X > fails > > JDK-8226904???? current working directory wrong running jpackage app > > JDK-8224486???? Arguments from jpackager cfg file not processed > correctly > > JDK-8226835???? Command window pops up building exe package > > JDK-8225092???? Several jpackage tests failed when run with jcov > enabled > > > > /Andy > > > From andy.herrick at oracle.com Thu Aug 29 15:36:38 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Thu, 29 Aug 2019 11:36:38 -0400 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <36feb3a6-e24c-6239-4563-cada989f20c7@oracle.com> References: <3d92d996-eca0-7971-0716-42b885525295@oracle.com> <36feb3a6-e24c-6239-4563-cada989f20c7@oracle.com> Message-ID: On 8/29/2019 11:34 AM, Kevin Rushforth wrote: > Hi Sverre, > > Do you have a WiX installed on your machine? That is a prerequisite. > > Andy: Do we have a bug filed to produce a better error message in this > case? If not, we need to file one. > Yes - I have been working out fix for JDK-8230152: No appropriate error message when wix tools missing. /Andy > -- Kevin > > > On 8/29/2019 7:30 AM, Sverre Moe wrote: >> It is not working creating native installer on Windows. >> >> It will not take neither exe nor msi as --package-type on Windows. >> jdk.jpackage.internal.PackagerException: Error: Invalid or >> unsupported package type: [exe]. >> ? ? ? ? at >> jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:614) >> ? ? ? ? at >> jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:513) >> ? ? ? ? at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:97) >> ? ? ? ? at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:51) >> >> The jpackage help output on Windows lists both exe and msi as valid >> package types. >> >> The JDK-8228660 is marked as resolved. I reckon it will make it into >> the next build. >> >> /Sverre >> >> >> tor. 22. aug. 2019 kl. 02:03 skrev Kevin Rushforth >> >: >> >> We believe that we have addressed most of the issues, especially >> those >> affecting the generated Linux packages, both .deb and .rpm. There >> is one >> open issue around the naming of the Debian packages that we will >> address >> in the next EA release. See JDK-8228660 [1] for more information. >> >> We would love to get some feedback from Linux developers to make >> sure >> that we didn't miss anything else. >> >> Thanks. >> >> -- Kevin >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8228660 >> >> >> On 8/21/2019 3:27 PM, Andy Herrick wrote: >> > The next EA build of JPackage is available at >> > https://jdk.java.net/jpackage/ >> > >> > This build ( jdk-14-jpackage+1-33 ) (2019/8/20) is the next early >> > access release based on JDK-14 >> > >> > This release contains fixes to the following issues: >> > >> > JDK-8229788???? Error dialog displays with DLL issue when >> installing >> > WinChooserTest application >> > JDK-8225447???? Revise Debian packaging >> > JDK-8213941???? Debian linux problems in JavaPackager >> > JDK-8229334???? jpackage .exe packages cannot be executed due to >> > missing DLL >> > JDK-8227058???? Regressions related to no longer setting user.dir >> > JDK-8226599???? use code coverage results to remove dead code >> > JDK-8226191???? jpackager --license-file option broken on >> windows for >> > jdk installers. >> > JDK-8215381???? Investigate if current implementation of >> > --license-file is correct for Debian packages >> > JDK-8229138???? Add --linux-app-release option for DEB and RPM >> packages >> > JDK-8229791???? Code clean up regressions >> > JDK-8229786???? No output after WinShortcutTest.exe is launched >> > JDK-8229750???? Fix bad merge of JDK-8215447 patch >> > JDK-8215446???? JPackageCreateInstallerInstallDirTest fails on OLE7 >> > JDK-8215447???? Investigate if current implementation of >> > --license-file is correct for RPM packages >> > JDK-8227172???? revert JDK-8225569 on windows >> > JDK-8224788???? jpackage fails on OS X when using --runtime-image >> > JDK-8229252???? Add descriptions to Windows jtreg tests >> > JDK-8228744???? file associations broken on linux. >> > JDK-8227312???? Remove pkg bundle from DMG image. >> > JDK-8228722???? jpackage RPM tests fail on some versions of >> rpmbuild >> > JDK-8222778???? Packaging Tool (JEP 343) on Linux/AArch64 >> > JDK-8224627???? Creating installer with --runtime-image on OS X >> fails >> > JDK-8226904???? current working directory wrong running >> jpackage app >> > JDK-8224486???? Arguments from jpackager cfg file not processed >> correctly >> > JDK-8226835???? Command window pops up building exe package >> > JDK-8225092???? Several jpackage tests failed when run with >> jcov enabled >> > >> > /Andy >> > >> > From sverre.moe at gmail.com Thu Aug 29 15:38:29 2019 From: sverre.moe at gmail.com (Sverre Moe) Date: Thu, 29 Aug 2019 17:38:29 +0200 Subject: jdk-14-jpackage+1-33 on jdk.java.net In-Reply-To: <36feb3a6-e24c-6239-4563-cada989f20c7@oracle.com> References: <3d92d996-eca0-7971-0716-42b885525295@oracle.com> <36feb3a6-e24c-6239-4563-cada989f20c7@oracle.com> Message-ID: No, have not installed WIX. Had InnoSetup from when we use javapackager. I will look into the WiX: https://wixtoolset.org /Sverre tor. 29. aug. 2019 kl. 17:34 skrev Kevin Rushforth < kevin.rushforth at oracle.com>: > Hi Sverre, > > Do you have a WiX installed on your machine? That is a prerequisite. > > Andy: Do we have a bug filed to produce a better error message in this > case? If not, we need to file one. > > -- Kevin > > > On 8/29/2019 7:30 AM, Sverre Moe wrote: > > It is not working creating native installer on Windows. > > It will not take neither exe nor msi as --package-type on Windows. > jdk.jpackage.internal.PackagerException: Error: Invalid or unsupported > package type: [exe]. > at > jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:614) > at > jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:513) > at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:97) > at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:51) > > The jpackage help output on Windows lists both exe and msi as valid > package types. > > The JDK-8228660 is marked as resolved. I reckon it will make it into the > next build. > > /Sverre > > > tor. 22. aug. 2019 kl. 02:03 skrev Kevin Rushforth < > kevin.rushforth at oracle.com>: > >> We believe that we have addressed most of the issues, especially those >> affecting the generated Linux packages, both .deb and .rpm. There is one >> open issue around the naming of the Debian packages that we will address >> in the next EA release. See JDK-8228660 [1] for more information. >> >> We would love to get some feedback from Linux developers to make sure >> that we didn't miss anything else. >> >> Thanks. >> >> -- Kevin >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8228660 >> >> >> On 8/21/2019 3:27 PM, Andy Herrick wrote: >> > The next EA build of JPackage is available at >> > https://jdk.java.net/jpackage/ >> > >> > This build ( jdk-14-jpackage+1-33 ) (2019/8/20) is the next early >> > access release based on JDK-14 >> > >> > This release contains fixes to the following issues: >> > >> > JDK-8229788 Error dialog displays with DLL issue when installing >> > WinChooserTest application >> > JDK-8225447 Revise Debian packaging >> > JDK-8213941 Debian linux problems in JavaPackager >> > JDK-8229334 jpackage .exe packages cannot be executed due to >> > missing DLL >> > JDK-8227058 Regressions related to no longer setting user.dir >> > JDK-8226599 use code coverage results to remove dead code >> > JDK-8226191 jpackager --license-file option broken on windows for >> > jdk installers. >> > JDK-8215381 Investigate if current implementation of >> > --license-file is correct for Debian packages >> > JDK-8229138 Add --linux-app-release option for DEB and RPM packages >> > JDK-8229791 Code clean up regressions >> > JDK-8229786 No output after WinShortcutTest.exe is launched >> > JDK-8229750 Fix bad merge of JDK-8215447 patch >> > JDK-8215446 JPackageCreateInstallerInstallDirTest fails on OLE7 >> > JDK-8215447 Investigate if current implementation of >> > --license-file is correct for RPM packages >> > JDK-8227172 revert JDK-8225569 on windows >> > JDK-8224788 jpackage fails on OS X when using --runtime-image >> > JDK-8229252 Add descriptions to Windows jtreg tests >> > JDK-8228744 file associations broken on linux. >> > JDK-8227312 Remove pkg bundle from DMG image. >> > JDK-8228722 jpackage RPM tests fail on some versions of rpmbuild >> > JDK-8222778 Packaging Tool (JEP 343) on Linux/AArch64 >> > JDK-8224627 Creating installer with --runtime-image on OS X fails >> > JDK-8226904 current working directory wrong running jpackage app >> > JDK-8224486 Arguments from jpackager cfg file not processed >> correctly >> > JDK-8226835 Command window pops up building exe package >> > JDK-8225092 Several jpackage tests failed when run with jcov enabled >> > >> > /Andy >> > >> >> > From andy.herrick at oracle.com Thu Aug 29 18:18:49 2019 From: andy.herrick at oracle.com (Andy Herrick) Date: Thu, 29 Aug 2019 14:18:49 -0400 Subject: RFR: JDK-8230152: No appropriate error message when wix tools missing. Message-ID: Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). [1] https://bugs.openjdk.java.net/browse/JDK-8230152 [2] http://cr.openjdk.java.net/~herrick/8230152/ Thanks Andy, From alexey.semenyuk at oracle.com Thu Aug 29 18:36:03 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Thu, 29 Aug 2019 14:36:03 -0400 Subject: RFR: JDK-8230152: No appropriate error message when wix tools missing. In-Reply-To: References: Message-ID: <7bd0861e-62df-5a92-e22f-af3a0746d6b9@oracle.com> Looks good. - Alexey On 8/29/2019 2:18 PM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8230152 > > [2] http://cr.openjdk.java.net/~herrick/8230152/ > > Thanks > > Andy, > > From naoto.sato at oracle.com Thu Aug 29 19:42:51 2019 From: naoto.sato at oracle.com (naoto.sato at oracle.com) Date: Thu, 29 Aug 2019 12:42:51 -0700 Subject: [14] RFR: 8229831: Upgrade Character.isUnicodeIdentifierStart/Part() methods to the latest standard Message-ID: <13d9f962-9cef-afca-3bdf-eaa93fe6721a@oracle.com> Hi, Please review the proposed modifications to the methods in java.lang.Character class. The CSR is located here: https://bugs.openjdk.java.net/browse/JDK-8230188 It mainly intends to clarify the spec of the Unicode Identifier methods, by supplying the corresponding Unicode Standard Annex #31 explanations. Also, it intends to upgrade the current implementation to the latest 12.0 level. Here is the proposed implementation changes: https://cr.openjdk.java.net/~naoto/8229831/webrev.00/ The CSR is intentionally left as draft so that I can gather/reflect opinions from this list. Naoto From alexander.matveev at oracle.com Thu Aug 29 21:08:35 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Thu, 29 Aug 2019 14:08:35 -0700 Subject: RFR: JDK-8230152: No appropriate error message when wix tools missing. In-Reply-To: References: Message-ID: Looks good. Thanks, Alexander On 8/29/2019 11:18 AM, Andy Herrick wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > [1] https://bugs.openjdk.java.net/browse/JDK-8230152 > > [2] http://cr.openjdk.java.net/~herrick/8230152/ > > Thanks > > Andy, > > From ivan.gerasimov at oracle.com Thu Aug 29 23:39:35 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 29 Aug 2019 16:39:35 -0700 Subject: RFR 8230365 : Pattern for a control-char matches non-control characters Message-ID: <4f81d7bb-3e2b-337a-2f53-a4bc71049d62@oracle.com> Hello! In a regular expression pattern a sequence of the form \\cx is allowed to specify a control character that corresponds to the name char x. Current implementation has a few issues with that: 1)? It allows x to be just any character, including non-printable ones; 2)? The produced regexp may correspond to a non-control characters; 3)? The expression is case-sensitive, so, for example \\cA differs from \\ca, while they both have to produce ctrl-A. It is proposed to make parsing more strict and reject invalid values of x, and also clarify the documentation to explicitly list valid values of x. If we agree on this proposal, then a CSR will probably need to be filed to capture the changes in the regexp parsing. Would you please help review the fix? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230365 WEBREV: http://cr.openjdk.java.net/~igerasim/8230365/00/webrev/ -- With kind regards, Ivan Gerasimov From joe.darcy at oracle.com Fri Aug 30 00:35:39 2019 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 29 Aug 2019 17:35:39 -0700 Subject: JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base In-Reply-To: References: Message-ID: On 8/28/2019 9:23 AM, Martin Buchholz wrote: > Should Serial.java have an @since 14 ? Yes; I'll fold that into another update. Thanks, -Joe From stuart.marks at oracle.com Fri Aug 30 01:15:27 2019 From: stuart.marks at oracle.com (Stuart Marks) Date: Thu, 29 Aug 2019 18:15:27 -0700 Subject: RFR 8230365 : Pattern for a control-char matches non-control characters In-Reply-To: <4f81d7bb-3e2b-337a-2f53-a4bc71049d62@oracle.com> References: <4f81d7bb-3e2b-337a-2f53-a4bc71049d62@oracle.com> Message-ID: Hi Ivan, This change certainly makes regex patterns more rigorous, but I'm concerned about the compatibility. This is a spec change and also a behavior change. While the current behavior might not strictly be correct, it does have some characteristics that applications might be depending on -- perhaps even by accident. If this change is made, it might cause subtle issues in applications that would be quite difficult to diagnose. Examples of changes I'm concerned about are: pattern \ca currently matches '!' would now match \u0001 pattern \c? currently matches \u0080 would now throw exception pattern \c0 currently matches 'p' would now throw exception and so forth. That is, using \c with characters in the range [a-z] would now match different characters from before, and using \c with characters outside the set that correspond to C0 control characters would now throw an exception whereas before they would matching something that was predictable, if in some sense incorrect. There are some ways to mitigate the incompatibility, for example, by adding a system property, or by adding a Pattern flag that explicitly enables this behavior, though I'm not sure that either is worthwhile. Maybe there are less intrusive ways that I haven't thought of. The current behavior seems to be have been established around 1999 (JDK 1.3?) so it's been around a long time, plenty of time for applications to have formed inadvertent dependencies on this behavior. An alternative would be simply to document the current behavior, even though it's arguably incorrect. Is there some benefit to this change, for example, does it enable one to write an application that wasn't possible before because of this bug? s'marks On 8/29/19 4:39 PM, Ivan Gerasimov wrote: > Hello! > > In a regular expression pattern a sequence of the form \\cx is allowed to > specify a control character that corresponds to the name char x. > > Current implementation has a few issues with that: > 1)? It allows x to be just any character, including non-printable ones; > 2)? The produced regexp may correspond to a non-control characters; > 3)? The expression is case-sensitive, so, for example \\cA differs from \\ca, > while they both have to produce ctrl-A. > > It is proposed to make parsing more strict and reject invalid values of x, and > also clarify the documentation to explicitly list valid values of x. > > If we agree on this proposal, then a CSR will probably need to be filed to > capture the changes in the regexp parsing. > > Would you please help review the fix? > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230365 > WEBREV: http://cr.openjdk.java.net/~igerasim/8230365/00/webrev/ > From amy.lu at oracle.com Fri Aug 30 02:34:43 2019 From: amy.lu at oracle.com (Amy Lu) Date: Fri, 30 Aug 2019 10:34:43 +0800 Subject: [JDK 14] RFR 8230004: jdk/internal/jimage/JImageOpenTest.java runs no test Message-ID: <12bea6fd-733e-583c-bdc6-8f8d920603f2@oracle.com> jdk/internal/jimage/JImageOpenTest.java This test is not a testng test, and is not running any test after TEST.properties was introduced at the same directory with: TestNG.dirs = . There are two tests in this directory: JImageReadTest is a testng test, JImageOpenTest is not. It's safe to remove testng related settings from TEST.properties, and specify that in JImageReadTest. Other issues found: 1. JImageOpenTest.java has a wrong build tag, which can be removed. 2. To override the default limit for the amount of output that will be saved on any stream being recorded by the test harness in TEST.properties, maxOutputSize should be used, instead of javatest.maxOutputSize [1]. This issue also exists in some other tests and will be fixed in [2]. Please review the patch to fix these issues and get JImageOpenTest.java back. bug: https://bugs.openjdk.java.net/browse/JDK-8230004 webrev: http://cr.openjdk.java.net/~amlu/8230004 Thanks, Amy [1] http://openjdk.java.net/jtreg/tag-spec.html [2] https://bugs.openjdk.java.net/browse/JDK-8230374 From ivan.gerasimov at oracle.com Fri Aug 30 03:13:41 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 29 Aug 2019 20:13:41 -0700 Subject: RFR 8230365 : Pattern for a control-char matches non-control characters In-Reply-To: References: <4f81d7bb-3e2b-337a-2f53-a4bc71049d62@oracle.com> Message-ID: <98993cd0-27f8-cda4-ce3b-52d21564a246@oracle.com> Hi Stuart! Thank you for your comments on the proposal! I totally agree with you that the fixes that result in changing the behavior have to be carefully planned and well thought. Please see my answers inline. On 8/29/19 6:15 PM, Stuart Marks wrote: > Hi Ivan, > > This change certainly makes regex patterns more rigorous, but I'm > concerned about the compatibility. This is a spec change and also a > behavior change. While the current behavior might not strictly be > correct, it does have some characteristics that applications might be > depending on -- perhaps even by accident. If this change is made, it > might cause subtle issues in applications that would be quite > difficult to diagnose. > There are two types of changes in the proposal: First, make \cx construct more restrictive w.r.t. possible values of x. Second, make it case-insensitive, so \cz will mean the same as \cZ. I agree that the later type of changes can potentially cause hard to diagnose failures in the existing applications. The reason for this later change was an attempt to make Java regexp more Perl-compatible (and Perl does exactly this:? Treats \cx with a lower-case x as \cX with its upper-case counterpart). The former type of change, on the other hand, might actually be useful for the existing applications, as it may allow to see (otherwise hard to find) bugs in the code. For example, if some existing application has a regexp, which contains "\\c\t", this is most likely a programming error (or a nasty hack to code a char 'I'), so it would be beneficial to report it via throwing a PatternSyntaxException. > Examples of changes I'm concerned about are: > > pattern \ca currently matches '!' would now match \u0001 > pattern \c? currently matches \u0080 would now throw exception > pattern \c0 currently matches 'p' would now throw exception > > and so forth. That is, using \c with characters in the range [a-z] > would now match different characters from before, and using \c with > characters outside the set that correspond to C0 control characters > would now throw an exception whereas before they would matching > something that was predictable, if in some sense incorrect. > > There are some ways to mitigate the incompatibility, for example, by > adding a system property, or by adding a Pattern flag that explicitly > enables this behavior, though I'm not sure that either is worthwhile. > Maybe there are less intrusive ways that I haven't thought of. > I think it would make sense to first separate the changes mentioned above, so it will be easier to reason about them. While I think that making lower-case \\cx a synonym for the upper-case \\cX is a good thing to have (mainly for additional compatibility with Perl-style regexps), it's supposed be deferred to a later time. > > The current behavior seems to be have been established around 1999 > (JDK 1.3?) so it's been around a long time, plenty of time for > applications to have formed inadvertent dependencies on this behavior. > An alternative would be simply to document the current behavior, even > though it's arguably incorrect. > > Is there some benefit to this change, for example, does it enable one > to write an application that wasn't possible before because of this bug? > In my opinion, the benefits are: 1) Fail-early approach, which will let the developers catch the bugs earlier, 2) Better compatibility with Perl-style regexps, so that a wider class of regular expressions can be used across different platforms, 3) Well defined strict rules will allow IDEs to implement additional edit-time checks of regexp, which will again help developers. Please find the updated webrev here: http://cr.openjdk.java.net/~igerasim/8230365/01/webrev/ With kind regards, Ivan > s'marks > > > On 8/29/19 4:39 PM, Ivan Gerasimov wrote: >> Hello! >> >> In a regular expression pattern a sequence of the form \\cx is >> allowed to specify a control character that corresponds to the name >> char x. >> >> Current implementation has a few issues with that: >> 1)? It allows x to be just any character, including non-printable ones; >> 2)? The produced regexp may correspond to a non-control characters; >> 3)? The expression is case-sensitive, so, for example \\cA differs >> from \\ca, while they both have to produce ctrl-A. >> >> It is proposed to make parsing more strict and reject invalid values >> of x, and also clarify the documentation to explicitly list valid >> values of x. >> >> If we agree on this proposal, then a CSR will probably need to be >> filed to capture the changes in the regexp parsing. >> >> Would you please help review the fix? >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230365 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8230365/00/webrev/ >> > -- With kind regards, Ivan Gerasimov From Alan.Bateman at oracle.com Fri Aug 30 06:50:20 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 30 Aug 2019 07:50:20 +0100 Subject: [JDK 14] RFR 8230004: jdk/internal/jimage/JImageOpenTest.java runs no test In-Reply-To: <12bea6fd-733e-583c-bdc6-8f8d920603f2@oracle.com> References: <12bea6fd-733e-583c-bdc6-8f8d920603f2@oracle.com> Message-ID: <5adb62c7-d228-6042-fd8f-092f42004747@oracle.com> On 30/08/2019 03:34, Amy Lu wrote: > jdk/internal/jimage/JImageOpenTest.java > > This test is not a testng test, and is not running any test after > TEST.properties was introduced at the same directory with: > TestNG.dirs = . > > There are two tests in this directory: JImageReadTest is a testng > test, JImageOpenTest is not. > It's safe to remove testng related settings from TEST.properties, and > specify that in JImageReadTest. > > Other issues found: > 1. JImageOpenTest.java has a wrong build tag, which can be removed. > 2. To override the default limit for the amount of output that will be > saved on any stream being recorded by the test harness in > TEST.properties, maxOutputSize should be used, instead of > javatest.maxOutputSize [1]. This issue also exists in some other tests > and will be fixed in [2]. > > Please review the patch to fix these issues and get > JImageOpenTest.java back. > > bug: https://bugs.openjdk.java.net/browse/JDK-8230004 > webrev: http://cr.openjdk.java.net/~amlu/8230004 This looks okay. -Alan From raffaello.giulietti at gmail.com Fri Aug 30 08:47:23 2019 From: raffaello.giulietti at gmail.com (Raffaello Giulietti) Date: Fri, 30 Aug 2019 10:47:23 +0200 Subject: GENTLE REMINDER of RFR CSR JDK-8202555: Double.toString(double) sometimes produces incorrect results Message-ID: <9b15b269-1029-d07f-fe47-6b0cb5979e04@gmail.com> Hi, just a gentle reminder for a RFR of [1] (see [5] for the original request). An efficient implementation can be found on [2] and in Brian Burkhalter's webrev area [3]. This also requires a review. The full details are discussed in [4]. Greetings Raffaello ---- [1] https://bugs.openjdk.java.net/browse/JDK-8202555 [2] https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-April/059783.html [3] http://cr.openjdk.java.net/~bpb/4511638/webrev.03/ [4] https://drive.google.com/open?id=1KLtG_LaIbK9ETXI290zqCxvBW94dj058 [5] https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061548.html From amy.lu at oracle.com Fri Aug 30 08:48:14 2019 From: amy.lu at oracle.com (Amy Lu) Date: Fri, 30 Aug 2019 16:48:14 +0800 Subject: [JDK 14] RFR 8230004: jdk/internal/jimage/JImageOpenTest.java runs no test In-Reply-To: <5adb62c7-d228-6042-fd8f-092f42004747@oracle.com> References: <12bea6fd-733e-583c-bdc6-8f8d920603f2@oracle.com> <5adb62c7-d228-6042-fd8f-092f42004747@oracle.com> Message-ID: <04d44818-dfcb-e35e-559b-95723161d447@oracle.com> Thank you Alan! Pushed. Thanks, Amy On 8/30/19 2:50 PM, Alan Bateman wrote: > On 30/08/2019 03:34, Amy Lu wrote: >> jdk/internal/jimage/JImageOpenTest.java >> >> This test is not a testng test, and is not running any test after >> TEST.properties was introduced at the same directory with: >> TestNG.dirs = . >> >> There are two tests in this directory: JImageReadTest is a testng >> test, JImageOpenTest is not. >> It's safe to remove testng related settings from TEST.properties, and >> specify that in JImageReadTest. >> >> Other issues found: >> 1. JImageOpenTest.java has a wrong build tag, which can be removed. >> 2. To override the default limit for the amount of output that will >> be saved on any stream being recorded by the test harness in >> TEST.properties, maxOutputSize should be used, instead of >> javatest.maxOutputSize [1]. This issue also exists in some other >> tests and will be fixed in [2]. >> >> Please review the patch to fix these issues and get >> JImageOpenTest.java back. >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8230004 >> webrev: http://cr.openjdk.java.net/~amlu/8230004 > This looks okay. > > -Alan From pavel.rappo at oracle.com Fri Aug 30 10:53:11 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Fri, 30 Aug 2019 11:53:11 +0100 Subject: RFR [14] 8151678: com/sun/jndi/ldap/LdapTimeoutTest.java failed due to timeout on DeadServerNoTimeoutTest is incorrect Message-ID: <97114AA9-A44A-4C36-843C-1E6933348096@oracle.com> // // Dear maintainer: // // Once you are done trying to 'optimize' this routine, // and have realized what a terrible mistake that was, // please increment the following counter as a warning // to the next guy: // // total_hours_wasted_here = 42 // --- [1] Hello, Please review the following change: http://cr.openjdk.java.net/~prappo/8151678/webrev.00/ Testing timeouts is not an easy task. The test in question has always been problematic. There have been many attempts to address the unreliability of that test and during its lifetime the test has been tagged (and subsequently untagged) as intermittent and eventually was put into the problem list. The proposed change overhauls the test and patches the code that the test exercises. The code change addresses the multithreading issue associated with 8160768 [2]. This issue manifests itself as different runtime exceptions that are thrown rather quickly from calls that the test expects to block for a substantial amount of time. Since that test catches this issue reliably, no new tests are introduced. The overhauled test is excluded from the problem list. Before doing so I had run the test on all the platforms for some 40,000 (4.0E4) times. I have not encountered any failures. And yet I'm under no illusion that this change fixes all the issues. I strongly suspect that the test will eventually fail again. I?ve attempted to prepare for that by adding extra diagnostic outputs and improving the usefulness of traces. -Pavel ------------------------------------------------------------------------------- [1] https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered [2] 8160768: Add capability to custom resolve host/domain names within the default JNDI LDAP provider From daniel.fuchs at oracle.com Fri Aug 30 11:28:28 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Fri, 30 Aug 2019 12:28:28 +0100 Subject: RFR [14] 8151678: com/sun/jndi/ldap/LdapTimeoutTest.java failed due to timeout on DeadServerNoTimeoutTest is incorrect In-Reply-To: <97114AA9-A44A-4C36-843C-1E6933348096@oracle.com> References: <97114AA9-A44A-4C36-843C-1E6933348096@oracle.com> Message-ID: <026e37eb-3da6-5f39-ac8d-99ad26bba3d0@oracle.com> Hi Pavel, Looks probably OK ;-) One thing though is that it's not always guaranteed that InetAddress.getByName("localhost") will resolve to the same address than that returned by InetAddess.getLoopbackAddress(), so it may be better to use the literal address (which may be an IPv6 literal requiring enclosing "[" "]") rather than the hostname when building the LDAP URL. best regards, -- daniel On 30/08/2019 11:53, Pavel Rappo wrote: > // > // Dear maintainer: > // > // Once you are done trying to 'optimize' this routine, > // and have realized what a terrible mistake that was, > // please increment the following counter as a warning > // to the next guy: > // > // total_hours_wasted_here = 42 > // > --- [1] > > Hello, > > Please review the following change: > > http://cr.openjdk.java.net/~prappo/8151678/webrev.00/ > > Testing timeouts is not an easy task. The test in question has always been > problematic. There have been many attempts to address the unreliability of that > test and during its lifetime the test has been tagged (and subsequently > untagged) as intermittent and eventually was put into the problem list. > > The proposed change overhauls the test and patches the code that the test > exercises. > > The code change addresses the multithreading issue associated with 8160768 [2]. > This issue manifests itself as different runtime exceptions that are thrown > rather quickly from calls that the test expects to block for a substantial > amount of time. Since that test catches this issue reliably, no new tests are > introduced. > > The overhauled test is excluded from the problem list. Before doing so I had run > the test on all the platforms for some 40,000 (4.0E4) times. I have not > encountered any failures. > > And yet I'm under no illusion that this change fixes all the issues. I strongly > suspect that the test will eventually fail again. I?ve attempted to prepare for > that by adding extra diagnostic outputs and improving the usefulness of traces. > > -Pavel > > ------------------------------------------------------------------------------- > [1] https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered > [2] 8160768: Add capability to custom resolve host/domain names within the default JNDI LDAP provider > From milan.mimica at gmail.com Wed Aug 28 09:41:05 2019 From: milan.mimica at gmail.com (Milan Mimica) Date: Wed, 28 Aug 2019 11:41:05 +0200 Subject: [PATCH] JDK-8228580 DnsClient TCP socket timeout In-Reply-To: References: <302C7323-55AB-4FC0-8E07-70B9D81E5DD8@oracle.com> Message-ID: Hi Vyom On Wed, 28 Aug 2019 at 08:26, Vyom Tewari26 wrote: > > Hi Milan, > > If i am reading code correctly then for each retry you are doubling the retryTimeout(int retryTimeout = (timeout * (1 << retry));) which is right retry strategy, So the timeout set to TCP instance is already double with original timeout and it will keep doubling with each retry. Check out how DnsClient::doUdpQuery() works. It reduces "timeoutLeft" after each UDP packed received. This ensures doUdpQuery() method does not block more than "pktTimeout". I did the same for TCP. Method DnsClient::continueTcpQuery() performs Socket::read() 3 times in a row. Note that Socket::setSoTimeout() applies to each read() operation individually. This means it is possible that each read() blocks for less than the specified timeout (hence it will not throw), but in total continueTcpQuery() method could block almost 3 times the value initially set via Socket::setSoTimeout(). > > The "continueTcpQuery" method is getting called from other places as well. Yes, from whatever code path it may have been called, it has the very same problem with not respecting DnsClient::timeout. -- Milan Mimica From james.laskey at oracle.com Fri Aug 30 12:14:12 2019 From: james.laskey at oracle.com (Jim Laskey) Date: Fri, 30 Aug 2019 09:14:12 -0300 Subject: [JDK 14] RFR 8230004: jdk/internal/jimage/JImageOpenTest.java runs no test In-Reply-To: <12bea6fd-733e-583c-bdc6-8f8d920603f2@oracle.com> References: <12bea6fd-733e-583c-bdc6-8f8d920603f2@oracle.com> Message-ID: <8561C86D-E14D-4DD6-9C25-AFB9B440DCD9@oracle.com> +1 > On Aug 29, 2019, at 11:34 PM, Amy Lu wrote: > > jdk/internal/jimage/JImageOpenTest.java > > This test is not a testng test, and is not running any test after TEST.properties was introduced at the same directory with: > TestNG.dirs = . > > There are two tests in this directory: JImageReadTest is a testng test, JImageOpenTest is not. > It's safe to remove testng related settings from TEST.properties, and specify that in JImageReadTest. > > Other issues found: > 1. JImageOpenTest.java has a wrong build tag, which can be removed. > 2. To override the default limit for the amount of output that will be saved on any stream being recorded by the test harness in TEST.properties, maxOutputSize should be used, instead of javatest.maxOutputSize [1]. This issue also exists in some other tests and will be fixed in [2]. > > Please review the patch to fix these issues and get JImageOpenTest.java back. > > bug: https://bugs.openjdk.java.net/browse/JDK-8230004 > webrev: http://cr.openjdk.java.net/~amlu/8230004 > > Thanks, > Amy > > [1] http://openjdk.java.net/jtreg/tag-spec.html > [2] https://bugs.openjdk.java.net/browse/JDK-8230374 > From pavel.rappo at oracle.com Fri Aug 30 12:54:54 2019 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Fri, 30 Aug 2019 13:54:54 +0100 Subject: RFR [14] 8151678: com/sun/jndi/ldap/LdapTimeoutTest.java failed due to timeout on DeadServerNoTimeoutTest is incorrect In-Reply-To: <026e37eb-3da6-5f39-ac8d-99ad26bba3d0@oracle.com> References: <97114AA9-A44A-4C36-843C-1E6933348096@oracle.com> <026e37eb-3da6-5f39-ac8d-99ad26bba3d0@oracle.com> Message-ID: <81060A81-D77F-4F49-A131-DE79F66FE29B@oracle.com> Updated, http://cr.openjdk.java.net/~prappo/8151678/webrev.01/ > On 30 Aug 2019, at 12:28, Daniel Fuchs wrote: > > Hi Pavel, > > Looks probably OK ;-) > > One thing though is that it's not always guaranteed that > InetAddress.getByName("localhost") will resolve to the same > address than that returned by InetAddess.getLoopbackAddress(), > so it may be better to use the literal address (which may be > an IPv6 literal requiring enclosing "[" "]") rather than > the hostname when building the LDAP URL. > > best regards, > > -- daniel > > On 30/08/2019 11:53, Pavel Rappo wrote: >> // >> // Dear maintainer: >> // >> // Once you are done trying to 'optimize' this routine, >> // and have realized what a terrible mistake that was, >> // please increment the following counter as a warning >> // to the next guy: >> // >> // total_hours_wasted_here = 42 >> // >> --- [1] >> Hello, >> Please review the following change: >> http://cr.openjdk.java.net/~prappo/8151678/webrev.00/ >> Testing timeouts is not an easy task. The test in question has always been >> problematic. There have been many attempts to address the unreliability of that >> test and during its lifetime the test has been tagged (and subsequently >> untagged) as intermittent and eventually was put into the problem list. >> The proposed change overhauls the test and patches the code that the test >> exercises. >> The code change addresses the multithreading issue associated with 8160768 [2]. >> This issue manifests itself as different runtime exceptions that are thrown >> rather quickly from calls that the test expects to block for a substantial >> amount of time. Since that test catches this issue reliably, no new tests are >> introduced. >> The overhauled test is excluded from the problem list. Before doing so I had run >> the test on all the platforms for some 40,000 (4.0E4) times. I have not >> encountered any failures. >> And yet I'm under no illusion that this change fixes all the issues. I strongly >> suspect that the test will eventually fail again. I?ve attempted to prepare for >> that by adding extra diagnostic outputs and improving the usefulness of traces. >> -Pavel >> ------------------------------------------------------------------------------- >> [1] https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered >> [2] 8160768: Add capability to custom resolve host/domain names within the default JNDI LDAP provider > From daniel.fuchs at oracle.com Fri Aug 30 13:18:12 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Fri, 30 Aug 2019 14:18:12 +0100 Subject: RFR [14] 8151678: com/sun/jndi/ldap/LdapTimeoutTest.java failed due to timeout on DeadServerNoTimeoutTest is incorrect In-Reply-To: <81060A81-D77F-4F49-A131-DE79F66FE29B@oracle.com> References: <97114AA9-A44A-4C36-843C-1E6933348096@oracle.com> <026e37eb-3da6-5f39-ac8d-99ad26bba3d0@oracle.com> <81060A81-D77F-4F49-A131-DE79F66FE29B@oracle.com> Message-ID: <6db710f3-dff6-f6ea-5922-242516769ed8@oracle.com> On 30/08/2019 13:54, Pavel Rappo wrote: > Updated, > > http://cr.openjdk.java.net/~prappo/8151678/webrev.01/ > Changes look good! best regards, -- daniel From martinrb at google.com Fri Aug 30 17:19:40 2019 From: martinrb at google.com (Martin Buchholz) Date: Fri, 30 Aug 2019 10:19:40 -0700 Subject: RFR [14] 8151678: com/sun/jndi/ldap/LdapTimeoutTest.java failed due to timeout on DeadServerNoTimeoutTest is incorrect In-Reply-To: <6db710f3-dff6-f6ea-5922-242516769ed8@oracle.com> References: <97114AA9-A44A-4C36-843C-1E6933348096@oracle.com> <026e37eb-3da6-5f39-ac8d-99ad26bba3d0@oracle.com> <81060A81-D77F-4F49-A131-DE79F66FE29B@oracle.com> <6db710f3-dff6-f6ea-5922-242516769ed8@oracle.com> Message-ID: Not really a review, but: For many years we've been using 10 seconds (scaled by timeout factor) as a duration long enough that a timeout is a real failure. Which is close to your own 20 seconds. Of course, no value is surely safe. Probably, parallel testing infrastructure for timeouts should be a test library method. I do something similar in JSR166TestCase /** * Runs all the given actions in parallel, failing if any fail. * Useful for running multiple variants of tests that are * necessarily individually slow because they must block. */ void testInParallel(Action ... actions) { ExecutorService pool = Executors.newCachedThreadPool(); try (PoolCleaner cleaner = cleaner(pool)) { On Fri, Aug 30, 2019 at 6:23 AM Daniel Fuchs wrote: > On 30/08/2019 13:54, Pavel Rappo wrote: > > Updated, > > > > http://cr.openjdk.java.net/~prappo/8151678/webrev.01/ > > > > Changes look good! > > best regards, > > -- daniel > From alexey.semenyuk at oracle.com Fri Aug 30 21:55:47 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 30 Aug 2019 17:55:47 -0400 Subject: RFR: JDK-8229840: Add jtreg test for --linux-app-category option In-Reply-To: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> References: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> Message-ID: <41a0e60c-2c95-4e6b-2f80-ed5c17035fc0@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). - added jtreg test for --linux-app-category option; - added jtreg test for --linux-release option; This is to address [3] issue; - introduced helper classes to simplify adding new jtreg tests. The helper classes allow to avoid code duplication between platform specific jpackage jtreg tests. They also allow to log actions taken by tests. Test output for package bundle creation: --- TRACE: assertTrue(): Check value of jpackage.test.output property [/home/asemenyu/jpackage_tests] references a directory TRACE: assertTrue(): Check value of jpackage.test.output property [/home/asemenyu/jpackage_tests] references writable directory TRACE: Bundler deb supported TRACE: Execute [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; args(3)=[-d, /tmp/jpackage_15808073035885342403, /media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; args(3)=[-d, /tmp/jpackage_15808073035885342403, /media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java] exited with 0 code TRACE: Execute [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; args(9)=[-c, -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e, Hello, -C, /tmp/jpackage_15808073035885342403, .]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; args(9)=[-c, -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e, Hello, -C, /tmp/jpackage_15808073035885342403, .] exited with 0 code TRACE: Execute [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage]; args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests, --name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3, --main-jar, hello.jar, --main-class, Hello]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage]; args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests, --name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3, --main-jar, hello.jar, --main-class, Hello] exited with 0 code TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output to [/tmp/jpackage_10813571496694787689.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg]; args(1)=[--print-architecture] exited with 0 code TRACE: assertTrue(): Check file [/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exists TRACE: Execute [dpkg-deb]; args(3)=[-f, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version]; redirect output to [/tmp/jpackage_17295015055550147798.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg-deb]; args(3)=[-f, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version] exited with 0 code TRACE: assertTrue(): Check value of Version field [1.0-Rc3] ends with Rc3 --- Test output for package installation verification: --- TRACE: assertTrue(): Check value of jpackage.test.output property [/home/asemenyu/jpackage_tests] references a directory TRACE: assertTrue(): Check value of jpackage.test.output property [/home/asemenyu/jpackage_tests] references writable directory TRACE: Bundler deb supported TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output to [/tmp/jpackage_1127921622487705754.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg]; args(1)=[--print-architecture] exited with 0 code TRACE: Execute [dpkg]; args(2)=[--contents, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect output to [/tmp/jpackage_16221854689490241666.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited with 0 code TRACE: assertTrue(): Check application launcher [/opt/releasetest/bin/ReleaseTest] is a file TRACE: assertTrue(): Check application launcher [/opt/releasetest/bin/ReleaseTest] can be executed TRACE: Execute [dpkg]; args(2)=[--contents, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect output to [/tmp/jpackage_12615070579893278257.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited with 0 code TRACE: Execute [/opt/releasetest/bin/ReleaseTest]; args(0)=[]; in directory [.]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [/opt/releasetest/bin/ReleaseTest]; args(0)=[] exited with 0 code TRACE: assertTrue(): Check file [./appOutput.txt] exists TRACE: assertEquals(2): Check file [./appOutput.txt] contains 2 text lines TRACE: assertEquals(jpackage test application): Check contents of the first text line in [./appOutput.txt] file TRACE: assertEquals(args.length: 0): Check contents of the second text line in [./appOutput.txt] file --- Test output for package uninstallation verification: --- TRACE: assertTrue(): Check value of jpackage.test.output property [/home/asemenyu/jpackage_tests] references a directory TRACE: assertTrue(): Check value of jpackage.test.output property [/home/asemenyu/jpackage_tests] references writable directory TRACE: Bundler deb supported TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output to [/tmp/jpackage_13235248864123060580.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg]; args(1)=[--print-architecture] exited with 0 code TRACE: Execute [dpkg]; args(2)=[--contents, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect output to [/tmp/jpackage_5913837318202811095.out]... TRACE: Done. Exit code: 0 TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited with 0 code TRACE: assertFalse(): Check application launcher [/opt/releasetest/bin/ReleaseTest] is not installed TRACE: assertFalse(): Check application installation directory [/opt/releasetest] is not available --- [1] https://bugs.openjdk.java.net/browse/JDK-8229840 [2] http://cr.openjdk.java.net/~asemenyuk/8229840/webrev.02 [3] https://bugs.openjdk.java.net/browse/JDK-8229841 Thanks, Alexey From alexander.matveev at oracle.com Fri Aug 30 23:15:02 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Fri, 30 Aug 2019 16:15:02 -0700 Subject: RFR: JDK-8229840: Add jtreg test for --linux-app-category option In-Reply-To: <41a0e60c-2c95-4e6b-2f80-ed5c17035fc0@oracle.com> References: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> <41a0e60c-2c95-4e6b-2f80-ed5c17035fc0@oracle.com> Message-ID: <066978a9-49e1-b636-220b-abca26323839@oracle.com> Hi Alexey, Looks good. Any plans to convert all tests to use new helper classes? Thanks, Alexander On 8/30/2019 2:55 PM, Alexey Semenyuk wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > - added jtreg test for --linux-app-category option; > - added jtreg test for --linux-release option; This is to address [3] > issue; > - introduced helper classes to simplify adding new jtreg tests. The > helper classes allow to avoid code duplication between platform > specific jpackage jtreg tests. They also allow to log actions taken by > tests. > Test output for package bundle creation: > --- > TRACE: assertTrue(): Check value of jpackage.test.output property > [/home/asemenyu/jpackage_tests] references a directory > TRACE: assertTrue(): Check value of jpackage.test.output property > [/home/asemenyu/jpackage_tests] references writable directory > TRACE: Bundler deb supported > TRACE: Execute > [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; args(3)=[-d, > /tmp/jpackage_15808073035885342403, > /media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command > [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; args(3)=[-d, > /tmp/jpackage_15808073035885342403, > /media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java] > exited with 0 code > TRACE: Execute [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; > args(9)=[-c, -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e, > Hello, -C, /tmp/jpackage_15808073035885342403, .]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command > [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; args(9)=[-c, > -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e, Hello, -C, > /tmp/jpackage_15808073035885342403, .] exited with 0 code > TRACE: Execute > [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage]; > args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests, > --name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3, > --main-jar, hello.jar, --main-class, Hello]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command > [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage]; > args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests, > --name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3, > --main-jar, hello.jar, --main-class, Hello] exited with 0 code > TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output > to [/tmp/jpackage_10813571496694787689.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg]; > args(1)=[--print-architecture] exited with 0 code > TRACE: assertTrue(): Check file > [/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exists > TRACE: Execute [dpkg-deb]; args(3)=[-f, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version]; > redirect output to [/tmp/jpackage_17295015055550147798.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg-deb]; args(3)=[-f, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version] > exited with 0 code > TRACE: assertTrue(): Check value of Version field [1.0-Rc3] ends with Rc3 > --- > > Test output for package installation verification: > --- > TRACE: assertTrue(): Check value of jpackage.test.output property > [/home/asemenyu/jpackage_tests] references a directory > TRACE: assertTrue(): Check value of jpackage.test.output property > [/home/asemenyu/jpackage_tests] references writable directory > TRACE: Bundler deb supported > TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output > to [/tmp/jpackage_1127921622487705754.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg]; > args(1)=[--print-architecture] exited with 0 code > TRACE: Execute [dpkg]; args(2)=[--contents, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect > output to [/tmp/jpackage_16221854689490241666.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited > with 0 code > TRACE: assertTrue(): Check application launcher > [/opt/releasetest/bin/ReleaseTest] is a file > TRACE: assertTrue(): Check application launcher > [/opt/releasetest/bin/ReleaseTest] can be executed > TRACE: Execute [dpkg]; args(2)=[--contents, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect > output to [/tmp/jpackage_12615070579893278257.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited > with 0 code > TRACE: Execute [/opt/releasetest/bin/ReleaseTest]; args(0)=[]; in > directory [.]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command > [/opt/releasetest/bin/ReleaseTest]; args(0)=[] exited with 0 code > TRACE: assertTrue(): Check file [./appOutput.txt] exists > TRACE: assertEquals(2): Check file [./appOutput.txt] contains 2 text > lines > TRACE: assertEquals(jpackage test application): Check contents of the > first text line in [./appOutput.txt] file > TRACE: assertEquals(args.length: 0): Check contents of the second text > line in [./appOutput.txt] file > --- > > Test output for package uninstallation verification: > --- > TRACE: assertTrue(): Check value of jpackage.test.output property > [/home/asemenyu/jpackage_tests] references a directory > TRACE: assertTrue(): Check value of jpackage.test.output property > [/home/asemenyu/jpackage_tests] references writable directory > TRACE: Bundler deb supported > TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output > to [/tmp/jpackage_13235248864123060580.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg]; > args(1)=[--print-architecture] exited with 0 code > TRACE: Execute [dpkg]; args(2)=[--contents, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect > output to [/tmp/jpackage_5913837318202811095.out]... > TRACE: Done. Exit code: 0 > TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, > /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited > with 0 code > TRACE: assertFalse(): Check application launcher > [/opt/releasetest/bin/ReleaseTest] is not installed > TRACE: assertFalse(): Check application installation directory > [/opt/releasetest] is not available > --- > > [1] https://bugs.openjdk.java.net/browse/JDK-8229840 > > [2] http://cr.openjdk.java.net/~asemenyuk/8229840/webrev.02 > > [3] https://bugs.openjdk.java.net/browse/JDK-8229841 > > Thanks, > Alexey > From ivan.gerasimov at oracle.com Fri Aug 30 23:32:51 2019 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 30 Aug 2019 16:32:51 -0700 Subject: RFR (XS) 8230415 : Avoid redundant permission checking in FilePermissionCollection and SocketPermissionCollection Message-ID: <7bf465d9-c5c0-c886-5aec-32ce79017b04@oracle.com> Hello! In the two implementations of PermissionCollection.implies(Permission), all the permissions are traversed, and their corresponding bit mask are checked. For example, here's a snippet from FilePermission.java: ??????? int desired = fperm.getMask(); ??????? int effective = 0; ??????? int needed = desired; ??????? for (Permission perm : perms.values()) { ??????????? FilePermission fp = (FilePermission)perm; ??????????? if (((needed & fp.getMask()) != 0) && fp.impliesIgnoreMask(fperm)) { ??????????????? effective |= fp.getMask(); ??????????????? if ((effective & desired) == desired) { ??????????????????? return true; ??????????????? } ??????????????? needed = (desired ^ effective);// <<< should be (desired & ~effective) ??????????? } ??????? } Here, if a permission's mask `fp.getMask()` intersects with `needed`, but does not fully cover all the needed bits, the variable `needed` is updated as XOR of desired and effective. This can raise a not-really-needed bits in the `needed` mask, so that for all subsequent permissions from the collection with that unneeded bits in the mask, an expensive fp.impliesIgnoreMask(fperm) will be executed. The fix does not change the behavior, but helps avoid unnecessary calls to impliesIgnoreMask(). Would you please help review a trivial fix? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230415 WEBREV: http://cr.openjdk.java.net/~igerasim/8230415/00/webrev/ Thanks in advance! -- With kind regards, Ivan Gerasimov From alexey.semenyuk at oracle.com Fri Aug 30 23:26:54 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 30 Aug 2019 19:26:54 -0400 Subject: RFR: JDK-8229840: Add jtreg test for --linux-app-category option In-Reply-To: <066978a9-49e1-b636-220b-abca26323839@oracle.com> References: <39e9b825-6668-af17-c4a3-c584a6ef0647@oracle.com> <41a0e60c-2c95-4e6b-2f80-ed5c17035fc0@oracle.com> <066978a9-49e1-b636-220b-abca26323839@oracle.com> Message-ID: <911a3e4d-43b3-503a-b094-bc27576cdefb@oracle.com> On 8/30/2019 7:15 PM, Alexander Matveev wrote: > Hi Alexey, > > Looks good. Any plans to convert all tests to use new helper classes? Yes, of course! I plan to do this is steps: 1. Refactor Linux tests; 2. Refactor Windows tests; 3. Refactor OSX tests; I'll cover steps 1 and 2 myself once I sort out my high priority jpackage assignments. I'll need some help with step 3. - Alexey > > Thanks, > Alexander > > On 8/30/2019 2:55 PM, Alexey Semenyuk wrote: >> Please review the jpackage fix for bug [1] at [2]. >> >> This is a fix for the JDK-8200758-branch branch of the open sandbox >> repository (jpackage). >> >> - added jtreg test for --linux-app-category option; >> - added jtreg test for --linux-release option; This is to address [3] >> issue; >> - introduced helper classes to simplify adding new jtreg tests. The >> helper classes allow to avoid code duplication between platform >> specific jpackage jtreg tests. They also allow to log actions taken >> by tests. >> Test output for package bundle creation: >> --- >> TRACE: assertTrue(): Check value of jpackage.test.output property >> [/home/asemenyu/jpackage_tests] references a directory >> TRACE: assertTrue(): Check value of jpackage.test.output property >> [/home/asemenyu/jpackage_tests] references writable directory >> TRACE: Bundler deb supported >> TRACE: Execute >> [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; >> args(3)=[-d, /tmp/jpackage_15808073035885342403, >> /media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command >> [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; >> args(3)=[-d, /tmp/jpackage_15808073035885342403, >> /media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java] >> exited with 0 code >> TRACE: Execute >> [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; args(9)=[-c, >> -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e, Hello, -C, >> /tmp/jpackage_15808073035885342403, .]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command >> [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; args(9)=[-c, >> -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e, Hello, -C, >> /tmp/jpackage_15808073035885342403, .] exited with 0 code >> TRACE: Execute >> [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage]; >> args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests, >> --name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3, >> --main-jar, hello.jar, --main-class, Hello]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command >> [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage]; >> args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests, >> --name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3, >> --main-jar, hello.jar, --main-class, Hello] exited with 0 code >> TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect >> output to [/tmp/jpackage_10813571496694787689.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg]; >> args(1)=[--print-architecture] exited with 0 code >> TRACE: assertTrue(): Check file >> [/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exists >> TRACE: Execute [dpkg-deb]; args(3)=[-f, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, >> Version]; redirect output to [/tmp/jpackage_17295015055550147798.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg-deb]; args(3)=[-f, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version] >> exited with 0 code >> TRACE: assertTrue(): Check value of Version field [1.0-Rc3] ends with >> Rc3 >> --- >> >> Test output for package installation verification: >> --- >> TRACE: assertTrue(): Check value of jpackage.test.output property >> [/home/asemenyu/jpackage_tests] references a directory >> TRACE: assertTrue(): Check value of jpackage.test.output property >> [/home/asemenyu/jpackage_tests] references writable directory >> TRACE: Bundler deb supported >> TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect >> output to [/tmp/jpackage_1127921622487705754.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg]; >> args(1)=[--print-architecture] exited with 0 code >> TRACE: Execute [dpkg]; args(2)=[--contents, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; >> redirect output to [/tmp/jpackage_16221854689490241666.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited >> with 0 code >> TRACE: assertTrue(): Check application launcher >> [/opt/releasetest/bin/ReleaseTest] is a file >> TRACE: assertTrue(): Check application launcher >> [/opt/releasetest/bin/ReleaseTest] can be executed >> TRACE: Execute [dpkg]; args(2)=[--contents, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; >> redirect output to [/tmp/jpackage_12615070579893278257.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited >> with 0 code >> TRACE: Execute [/opt/releasetest/bin/ReleaseTest]; args(0)=[]; in >> directory [.]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command >> [/opt/releasetest/bin/ReleaseTest]; args(0)=[] exited with 0 code >> TRACE: assertTrue(): Check file [./appOutput.txt] exists >> TRACE: assertEquals(2): Check file [./appOutput.txt] contains 2 text >> lines >> TRACE: assertEquals(jpackage test application): Check contents of the >> first text line in [./appOutput.txt] file >> TRACE: assertEquals(args.length: 0): Check contents of the second >> text line in [./appOutput.txt] file >> --- >> >> Test output for package uninstallation verification: >> --- >> TRACE: assertTrue(): Check value of jpackage.test.output property >> [/home/asemenyu/jpackage_tests] references a directory >> TRACE: assertTrue(): Check value of jpackage.test.output property >> [/home/asemenyu/jpackage_tests] references writable directory >> TRACE: Bundler deb supported >> TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect >> output to [/tmp/jpackage_13235248864123060580.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg]; >> args(1)=[--print-architecture] exited with 0 code >> TRACE: Execute [dpkg]; args(2)=[--contents, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; >> redirect output to [/tmp/jpackage_5913837318202811095.out]... >> TRACE: Done. Exit code: 0 >> TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents, >> /home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited >> with 0 code >> TRACE: assertFalse(): Check application launcher >> [/opt/releasetest/bin/ReleaseTest] is not installed >> TRACE: assertFalse(): Check application installation directory >> [/opt/releasetest] is not available >> --- >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8229840 >> >> [2] http://cr.openjdk.java.net/~asemenyuk/8229840/webrev.02 >> >> [3] https://bugs.openjdk.java.net/browse/JDK-8229841 >> >> Thanks, >> Alexey >> > From alexander.matveev at oracle.com Fri Aug 30 23:44:11 2019 From: alexander.matveev at oracle.com (Alexander Matveev) Date: Fri, 30 Aug 2019 16:44:11 -0700 Subject: RFR: JDK-8223211: Remove old code from service support Message-ID: <6313f87e-f02f-dbc6-8da4-1d11c74d9cc6@oracle.com> Please review the jpackage fix for bug [1] at [2]. This is a fix for the JDK-8200758-branch branch of the open sandbox repository (jpackage). 1) This file is not used and was removed. 2) This file was removed due to JDK-8221333. 3) Removed unused services code. [1] https://bugs.openjdk.java.net/browse/JDK-8223211 [2] http://cr.openjdk.java.net/~almatvee/8223211/webrev.00/ Thanks, Alexander From alexey.semenyuk at oracle.com Fri Aug 30 23:48:28 2019 From: alexey.semenyuk at oracle.com (Alexey Semenyuk) Date: Fri, 30 Aug 2019 19:48:28 -0400 Subject: RFR: JDK-8223211: Remove old code from service support In-Reply-To: <6313f87e-f02f-dbc6-8da4-1d11c74d9cc6@oracle.com> References: <6313f87e-f02f-dbc6-8da4-1d11c74d9cc6@oracle.com> Message-ID: <1bc0673d-2b15-c469-47bd-184e8b150423@oracle.com> Looks good. - Alexey On 8/30/2019 7:44 PM, Alexander Matveev wrote: > Please review the jpackage fix for bug [1] at [2]. > > This is a fix for the JDK-8200758-branch branch of the open sandbox > repository (jpackage). > > 1) This file is not used and was removed. > 2) This file was removed due to JDK-8221333. > 3) Removed unused services code. > > [1] https://bugs.openjdk.java.net/browse/JDK-8223211 > > [2] http://cr.openjdk.java.net/~almatvee/8223211/webrev.00/ > > Thanks, > Alexander From martinrb at google.com Sat Aug 31 01:19:25 2019 From: martinrb at google.com (Martin Buchholz) Date: Fri, 30 Aug 2019 18:19:25 -0700 Subject: RFR 8230365 : Pattern for a control-char matches non-control characters In-Reply-To: <98993cd0-27f8-cda4-ce3b-52d21564a246@oracle.com> References: <4f81d7bb-3e2b-337a-2f53-a4bc71049d62@oracle.com> <98993cd0-27f8-cda4-ce3b-52d21564a246@oracle.com> Message-ID: There's a strong expectation that ctrl-A and ctrl-a both map to \u0001, so I support Ivan's initiative. I'm surprised java regex gets this wrong. Might need a transitional system property. What's the best bit-twiddle? Untested: if ((c ^= 0x40) < 0x20) return c; if ((c ^=0x20) <= 26 && c > 0) return c; 0x40 is more readable than 64. Does ctrol-? get mapped to 0x7f ? On Thu, Aug 29, 2019 at 8:15 PM Ivan Gerasimov wrote: > Hi Stuart! > > Thank you for your comments on the proposal! > I totally agree with you that the fixes that result in changing the > behavior have to be carefully planned and well thought. > Please see my answers inline. > > On 8/29/19 6:15 PM, Stuart Marks wrote: > > Hi Ivan, > > > > This change certainly makes regex patterns more rigorous, but I'm > > concerned about the compatibility. This is a spec change and also a > > behavior change. While the current behavior might not strictly be > > correct, it does have some characteristics that applications might be > > depending on -- perhaps even by accident. If this change is made, it > > might cause subtle issues in applications that would be quite > > difficult to diagnose. > > > There are two types of changes in the proposal: > First, make \cx construct more restrictive w.r.t. possible values of x. > Second, make it case-insensitive, so \cz will mean the same as \cZ. > > I agree that the later type of changes can potentially cause hard to > diagnose failures in the existing applications. > The reason for this later change was an attempt to make Java regexp more > Perl-compatible (and Perl does exactly this: Treats \cx with a > lower-case x as \cX with its upper-case counterpart). > > The former type of change, on the other hand, might actually be useful > for the existing applications, as it may allow to see (otherwise hard to > find) bugs in the code. > > For example, if some existing application has a regexp, which contains > "\\c\t", this is most likely a programming error (or a nasty hack to > code a char 'I'), so it would be beneficial to report it via throwing a > PatternSyntaxException. > > > > Examples of changes I'm concerned about are: > > > > pattern \ca currently matches '!' would now match \u0001 > > pattern \c? currently matches \u0080 would now throw exception > > pattern \c0 currently matches 'p' would now throw exception > > > > and so forth. That is, using \c with characters in the range [a-z] > > would now match different characters from before, and using \c with > > characters outside the set that correspond to C0 control characters > > would now throw an exception whereas before they would matching > > something that was predictable, if in some sense incorrect. > > > > There are some ways to mitigate the incompatibility, for example, by > > adding a system property, or by adding a Pattern flag that explicitly > > enables this behavior, though I'm not sure that either is worthwhile. > > Maybe there are less intrusive ways that I haven't thought of. > > > I think it would make sense to first separate the changes mentioned > above, so it will be easier to reason about them. > > While I think that making lower-case \\cx a synonym for the upper-case > \\cX is a good thing to have (mainly for additional compatibility with > Perl-style regexps), it's supposed be deferred to a later time. > > > > > The current behavior seems to be have been established around 1999 > > (JDK 1.3?) so it's been around a long time, plenty of time for > > applications to have formed inadvertent dependencies on this behavior. > > An alternative would be simply to document the current behavior, even > > though it's arguably incorrect. > > > > Is there some benefit to this change, for example, does it enable one > > to write an application that wasn't possible before because of this bug? > > > In my opinion, the benefits are: > 1) Fail-early approach, which will let the developers catch the bugs > earlier, > 2) Better compatibility with Perl-style regexps, so that a wider class > of regular expressions can be used across different platforms, > 3) Well defined strict rules will allow IDEs to implement additional > edit-time checks of regexp, which will again help developers. > > Please find the updated webrev here: > http://cr.openjdk.java.net/~igerasim/8230365/01/webrev/ > > With kind regards, > Ivan > > > > s'marks > > > > > > On 8/29/19 4:39 PM, Ivan Gerasimov wrote: > >> Hello! > >> > >> In a regular expression pattern a sequence of the form \\cx is > >> allowed to specify a control character that corresponds to the name > >> char x. > >> > >> Current implementation has a few issues with that: > >> 1) It allows x to be just any character, including non-printable ones; > >> 2) The produced regexp may correspond to a non-control characters; > >> 3) The expression is case-sensitive, so, for example \\cA differs > >> from \\ca, while they both have to produce ctrl-A. > >> > >> It is proposed to make parsing more strict and reject invalid values > >> of x, and also clarify the documentation to explicitly list valid > >> values of x. > >> > >> If we agree on this proposal, then a CSR will probably need to be > >> filed to capture the changes in the regexp parsing. > >> > >> Would you please help review the fix? > >> > >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8230365 > >> WEBREV: http://cr.openjdk.java.net/~igerasim/8230365/00/webrev/ > >> > > > -- > With kind regards, > Ivan Gerasimov > > From Alan.Bateman at oracle.com Sat Aug 31 07:28:50 2019 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 31 Aug 2019 08:28:50 +0100 Subject: 8187898: PrintStream should override FilterOutputStream#write(byte[]) with a method that has no throws clause In-Reply-To: References: <86A0C35F-93C1-4F45-8723-72B723024B39@oracle.com> <2d6a465b-8f1d-6365-42f7-446381197474@oracle.com> <71C745EA-D0C0-44FE-BBF8-0F9119078AD5@oracle.com> <714892D5-194F-4856-95F1-E38C6D7FF714@oracle.com> <91BF9F6F-5969-40AF-8E51-92D5E045F6D9@oracle.com> <532398EA-B7F8-4803-A038-A0F54DCD460F@oracle.com> <426428C0-F710-4262-9E5A-247D0D267059@oracle.com> <3B543968-6426-4FDC-AF27-D3962BA4814E@oracle.com> <8b8eea87-8b5d-8561-7058-633184ce8976@oracle.com> <533DF576-7B8B-4BC7-BB09-50609116AA56@oracle.com> <064ec92d-7e6d-b499-be9f-7578a1a5fb39@oracle.com> <4f71aae6-8250-67aa-c4ee-d206037af50e@oracle.com> Message-ID: <843eeca6-e540-1c8f-1f64-d1fa6319dc48@oracle.com> On 13/08/2019 22:28, Brian Burkhalter wrote: > Reprising discussion of [1] from last month. I updated the patch [2] which now hopefully accounts for the various comments. Specifically the specification of the PrintStream.write(byte[]) override was clarified as follows: > > I think the spec in the override and the new writeBytes method in webrev-alt.04 look okay. I assume you'll submit a CSR to track this change. -Alan.