From david.holmes at oracle.com Tue Apr 1 05:46:19 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 01 Apr 2014 15:46:19 +1000 Subject: RFR (M): JDK-8038587: [TESTBUG] Create CDS tests to exercise region sizes and classlist In-Reply-To: <53347D4C.4070406@oracle.com> References: <53347D4C.4070406@oracle.com> Message-ID: <533A52AB.9010401@oracle.com> Hi Misha, On 28/03/2014 5:34 AM, Mikhailo Seledtsov wrote: > Please review these 3 new CDS tests, an ongoing effort in implementation > of the CDS test specification. > > JBS: https://bugs.openjdk.java.net/browse/JDK-8038587 > Webrev: http://cr.openjdk.java.net/~mseledtsov/8038587/webrev.00/ > Testing: > Local testing on multiple platforms > JPRT to exercise the added tests: > 2014-03-27-184953.mseledtsov.cds (PASS) > These tests found 2 bugs, and one potential issue I don't quite get the point of the ClassListExerciser test. The classlist may well contain classes that do not exist, or that can not be instantiated in the test context, even if they have a no-arg constructor. Simply creating an archive "exercises" the classlist, so I'm really not sure what this test is intending to test. Also this test won't work with SE Embedded as we have a customized default classlist for the Embedded stack. Thanks, David > Thank you, > Misha From david.holmes at oracle.com Tue Apr 1 06:27:32 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 01 Apr 2014 16:27:32 +1000 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <53395EB7.1000108@oracle.com> References: <53395EB7.1000108@oracle.com> Message-ID: <533A5C54.9010403@oracle.com> Hi Fred, This looks okay to me. Great to see so much red :) Probably worth mentioning to other readers that you're going to re-examine the use of yield_all() in the future. Minor nit in os_solaris.cpp: void os::yield_all() { // Yields to all threads, including threads with lower priorities os::sleep(Thread::current(), 1, false); } the indent for sleep needs to be 4 spaces less now. Thanks, David On 31/03/2014 10:25 PM, frederic parain wrote: > Greetings, > > Back in Solaris 8 days, the JVM used a thread library > called T1. In Solaris 9, a new thread library, called T2, > was added to Solaris. The JVM code was extended to be able > to use either the T1 libthread or the T2 libthread. > Since Solaris 10, T2 is the default thread library and the > T1 libthread is not part of Solaris anymore, all its APIs > are wrappers around T2 APIs. This changeset removes the > support for the T1 libthread and the workarounds put in > VM code to deal with some T1 issues. > > Note: the minimal requirement for JDK9 is Solaris 10u9. > > CR: > https://bugs.openjdk.java.net/browse/JDK-8038473 > > Webrev: > http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ > > Thank you, > > Fred > From frederic.parain at oracle.com Tue Apr 1 09:00:34 2014 From: frederic.parain at oracle.com (Frederic Parain) Date: Tue, 01 Apr 2014 11:00:34 +0200 Subject: RFR (XXS) 8037295: Add size_t versions of Atomic::add, dec, and inc In-Reply-To: <53329507.3080003@oracle.com> References: <53329507.3080003@oracle.com> Message-ID: <533A8032.1050304@oracle.com> Looks good to me. Fred On 03/26/2014 09:51 AM, David Simms wrote: > Gidday, > > Some folks have requested size_t type variants of Atomic add, dec and > inc; to save on messy looking casts or using an inappropriate type. > > Bug/Enhancement: https://bugs.openjdk.java.net/browse/JDK-8037295 > > Webrev: http://cr.openjdk.java.net/~dsimms/8037295/ > > > Have searched for existing cases, most looked like a potential change in > type size or requiring const (still needs cast), except for > heapRegionRemSet.hpp where size_t was clearly the intended type. > > Testing: hotspot jtreg tests and "quick test list". > > Cheers > /David Simms > > > > -- Frederic Parain - Oracle Grenoble Engineering Center - France Phone: +33 4 76 18 81 17 Email: Frederic.Parain at oracle.com From frederic.parain at oracle.com Tue Apr 1 09:04:50 2014 From: frederic.parain at oracle.com (Frederic Parain) Date: Tue, 01 Apr 2014 11:04:50 +0200 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <533A5C54.9010403@oracle.com> References: <53395EB7.1000108@oracle.com> <533A5C54.9010403@oracle.com> Message-ID: <533A8132.8010908@oracle.com> Hi David, Thank you for the review, the indentation is now fixed: http://cr.openjdk.java.net/~fparain/8038473/webrev.01/ Regards, Fred On 04/01/2014 08:27 AM, David Holmes wrote: > Hi Fred, > > This looks okay to me. Great to see so much red :) Probably worth > mentioning to other readers that you're going to re-examine the use of > yield_all() in the future. > > Minor nit in os_solaris.cpp: > > void os::yield_all() { > // Yields to all threads, including threads with lower priorities > os::sleep(Thread::current(), 1, false); > } > > the indent for sleep needs to be 4 spaces less now. > > Thanks, > David > > On 31/03/2014 10:25 PM, frederic parain wrote: >> Greetings, >> >> Back in Solaris 8 days, the JVM used a thread library >> called T1. In Solaris 9, a new thread library, called T2, >> was added to Solaris. The JVM code was extended to be able >> to use either the T1 libthread or the T2 libthread. >> Since Solaris 10, T2 is the default thread library and the >> T1 libthread is not part of Solaris anymore, all its APIs >> are wrappers around T2 APIs. This changeset removes the >> support for the T1 libthread and the workarounds put in >> VM code to deal with some T1 issues. >> >> Note: the minimal requirement for JDK9 is Solaris 10u9. >> >> CR: >> https://bugs.openjdk.java.net/browse/JDK-8038473 >> >> Webrev: >> http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ >> >> Thank you, >> >> Fred >> -- Frederic Parain - Oracle Grenoble Engineering Center - France Phone: +33 4 76 18 81 17 Email: Frederic.Parain at oracle.com From coleen.phillimore at oracle.com Tue Apr 1 18:03:24 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Tue, 01 Apr 2014 14:03:24 -0400 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <53395EB7.1000108@oracle.com> References: <53395EB7.1000108@oracle.com> Message-ID: <533AFF6C.8020603@oracle.com> Frederic, This looks really nice. Thanks! Coleen On 03/31/2014 08:25 AM, frederic parain wrote: > Greetings, > > Back in Solaris 8 days, the JVM used a thread library > called T1. In Solaris 9, a new thread library, called T2, > was added to Solaris. The JVM code was extended to be able > to use either the T1 libthread or the T2 libthread. > Since Solaris 10, T2 is the default thread library and the > T1 libthread is not part of Solaris anymore, all its APIs > are wrappers around T2 APIs. This changeset removes the > support for the T1 libthread and the workarounds put in > VM code to deal with some T1 issues. > > Note: the minimal requirement for JDK9 is Solaris 10u9. > > CR: > https://bugs.openjdk.java.net/browse/JDK-8038473 > > Webrev: > http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ > > Thank you, > > Fred > From karen.kinnear at oracle.com Tue Apr 1 19:02:05 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Tue, 1 Apr 2014 15:02:05 -0400 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <53395EB7.1000108@oracle.com> References: <53395EB7.1000108@oracle.com> Message-ID: <314C243A-805C-4926-99BF-E5C1CC13227F@oracle.com> Looks good. Thank you Frederic, for all the careful work. thanks, Karen On Mar 31, 2014, at 8:25 AM, frederic parain wrote: > Greetings, > > Back in Solaris 8 days, the JVM used a thread library > called T1. In Solaris 9, a new thread library, called T2, > was added to Solaris. The JVM code was extended to be able > to use either the T1 libthread or the T2 libthread. > Since Solaris 10, T2 is the default thread library and the > T1 libthread is not part of Solaris anymore, all its APIs > are wrappers around T2 APIs. This changeset removes the > support for the T1 libthread and the workarounds put in > VM code to deal with some T1 issues. > > Note: the minimal requirement for JDK9 is Solaris 10u9. > > CR: > https://bugs.openjdk.java.net/browse/JDK-8038473 > > Webrev: > http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ > > Thank you, > > Fred > > -- > Frederic Parain - Oracle > Grenoble Engineering Center - France > Phone: +33 4 76 18 81 17 > Email: Frederic.Parain at oracle.com From christian.tornqvist at oracle.com Tue Apr 1 20:25:02 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Tue, 1 Apr 2014 16:25:02 -0400 Subject: RFR(XXS): [TESTBUG] vmerrors.sh should suppress windows .mdmp files Message-ID: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> Hi everyone, Very small fix that disables dumps from being generated on Windows when running vmerror.sh. Tested locally on Windows and test execution time went from 25 to 5 seconds (plus we're using less temporary disk space!). Webrev can be found at: http://cr.openjdk.java.net/~ctornqvi/webrev/7049895/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-7049895 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.allwin at oracle.com Tue Apr 1 20:32:57 2014 From: peter.allwin at oracle.com (Peter Allwin) Date: Tue, 1 Apr 2014 22:32:57 +0200 Subject: RFR(XXS): [TESTBUG] vmerrors.sh should suppress windows .mdmp files In-Reply-To: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> References: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> Message-ID: Looks good! /peter > On 1 apr 2014, at 22:25, Christian Tornqvist wrote: > > Hi everyone, > > Very small fix that disables dumps from being generated on Windows when running vmerror.sh. Tested locally on Windows and test execution time went from 25 to 5 seconds (plus we?re using less temporary disk space!). > > Webrev can be found at: > http://cr.openjdk.java.net/~ctornqvi/webrev/7049895/webrev.00/ > > Bug: > https://bugs.openjdk.java.net/browse/JDK-7049895 > > Thanks, > Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Tue Apr 1 20:30:48 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Tue, 01 Apr 2014 16:30:48 -0400 Subject: RFR(XXS): [TESTBUG] vmerrors.sh should suppress windows .mdmp files In-Reply-To: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> References: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> Message-ID: <533B21F8.6090108@oracle.com> Excellent. Coleen On 04/01/2014 04:25 PM, Christian Tornqvist wrote: > > Hi everyone, > > Very small fix that disables dumps from being generated on Windows > when running vmerror.sh. Tested locally on Windows and test execution > time went from 25 to 5 seconds (plus we're using less temporary disk > space!). > > Webrev can be found at: > > http://cr.openjdk.java.net/~ctornqvi/webrev/7049895/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-7049895 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhengyu.gu at oracle.com Tue Apr 1 20:35:37 2014 From: zhengyu.gu at oracle.com (Zhengyu Gu) Date: Tue, 01 Apr 2014 16:35:37 -0400 Subject: RFR(XXS): [TESTBUG] vmerrors.sh should suppress windows .mdmp files In-Reply-To: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> References: <047201cf4de8$765c36e0$6314a4a0$@oracle.com> Message-ID: <533B2319.4040302@oracle.com> Look good. -Zhenguy On 4/1/2014 4:25 PM, Christian Tornqvist wrote: > > Hi everyone, > > Very small fix that disables dumps from being generated on Windows > when running vmerror.sh. Tested locally on Windows and test execution > time went from 25 to 5 seconds (plus we're using less temporary disk > space!). > > Webrev can be found at: > > http://cr.openjdk.java.net/~ctornqvi/webrev/7049895/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-7049895 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.daugherty at oracle.com Tue Apr 1 20:46:19 2014 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Tue, 01 Apr 2014 14:46:19 -0600 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <533A8132.8010908@oracle.com> References: <53395EB7.1000108@oracle.com> <533A5C54.9010403@oracle.com> <533A8132.8010908@oracle.com> Message-ID: <533B259B.5080702@oracle.com> On 4/1/14 3:04 AM, Frederic Parain wrote: > Hi David, > > Thank you for the review, the indentation is now fixed: > > http://cr.openjdk.java.net/~fparain/8038473/webrev.01/ Thumbs up! src/os/aix/vm/os_aix.cpp No comments. src/os/bsd/vm/os_bsd.cpp No comments. src/os/linux/vm/os_linux.cpp No comments. src/os/solaris/vm/osThread_solaris.cpp No comments. src/os/solaris/vm/osThread_solaris.hpp No comments. src/os/solaris/vm/os_solaris.cpp No comments. src/os/solaris/vm/os_solaris.hpp No comments. src/os/windows/vm/os_windows.cpp No comments. src/os/windows/vm/os_windows.inline.hpp No comments. src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp No comments. src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp No comments. src/share/vm/runtime/arguments.cpp No comments. src/share/vm/runtime/os.hpp No comments. src/share/vm/runtime/safepoint.cpp No comments. src/share/vm/runtime/sharedRuntime.cpp No comments. src/share/vm/runtime/sharedRuntime.hpp No comments. Dan > > Regards, > > Fred > > On 04/01/2014 08:27 AM, David Holmes wrote: >> Hi Fred, >> >> This looks okay to me. Great to see so much red :) Probably worth >> mentioning to other readers that you're going to re-examine the use of >> yield_all() in the future. >> >> Minor nit in os_solaris.cpp: >> >> void os::yield_all() { >> // Yields to all threads, including threads with lower priorities >> os::sleep(Thread::current(), 1, false); >> } >> >> the indent for sleep needs to be 4 spaces less now. >> >> Thanks, >> David >> >> On 31/03/2014 10:25 PM, frederic parain wrote: >>> Greetings, >>> >>> Back in Solaris 8 days, the JVM used a thread library >>> called T1. In Solaris 9, a new thread library, called T2, >>> was added to Solaris. The JVM code was extended to be able >>> to use either the T1 libthread or the T2 libthread. >>> Since Solaris 10, T2 is the default thread library and the >>> T1 libthread is not part of Solaris anymore, all its APIs >>> are wrappers around T2 APIs. This changeset removes the >>> support for the T1 libthread and the workarounds put in >>> VM code to deal with some T1 issues. >>> >>> Note: the minimal requirement for JDK9 is Solaris 10u9. >>> >>> CR: >>> https://bugs.openjdk.java.net/browse/JDK-8038473 >>> >>> Webrev: >>> http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ >>> >>> Thank you, >>> >>> Fred >>> > From kevin.walls at oracle.com Tue Apr 1 20:53:48 2014 From: kevin.walls at oracle.com (Kevin Walls) Date: Tue, 01 Apr 2014 21:53:48 +0100 Subject: RR(S): 8026334: hs_err improvement: Print elapsed time in a humanly readable format In-Reply-To: <53336666.2060909@oracle.com> References: <53335DEE.3080805@oracle.com> <53336666.2060909@oracle.com> Message-ID: <533B275C.5070008@oracle.com> Thanks Coleen - Here's an update, the constants are good, here's an attempt to use constants and keep it not too verbose: http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ Thanks Kevin & Masato On 26/03/14 23:44, Coleen Phillimore wrote: > > Can you make these expressions into a variable for the calculations? IE. > 86400 = seconds_in_a_day > 3600 = seconds_in_an_hour > 60 = seconds_in_a_minute > > and then have > eldays * 86400 be something like day_seconds > > Thanks - it would be nice if these numbers only appear once each. > Coleen > On 3/26/14 7:08 PM, Kevin Walls wrote: >> >> Hi, >> >> I'd like to get a review of this change: >> >> It's adding a human-readable breakdown of the elapsed time, which is >> currently printed in raw seconds in the hs_err file (it's the last >> item printed). >> >> This is on behalf of Masato Yoshido who has worked on it. Further >> details below, including a method that was used for manual testing. >> >> bug: >> https://bugs.openjdk.java.net/browse/JDK-8026334 >> >> webrev: >> http://cr.openjdk.java.net/~kevinw/8026334/webrev.00/ >> >> Many thanks, >> Kevin >> Masato >> >> >> [Change details] >> >> - Time format will change as follows: >> >> (from) >> elapsed time: %d seconds >> >> (to) >> elapsed time: %d seconds (%dd %dh %dm %ds) >> >> - The reason why I leave the original elapsed time format is: >> -- We don?t need to remove the original format. If we remove it, ones >> who want time information in seconds need to calculate from day-, >> hour-, minute- and second-parts. >> >> - There is no code doing exactly the same thing. Another code to which >> we might be able to apply calculation similar to this conversion is >> the GC log with -XX:+PrintGCTimeStamps. However, the elapsed time >> in GC log is a floating point number, while the time in hs_err log >> is an integer since there is a problem when %f is used in printf >> on Linux platform (See comments in os::print_date_and_time function). >> Therefore, the same code as this cannot simply be share with GC log. >> >> >> [Test] >> >> (1) Tested only part of code of elapsed time calculation and printing. >> >> --- test_print_time.cpp --- >> #include >> #include >> #include >> >> void print_date_and_time(double t) { >> int eltime = (int)t; // elapsed time in seconds >> int eldays, elhours, elminutes, elseconds; // for printing elapsed >> time in a humanly readable format >> eldays = eltime / 86400; >> elhours = (eltime - eldays * 86400) / 3600; >> elminutes = (eltime - eldays * 86400 - elhours * 3600) / 60; >> elseconds = (eltime - eldays * 86400 - elhours * 3600 - elminutes * >> 60); >> printf("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, >> eldays, elhours, elminutes, elseconds); >> printf("\n"); >> } >> >> int main(int argc, char *argv[]) { >> print_date_and_time((double)86399); >> print_date_and_time((double)86400); >> print_date_and_time((double)86401); >> printf("\n"); >> >> print_date_and_time((double)86399.999); >> print_date_and_time((double)86400.999); >> print_date_and_time((double)86401.999); >> printf("\n"); >> >> print_date_and_time((double)(-86399)); >> print_date_and_time((double)(-86400)); >> print_date_and_time((double)(-86401)); >> printf("\n"); >> >> print_date_and_time((double)INT_MAX); >> print_date_and_time((double)(INT_MAX+1)); >> print_date_and_time((double)UINT_MAX); >> } >> --- >> >> --- Run the test program >> $ ./test_print_time >> elapsed time: 86399 seconds (0d 23h 59m 59s) >> elapsed time: 86400 seconds (1d 0h 0m 0s) >> elapsed time: 86401 seconds (1d 0h 0m 1s) >> >> elapsed time: 86399 seconds (0d 23h 59m 59s) >> elapsed time: 86400 seconds (1d 0h 0m 0s) >> elapsed time: 86401 seconds (1d 0h 0m 1s) >> >> elapsed time: -86399 seconds (0d -23h -59m -59s) >> elapsed time: -86400 seconds (-1d 0h 0m 0s) >> elapsed time: -86401 seconds (-1d 0h 0m -1s) >> >> elapsed time: 2147483647 seconds (24855d 3h 14m 7s) >> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >> --- >> >> >> (2) Tested using a JNI program causing Segmentation Violation. >> Tested on the following platforms: >> solaris sparcv9 >> solaris x64 >> linux x86 >> linux x64 >> windows x86 >> windows x64 >> macosx x64 >> hs_err_pid.log file was successfully generated with expected >> ?elapsed time? line on each platform. >> >> >> --- TestCrash.java --- >> public class TestCrash { >> static { >> System.loadLibrary("testcrash"); >> } >> >> public static native void crash(); >> >> public static void main(String[] args) { >> try { >> Thread.sleep(61000); >> } catch (InterruptedException e) { >> e.printStackTrace(); >> } >> crash(); >> } >> } >> --- >> >> --- TestCrash.c --- >> #include >> >> #ifdef __cplusplus >> extern "C" { >> #endif >> /* >> * Class: TestCrash >> * Method: crash >> * Signature: ()V >> */ >> JNIEXPORT void JNICALL Java_TestCrash_crash(JNIEnv *env, jclass cls) { >> const char *p = "Hello, world!"; >> *(char *)p = 'a'; >> } >> >> #ifdef __cplusplus >> } >> #endif >> --- >> >> >> Thanks and best regards, >> Masato >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikhailo.seledtsov at oracle.com Tue Apr 1 21:06:46 2014 From: mikhailo.seledtsov at oracle.com (Mikhailo Seledtsov) Date: Tue, 01 Apr 2014 17:06:46 -0400 Subject: RFR (M): JDK-8038587: [TESTBUG] Create CDS tests to exercise region sizes and classlist In-Reply-To: <533A52AB.9010401@oracle.com> References: <53347D4C.4070406@oracle.com> <533A52AB.9010401@oracle.com> Message-ID: <533B2A66.3030403@oracle.com> Hi David, Thank you for review and your feedback. The intent of this test is sanity check of basic functionality, making sure the shared classes are loaded w/o crashes or errors. Even though creating a shared archive with -Xshare:dump does exercise loading of the classes from the classlist, I believe SQE should verify it, by explicitly performing this operation. In my experience I have found that basic tests often find interesting bugs. I did drop the attempt to instantiate classes, because the amount of classes in the class list that have default constructors and instantiate successfully is quite small, and not worth the trouble. Many classes fail instantiation due to the absence of UI, or other valid reasons. What I have found, however, as part of this exercise, is that the default SE classlist is optimized for the client, not the server. As for classes that are part of the classlist, but are really missing from rt.jar: will you consider this to be a bug? Thank you, Misha On 4/1/2014 1:46 AM, David Holmes wrote: > Hi Misha, > > On 28/03/2014 5:34 AM, Mikhailo Seledtsov wrote: >> Please review these 3 new CDS tests, an ongoing effort in implementation >> of the CDS test specification. >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8038587 >> Webrev: http://cr.openjdk.java.net/~mseledtsov/8038587/webrev.00/ >> Testing: >> Local testing on multiple platforms >> JPRT to exercise the added tests: >> 2014-03-27-184953.mseledtsov.cds (PASS) >> These tests found 2 bugs, and one potential issue > > I don't quite get the point of the ClassListExerciser test. The > classlist may well contain classes that do not exist, or that can not > be instantiated in the test context, even if they have a no-arg > constructor. Simply creating an archive "exercises" the classlist, so > I'm really not sure what this test is intending to test. > > Also this test won't work with SE Embedded as we have a customized > default classlist for the Embedded stack. > > Thanks, > David > >> Thank you, >> Misha From david.holmes at oracle.com Wed Apr 2 01:52:15 2014 From: david.holmes at oracle.com (David Holmes) Date: Wed, 02 Apr 2014 11:52:15 +1000 Subject: RFR (M): JDK-8038587: [TESTBUG] Create CDS tests to exercise region sizes and classlist In-Reply-To: <533B2A66.3030403@oracle.com> References: <53347D4C.4070406@oracle.com> <533A52AB.9010401@oracle.com> <533B2A66.3030403@oracle.com> Message-ID: <533B6D4F.3010509@oracle.com> On 2/04/2014 7:06 AM, Mikhailo Seledtsov wrote: > Hi David, > > Thank you for review and your feedback. > > The intent of this test is sanity check of basic functionality, making > sure the shared classes are loaded w/o crashes or errors. Even though > creating a shared archive with -Xshare:dump does exercise loading of the > classes from the classlist, I believe SQE should verify it, by > explicitly performing this operation. In my experience I have found that > basic tests often find interesting bugs. > > I did drop the attempt to instantiate classes, because the amount of > classes in the class list that have default constructors and instantiate > successfully is quite small, and not worth the trouble. Many classes > fail instantiation due to the absence of UI, or other valid reasons. Okay. Dropping that seems to alleviate most of my concerns. > What I have found, however, as part of this exercise, is that the > default SE classlist is optimized for the client, not the server. > > As for classes that are part of the classlist, but are really missing > from rt.jar: will you consider this to be a bug? No. The default classlist, as you note is defined for a particular scenario - at the moment "client" apps. But many of those classes are not present in Compact Profiles. So unless/until we have customized default classlists for Compact Profiles, missing classes can be expected. I don't see this as an issue that warrants such customized classlists. Thanks, David > > Thank you, > Misha > > > On 4/1/2014 1:46 AM, David Holmes wrote: >> Hi Misha, >> >> On 28/03/2014 5:34 AM, Mikhailo Seledtsov wrote: >>> Please review these 3 new CDS tests, an ongoing effort in implementation >>> of the CDS test specification. >>> >>> JBS: https://bugs.openjdk.java.net/browse/JDK-8038587 >>> Webrev: http://cr.openjdk.java.net/~mseledtsov/8038587/webrev.00/ >>> Testing: >>> Local testing on multiple platforms >>> JPRT to exercise the added tests: >>> 2014-03-27-184953.mseledtsov.cds (PASS) >>> These tests found 2 bugs, and one potential issue >> >> I don't quite get the point of the ClassListExerciser test. The >> classlist may well contain classes that do not exist, or that can not >> be instantiated in the test context, even if they have a no-arg >> constructor. Simply creating an archive "exercises" the classlist, so >> I'm really not sure what this test is intending to test. >> >> Also this test won't work with SE Embedded as we have a customized >> default classlist for the Embedded stack. >> >> Thanks, >> David >> >>> Thank you, >>> Misha > From dmitry.samersoff at oracle.com Wed Apr 2 07:46:11 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Wed, 02 Apr 2014 11:46:11 +0400 Subject: RR(S): 8026334: hs_err improvement: Print elapsed time in a humanly readable format In-Reply-To: <533B275C.5070008@oracle.com> References: <53335DEE.3080805@oracle.com> <53336666.2060909@oracle.com> <533B275C.5070008@oracle.com> Message-ID: <533BC043.4050701@oracle.com> Kevin, 1. It's better to use double for arithmetics and convert it to int on printing. 2. we probably can get rid of intermittent variables day_secs, hour_secs, minute_secs 3. I would prefer to have constants as all-caps #defines outside of function definition or (if you or Coleen disagree with it) at least moved to ll.935 with empty line before and after it. -Dmitry On 2014-04-02 00:53, Kevin Walls wrote: > Thanks Coleen - > > Here's an update, the constants are good, here's an attempt to use > constants and keep it not too verbose: > > http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ > > Thanks > Kevin & Masato > > > On 26/03/14 23:44, Coleen Phillimore wrote: >> >> Can you make these expressions into a variable for the calculations? IE. >> 86400 = seconds_in_a_day >> 3600 = seconds_in_an_hour >> 60 = seconds_in_a_minute >> >> and then have >> eldays * 86400 be something like day_seconds >> >> Thanks - it would be nice if these numbers only appear once each. >> Coleen >> On 3/26/14 7:08 PM, Kevin Walls wrote: >>> >>> Hi, >>> >>> I'd like to get a review of this change: >>> >>> It's adding a human-readable breakdown of the elapsed time, which is >>> currently printed in raw seconds in the hs_err file (it's the last >>> item printed). >>> >>> This is on behalf of Masato Yoshido who has worked on it. Further >>> details below, including a method that was used for manual testing. >>> >>> bug: >>> https://bugs.openjdk.java.net/browse/JDK-8026334 >>> >>> webrev: >>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.00/ >>> >>> Many thanks, >>> Kevin >>> Masato >>> >>> >>> [Change details] >>> >>> - Time format will change as follows: >>> >>> (from) >>> elapsed time: %d seconds >>> >>> (to) >>> elapsed time: %d seconds (%dd %dh %dm %ds) >>> >>> - The reason why I leave the original elapsed time format is: >>> -- We don?t need to remove the original format. If we remove it, ones >>> who want time information in seconds need to calculate from day-, >>> hour-, minute- and second-parts. >>> >>> - There is no code doing exactly the same thing. Another code to which >>> we might be able to apply calculation similar to this conversion is >>> the GC log with -XX:+PrintGCTimeStamps. However, the elapsed time >>> in GC log is a floating point number, while the time in hs_err log >>> is an integer since there is a problem when %f is used in printf >>> on Linux platform (See comments in os::print_date_and_time function). >>> Therefore, the same code as this cannot simply be share with GC log. >>> >>> >>> [Test] >>> >>> (1) Tested only part of code of elapsed time calculation and printing. >>> >>> --- test_print_time.cpp --- >>> #include >>> #include >>> #include >>> >>> void print_date_and_time(double t) { >>> int eltime = (int)t; // elapsed time in seconds >>> int eldays, elhours, elminutes, elseconds; // for printing elapsed >>> time in a humanly readable format >>> eldays = eltime / 86400; >>> elhours = (eltime - eldays * 86400) / 3600; >>> elminutes = (eltime - eldays * 86400 - elhours * 3600) / 60; >>> elseconds = (eltime - eldays * 86400 - elhours * 3600 - elminutes * >>> 60); >>> printf("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, >>> eldays, elhours, elminutes, elseconds); >>> printf("\n"); >>> } >>> >>> int main(int argc, char *argv[]) { >>> print_date_and_time((double)86399); >>> print_date_and_time((double)86400); >>> print_date_and_time((double)86401); >>> printf("\n"); >>> >>> print_date_and_time((double)86399.999); >>> print_date_and_time((double)86400.999); >>> print_date_and_time((double)86401.999); >>> printf("\n"); >>> >>> print_date_and_time((double)(-86399)); >>> print_date_and_time((double)(-86400)); >>> print_date_and_time((double)(-86401)); >>> printf("\n"); >>> >>> print_date_and_time((double)INT_MAX); >>> print_date_and_time((double)(INT_MAX+1)); >>> print_date_and_time((double)UINT_MAX); >>> } >>> --- >>> >>> --- Run the test program >>> $ ./test_print_time >>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>> >>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>> >>> elapsed time: -86399 seconds (0d -23h -59m -59s) >>> elapsed time: -86400 seconds (-1d 0h 0m 0s) >>> elapsed time: -86401 seconds (-1d 0h 0m -1s) >>> >>> elapsed time: 2147483647 seconds (24855d 3h 14m 7s) >>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>> --- >>> >>> >>> (2) Tested using a JNI program causing Segmentation Violation. >>> Tested on the following platforms: >>> solaris sparcv9 >>> solaris x64 >>> linux x86 >>> linux x64 >>> windows x86 >>> windows x64 >>> macosx x64 >>> hs_err_pid.log file was successfully generated with expected >>> ?elapsed time? line on each platform. >>> >>> >>> --- TestCrash.java --- >>> public class TestCrash { >>> static { >>> System.loadLibrary("testcrash"); >>> } >>> >>> public static native void crash(); >>> >>> public static void main(String[] args) { >>> try { >>> Thread.sleep(61000); >>> } catch (InterruptedException e) { >>> e.printStackTrace(); >>> } >>> crash(); >>> } >>> } >>> --- >>> >>> --- TestCrash.c --- >>> #include >>> >>> #ifdef __cplusplus >>> extern "C" { >>> #endif >>> /* >>> * Class: TestCrash >>> * Method: crash >>> * Signature: ()V >>> */ >>> JNIEXPORT void JNICALL Java_TestCrash_crash(JNIEnv *env, jclass cls) { >>> const char *p = "Hello, world!"; >>> *(char *)p = 'a'; >>> } >>> >>> #ifdef __cplusplus >>> } >>> #endif >>> --- >>> >>> >>> Thanks and best regards, >>> Masato >>> >>> >>> >> > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From christian.tornqvist at oracle.com Wed Apr 2 11:46:20 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Wed, 2 Apr 2014 07:46:20 -0400 Subject: RFR(XXS) 8028733: [TESTBUG] Remove test exclusion for runtime/6626217/Test6626217.sh Message-ID: <05e901cf4e69$2acaa550$805feff0$@oracle.com> Hi everyone, Again a very small fix, simply removed the @ignore tag in Test6626217.sh. JDK-7015395 seems to have solved the problem mentioned in this bug but did not remove the @ignore from the test. Webrev can be found at: http://cr.openjdk.java.net/~ctornqvi/webrev/8028733/webrev.00/ Bug is unfortunately not visible externally: https://bugs.openjdk.java.net/browse/JDK-8028733 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Wed Apr 2 11:55:41 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Wed, 2 Apr 2014 13:55:41 +0200 Subject: RFR(XXS) 8028733: [TESTBUG] Remove test exclusion for runtime/6626217/Test6626217.sh In-Reply-To: <05e901cf4e69$2acaa550$805feff0$@oracle.com> References: <05e901cf4e69$2acaa550$805feff0$@oracle.com> Message-ID: <56170CB6-B31A-453C-8015-67063EC7B0C9@oracle.com> Looks good! Thanks, /Staffan On 2 apr 2014, at 13:46, Christian Tornqvist wrote: > Hi everyone, > > Again a very small fix, simply removed the @ignore tag in Test6626217.sh. JDK-7015395 seems to have solved the problem mentioned in this bug but did not remove the @ignore from the test. > > Webrev can be found at: > http://cr.openjdk.java.net/~ctornqvi/webrev/8028733/webrev.00/ > > Bug is unfortunately not visible externally: > https://bugs.openjdk.java.net/browse/JDK-8028733 > > Thanks, > Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Wed Apr 2 11:56:55 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 02 Apr 2014 07:56:55 -0400 Subject: RFR(XXS) 8028733: [TESTBUG] Remove test exclusion for runtime/6626217/Test6626217.sh In-Reply-To: <05e901cf4e69$2acaa550$805feff0$@oracle.com> References: <05e901cf4e69$2acaa550$805feff0$@oracle.com> Message-ID: <533BFB07.2090702@oracle.com> Looks good. Lois On 4/2/2014 7:46 AM, Christian Tornqvist wrote: > > Hi everyone, > > Again a very small fix, simply removed the @ignore tag in > Test6626217.sh. JDK-7015395 seems to have solved the problem mentioned > in this bug but did not remove the @ignore from the test. > > Webrev can be found at: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8028733/webrev.00/ > > > Bug is unfortunately not visible externally: > > https://bugs.openjdk.java.net/browse/JDK-8028733 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.triantafillou at oracle.com Wed Apr 2 12:05:42 2014 From: george.triantafillou at oracle.com (George Triantafillou) Date: Wed, 02 Apr 2014 08:05:42 -0400 Subject: RFR(XXS) 8028733: [TESTBUG] Remove test exclusion for runtime/6626217/Test6626217.sh In-Reply-To: <05e901cf4e69$2acaa550$805feff0$@oracle.com> References: <05e901cf4e69$2acaa550$805feff0$@oracle.com> Message-ID: <533BFD16.2050900@oracle.com> Christian, Looks good. -George On 4/2/2014 7:46 AM, Christian Tornqvist wrote: > > Hi everyone, > > Again a very small fix, simply removed the @ignore tag in > Test6626217.sh. JDK-7015395 seems to have solved the problem mentioned > in this bug but did not remove the @ignore from the test. > > Webrev can be found at: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8028733/webrev.00/ > > > Bug is unfortunately not visible externally: > > https://bugs.openjdk.java.net/browse/JDK-8028733 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Wed Apr 2 14:29:36 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Wed, 2 Apr 2014 07:29:36 -0700 (PDT) Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness Message-ID: <74f24048-4476-46db-ade9-8c5085b581c9@default> Greetings, ? Kindly asking for reviews for the following change: ? Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 https://bugs.openjdk.java.net/browse/JDK-8038344 ? Webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ ? Problem description: ? An InterpreterOopMap for a particular bci position does not include expression/operand stack liveness info in the oop_mask/bit_mask if the bci is a call instruction, i.e. for the invoke* instructions (invokevirtual, invokespecial, invokestatic, invokedynamic, invokeinterface). ? This leads to a discrepancy between what is actually on the expression/operand stack (given via fr().interpreter_frame_expression_stack_size()) and what is given in the liveness oop_mask/bit_mask (given via InterpreterOopMap) at a particular bci. The code in interpretedVFrame::expressions() is currently based on information given from fr().interpreter_frame_expression_stack_size(), and will index into the retrieved oop_mask/bit_mask based on this information (expression slot nr + _max_locals). These indexes either: 1. Fetches a 0 (since no live info at that position in the mask) if the index is low enough to still be inside the bit_mask word boundary. It will then proceed to treat the expression slot (which might be a real reference) as a T_INT (0 is a value, 1 is a reference) 2. Indexes out of bounds for the oop_map/bit_mask (see https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up information outside that is not related to a liveness bit mask. If that position happens to yield a 1, but the real expression slot is a value ("v"), the system can assert "(obj->is_oop()) failed: not an oop: 0x00000001" ? Tested by running: ? nsk/jdi/* ? ? Other info: ? I dislike having to create a new StackValueCollection even though I know the length is 0 and it will not be actively used. However, this pattern of always creating and returning empty objects is prevalent in this piece of code and is not easily detangled. ? ? Thanks in advance Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin.walls at oracle.com Wed Apr 2 14:27:19 2014 From: kevin.walls at oracle.com (Kevin Walls) Date: Wed, 02 Apr 2014 15:27:19 +0100 Subject: RR(S): 8026334: hs_err improvement: Print elapsed time in a humanly readable format In-Reply-To: <533BC043.4050701@oracle.com> References: <53335DEE.3080805@oracle.com> <53336666.2060909@oracle.com> <533B275C.5070008@oracle.com> <533BC043.4050701@oracle.com> Message-ID: <533C1E47.6090107@oracle.com> Hi Dmitry, all, So we exchanged emails off the list about the accuracy, and are content to keep the ints for the calculations. They can be re-multiplied to accurately reconstruct the int value of the "elapsed time" that we print, which we did as an exercise. Any accuracy concerns after the initial cast from double to int, which we already do, don't seem relevant within the expected uptime of most life forms, let alone processes[1]. It is with formatting changes alone that we refresh the webrev: http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ Thanks Kevin [1] that's a forward-looking statement, should come with a disclaimer. On 02/04/14 08:46, Dmitry Samersoff wrote: > Kevin, > > 1. It's better to use double for arithmetics and convert it to int on > printing. > > > 2. we probably can get rid of intermittent variables > day_secs, hour_secs, minute_secs > > > 3. I would prefer to have constants as all-caps #defines outside of > function definition or (if you or Coleen disagree with it) at least > moved to ll.935 with empty line before and after it. > > -Dmitry > > On 2014-04-02 00:53, Kevin Walls wrote: >> Thanks Coleen - >> >> Here's an update, the constants are good, here's an attempt to use >> constants and keep it not too verbose: >> >> http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ >> >> Thanks >> Kevin & Masato >> >> >> On 26/03/14 23:44, Coleen Phillimore wrote: >>> Can you make these expressions into a variable for the calculations? IE. >>> 86400 = seconds_in_a_day >>> 3600 = seconds_in_an_hour >>> 60 = seconds_in_a_minute >>> >>> and then have >>> eldays * 86400 be something like day_seconds >>> >>> Thanks - it would be nice if these numbers only appear once each. >>> Coleen >>> On 3/26/14 7:08 PM, Kevin Walls wrote: >>>> Hi, >>>> >>>> I'd like to get a review of this change: >>>> >>>> It's adding a human-readable breakdown of the elapsed time, which is >>>> currently printed in raw seconds in the hs_err file (it's the last >>>> item printed). >>>> >>>> This is on behalf of Masato Yoshido who has worked on it. Further >>>> details below, including a method that was used for manual testing. >>>> >>>> bug: >>>> https://bugs.openjdk.java.net/browse/JDK-8026334 >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.00/ >>>> >>>> Many thanks, >>>> Kevin >>>> Masato >>>> >>>> >>>> [Change details] >>>> >>>> - Time format will change as follows: >>>> >>>> (from) >>>> elapsed time: %d seconds >>>> >>>> (to) >>>> elapsed time: %d seconds (%dd %dh %dm %ds) >>>> >>>> - The reason why I leave the original elapsed time format is: >>>> -- We don?t need to remove the original format. If we remove it, ones >>>> who want time information in seconds need to calculate from day-, >>>> hour-, minute- and second-parts. >>>> >>>> - There is no code doing exactly the same thing. Another code to which >>>> we might be able to apply calculation similar to this conversion is >>>> the GC log with -XX:+PrintGCTimeStamps. However, the elapsed time >>>> in GC log is a floating point number, while the time in hs_err log >>>> is an integer since there is a problem when %f is used in printf >>>> on Linux platform (See comments in os::print_date_and_time function). >>>> Therefore, the same code as this cannot simply be share with GC log. >>>> >>>> >>>> [Test] >>>> >>>> (1) Tested only part of code of elapsed time calculation and printing. >>>> >>>> --- test_print_time.cpp --- >>>> #include >>>> #include >>>> #include >>>> >>>> void print_date_and_time(double t) { >>>> int eltime = (int)t; // elapsed time in seconds >>>> int eldays, elhours, elminutes, elseconds; // for printing elapsed >>>> time in a humanly readable format >>>> eldays = eltime / 86400; >>>> elhours = (eltime - eldays * 86400) / 3600; >>>> elminutes = (eltime - eldays * 86400 - elhours * 3600) / 60; >>>> elseconds = (eltime - eldays * 86400 - elhours * 3600 - elminutes * >>>> 60); >>>> printf("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, >>>> eldays, elhours, elminutes, elseconds); >>>> printf("\n"); >>>> } >>>> >>>> int main(int argc, char *argv[]) { >>>> print_date_and_time((double)86399); >>>> print_date_and_time((double)86400); >>>> print_date_and_time((double)86401); >>>> printf("\n"); >>>> >>>> print_date_and_time((double)86399.999); >>>> print_date_and_time((double)86400.999); >>>> print_date_and_time((double)86401.999); >>>> printf("\n"); >>>> >>>> print_date_and_time((double)(-86399)); >>>> print_date_and_time((double)(-86400)); >>>> print_date_and_time((double)(-86401)); >>>> printf("\n"); >>>> >>>> print_date_and_time((double)INT_MAX); >>>> print_date_and_time((double)(INT_MAX+1)); >>>> print_date_and_time((double)UINT_MAX); >>>> } >>>> --- >>>> >>>> --- Run the test program >>>> $ ./test_print_time >>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>> >>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>> >>>> elapsed time: -86399 seconds (0d -23h -59m -59s) >>>> elapsed time: -86400 seconds (-1d 0h 0m 0s) >>>> elapsed time: -86401 seconds (-1d 0h 0m -1s) >>>> >>>> elapsed time: 2147483647 seconds (24855d 3h 14m 7s) >>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>> --- >>>> >>>> >>>> (2) Tested using a JNI program causing Segmentation Violation. >>>> Tested on the following platforms: >>>> solaris sparcv9 >>>> solaris x64 >>>> linux x86 >>>> linux x64 >>>> windows x86 >>>> windows x64 >>>> macosx x64 >>>> hs_err_pid.log file was successfully generated with expected >>>> ?elapsed time? line on each platform. >>>> >>>> >>>> --- TestCrash.java --- >>>> public class TestCrash { >>>> static { >>>> System.loadLibrary("testcrash"); >>>> } >>>> >>>> public static native void crash(); >>>> >>>> public static void main(String[] args) { >>>> try { >>>> Thread.sleep(61000); >>>> } catch (InterruptedException e) { >>>> e.printStackTrace(); >>>> } >>>> crash(); >>>> } >>>> } >>>> --- >>>> >>>> --- TestCrash.c --- >>>> #include >>>> >>>> #ifdef __cplusplus >>>> extern "C" { >>>> #endif >>>> /* >>>> * Class: TestCrash >>>> * Method: crash >>>> * Signature: ()V >>>> */ >>>> JNIEXPORT void JNICALL Java_TestCrash_crash(JNIEnv *env, jclass cls) { >>>> const char *p = "Hello, world!"; >>>> *(char *)p = 'a'; >>>> } >>>> >>>> #ifdef __cplusplus >>>> } >>>> #endif >>>> --- >>>> >>>> >>>> Thanks and best regards, >>>> Masato >>>> >>>> >>>> > From coleen.phillimore at oracle.com Wed Apr 2 14:31:12 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 02 Apr 2014 10:31:12 -0400 Subject: RR(S): 8026334: hs_err improvement: Print elapsed time in a humanly readable format In-Reply-To: <533C1E47.6090107@oracle.com> References: <53335DEE.3080805@oracle.com> <53336666.2060909@oracle.com> <533B275C.5070008@oracle.com> <533BC043.4050701@oracle.com> <533C1E47.6090107@oracle.com> Message-ID: <533C1F30.6060508@oracle.com> Looks good to me. Thanks for making the code humanly readable also :) Coleen On 4/2/14 10:27 AM, Kevin Walls wrote: > > Hi Dmitry, all, > > So we exchanged emails off the list about the accuracy, and are > content to keep the ints for the calculations. They can be > re-multiplied to accurately reconstruct the int value of the "elapsed > time" that we print, which we did as an exercise. Any accuracy > concerns after the initial cast from double to int, which we already > do, don't seem relevant within the expected uptime of most life forms, > let alone processes[1]. > > It is with formatting changes alone that we refresh the webrev: > > http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ > > Thanks > Kevin > > [1] that's a forward-looking statement, should come with a disclaimer. > > > > On 02/04/14 08:46, Dmitry Samersoff wrote: >> Kevin, >> >> 1. It's better to use double for arithmetics and convert it to int on >> printing. >> >> >> 2. we probably can get rid of intermittent variables >> day_secs, hour_secs, minute_secs >> >> >> 3. I would prefer to have constants as all-caps #defines outside of >> function definition or (if you or Coleen disagree with it) at least >> moved to ll.935 with empty line before and after it. >> >> -Dmitry >> >> On 2014-04-02 00:53, Kevin Walls wrote: >>> Thanks Coleen - >>> >>> Here's an update, the constants are good, here's an attempt to use >>> constants and keep it not too verbose: >>> >>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ >>> >>> Thanks >>> Kevin & Masato >>> >>> >>> On 26/03/14 23:44, Coleen Phillimore wrote: >>>> Can you make these expressions into a variable for the >>>> calculations? IE. >>>> 86400 = seconds_in_a_day >>>> 3600 = seconds_in_an_hour >>>> 60 = seconds_in_a_minute >>>> >>>> and then have >>>> eldays * 86400 be something like day_seconds >>>> >>>> Thanks - it would be nice if these numbers only appear once each. >>>> Coleen >>>> On 3/26/14 7:08 PM, Kevin Walls wrote: >>>>> Hi, >>>>> >>>>> I'd like to get a review of this change: >>>>> >>>>> It's adding a human-readable breakdown of the elapsed time, which is >>>>> currently printed in raw seconds in the hs_err file (it's the last >>>>> item printed). >>>>> >>>>> This is on behalf of Masato Yoshido who has worked on it. Further >>>>> details below, including a method that was used for manual testing. >>>>> >>>>> bug: >>>>> https://bugs.openjdk.java.net/browse/JDK-8026334 >>>>> >>>>> webrev: >>>>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.00/ >>>>> >>>>> Many thanks, >>>>> Kevin >>>>> Masato >>>>> >>>>> >>>>> [Change details] >>>>> >>>>> - Time format will change as follows: >>>>> >>>>> (from) >>>>> elapsed time: %d seconds >>>>> >>>>> (to) >>>>> elapsed time: %d seconds (%dd %dh %dm %ds) >>>>> >>>>> - The reason why I leave the original elapsed time format is: >>>>> -- We don?t need to remove the original format. If we remove >>>>> it, ones >>>>> who want time information in seconds need to calculate from >>>>> day-, >>>>> hour-, minute- and second-parts. >>>>> >>>>> - There is no code doing exactly the same thing. Another code to >>>>> which >>>>> we might be able to apply calculation similar to this >>>>> conversion is >>>>> the GC log with -XX:+PrintGCTimeStamps. However, the elapsed time >>>>> in GC log is a floating point number, while the time in hs_err log >>>>> is an integer since there is a problem when %f is used in printf >>>>> on Linux platform (See comments in os::print_date_and_time >>>>> function). >>>>> Therefore, the same code as this cannot simply be share with GC >>>>> log. >>>>> >>>>> >>>>> [Test] >>>>> >>>>> (1) Tested only part of code of elapsed time calculation and >>>>> printing. >>>>> >>>>> --- test_print_time.cpp --- >>>>> #include >>>>> #include >>>>> #include >>>>> >>>>> void print_date_and_time(double t) { >>>>> int eltime = (int)t; // elapsed time in seconds >>>>> int eldays, elhours, elminutes, elseconds; // for printing >>>>> elapsed >>>>> time in a humanly readable format >>>>> eldays = eltime / 86400; >>>>> elhours = (eltime - eldays * 86400) / 3600; >>>>> elminutes = (eltime - eldays * 86400 - elhours * 3600) / 60; >>>>> elseconds = (eltime - eldays * 86400 - elhours * 3600 - >>>>> elminutes * >>>>> 60); >>>>> printf("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, >>>>> eldays, elhours, elminutes, elseconds); >>>>> printf("\n"); >>>>> } >>>>> >>>>> int main(int argc, char *argv[]) { >>>>> print_date_and_time((double)86399); >>>>> print_date_and_time((double)86400); >>>>> print_date_and_time((double)86401); >>>>> printf("\n"); >>>>> >>>>> print_date_and_time((double)86399.999); >>>>> print_date_and_time((double)86400.999); >>>>> print_date_and_time((double)86401.999); >>>>> printf("\n"); >>>>> >>>>> print_date_and_time((double)(-86399)); >>>>> print_date_and_time((double)(-86400)); >>>>> print_date_and_time((double)(-86401)); >>>>> printf("\n"); >>>>> >>>>> print_date_and_time((double)INT_MAX); >>>>> print_date_and_time((double)(INT_MAX+1)); >>>>> print_date_and_time((double)UINT_MAX); >>>>> } >>>>> --- >>>>> >>>>> --- Run the test program >>>>> $ ./test_print_time >>>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>>> >>>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>>> >>>>> elapsed time: -86399 seconds (0d -23h -59m -59s) >>>>> elapsed time: -86400 seconds (-1d 0h 0m 0s) >>>>> elapsed time: -86401 seconds (-1d 0h 0m -1s) >>>>> >>>>> elapsed time: 2147483647 seconds (24855d 3h 14m 7s) >>>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>>> --- >>>>> >>>>> >>>>> (2) Tested using a JNI program causing Segmentation Violation. >>>>> Tested on the following platforms: >>>>> solaris sparcv9 >>>>> solaris x64 >>>>> linux x86 >>>>> linux x64 >>>>> windows x86 >>>>> windows x64 >>>>> macosx x64 >>>>> hs_err_pid.log file was successfully generated with >>>>> expected >>>>> ?elapsed time? line on each platform. >>>>> >>>>> >>>>> --- TestCrash.java --- >>>>> public class TestCrash { >>>>> static { >>>>> System.loadLibrary("testcrash"); >>>>> } >>>>> >>>>> public static native void crash(); >>>>> >>>>> public static void main(String[] args) { >>>>> try { >>>>> Thread.sleep(61000); >>>>> } catch (InterruptedException e) { >>>>> e.printStackTrace(); >>>>> } >>>>> crash(); >>>>> } >>>>> } >>>>> --- >>>>> >>>>> --- TestCrash.c --- >>>>> #include >>>>> >>>>> #ifdef __cplusplus >>>>> extern "C" { >>>>> #endif >>>>> /* >>>>> * Class: TestCrash >>>>> * Method: crash >>>>> * Signature: ()V >>>>> */ >>>>> JNIEXPORT void JNICALL Java_TestCrash_crash(JNIEnv *env, jclass >>>>> cls) { >>>>> const char *p = "Hello, world!"; >>>>> *(char *)p = 'a'; >>>>> } >>>>> >>>>> #ifdef __cplusplus >>>>> } >>>>> #endif >>>>> --- >>>>> >>>>> >>>>> Thanks and best regards, >>>>> Masato >>>>> >>>>> >>>>> >> > From dmitry.samersoff at oracle.com Wed Apr 2 14:34:40 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Wed, 02 Apr 2014 18:34:40 +0400 Subject: RR(S): 8026334: hs_err improvement: Print elapsed time in a humanly readable format In-Reply-To: <533C1E47.6090107@oracle.com> References: <53335DEE.3080805@oracle.com> <53336666.2060909@oracle.com> <533B275C.5070008@oracle.com> <533BC043.4050701@oracle.com> <533C1E47.6090107@oracle.com> Message-ID: <533C2000.4000108@oracle.com> Kevin, Looks good for me. -Dmitry On 2014-04-02 18:27, Kevin Walls wrote: > > Hi Dmitry, all, > > So we exchanged emails off the list about the accuracy, and are content > to keep the ints for the calculations. They can be re-multiplied to > accurately reconstruct the int value of the "elapsed time" that we > print, which we did as an exercise. Any accuracy concerns after the > initial cast from double to int, which we already do, don't seem > relevant within the expected uptime of most life forms, let alone > processes[1]. > > It is with formatting changes alone that we refresh the webrev: > > http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ > > Thanks > Kevin > > [1] that's a forward-looking statement, should come with a disclaimer. > > > > On 02/04/14 08:46, Dmitry Samersoff wrote: >> Kevin, >> >> 1. It's better to use double for arithmetics and convert it to int on >> printing. >> >> >> 2. we probably can get rid of intermittent variables >> day_secs, hour_secs, minute_secs >> >> >> 3. I would prefer to have constants as all-caps #defines outside of >> function definition or (if you or Coleen disagree with it) at least >> moved to ll.935 with empty line before and after it. >> >> -Dmitry >> >> On 2014-04-02 00:53, Kevin Walls wrote: >>> Thanks Coleen - >>> >>> Here's an update, the constants are good, here's an attempt to use >>> constants and keep it not too verbose: >>> >>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ >>> >>> Thanks >>> Kevin & Masato >>> >>> >>> On 26/03/14 23:44, Coleen Phillimore wrote: >>>> Can you make these expressions into a variable for the >>>> calculations? IE. >>>> 86400 = seconds_in_a_day >>>> 3600 = seconds_in_an_hour >>>> 60 = seconds_in_a_minute >>>> >>>> and then have >>>> eldays * 86400 be something like day_seconds >>>> >>>> Thanks - it would be nice if these numbers only appear once each. >>>> Coleen >>>> On 3/26/14 7:08 PM, Kevin Walls wrote: >>>>> Hi, >>>>> >>>>> I'd like to get a review of this change: >>>>> >>>>> It's adding a human-readable breakdown of the elapsed time, which is >>>>> currently printed in raw seconds in the hs_err file (it's the last >>>>> item printed). >>>>> >>>>> This is on behalf of Masato Yoshido who has worked on it. Further >>>>> details below, including a method that was used for manual testing. >>>>> >>>>> bug: >>>>> https://bugs.openjdk.java.net/browse/JDK-8026334 >>>>> >>>>> webrev: >>>>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.00/ >>>>> >>>>> Many thanks, >>>>> Kevin >>>>> Masato >>>>> >>>>> >>>>> [Change details] >>>>> >>>>> - Time format will change as follows: >>>>> >>>>> (from) >>>>> elapsed time: %d seconds >>>>> >>>>> (to) >>>>> elapsed time: %d seconds (%dd %dh %dm %ds) >>>>> >>>>> - The reason why I leave the original elapsed time format is: >>>>> -- We don?t need to remove the original format. If we remove it, >>>>> ones >>>>> who want time information in seconds need to calculate from >>>>> day-, >>>>> hour-, minute- and second-parts. >>>>> >>>>> - There is no code doing exactly the same thing. Another code to which >>>>> we might be able to apply calculation similar to this conversion is >>>>> the GC log with -XX:+PrintGCTimeStamps. However, the elapsed time >>>>> in GC log is a floating point number, while the time in hs_err log >>>>> is an integer since there is a problem when %f is used in printf >>>>> on Linux platform (See comments in os::print_date_and_time >>>>> function). >>>>> Therefore, the same code as this cannot simply be share with GC >>>>> log. >>>>> >>>>> >>>>> [Test] >>>>> >>>>> (1) Tested only part of code of elapsed time calculation and printing. >>>>> >>>>> --- test_print_time.cpp --- >>>>> #include >>>>> #include >>>>> #include >>>>> >>>>> void print_date_and_time(double t) { >>>>> int eltime = (int)t; // elapsed time in seconds >>>>> int eldays, elhours, elminutes, elseconds; // for printing elapsed >>>>> time in a humanly readable format >>>>> eldays = eltime / 86400; >>>>> elhours = (eltime - eldays * 86400) / 3600; >>>>> elminutes = (eltime - eldays * 86400 - elhours * 3600) / 60; >>>>> elseconds = (eltime - eldays * 86400 - elhours * 3600 - elminutes * >>>>> 60); >>>>> printf("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, >>>>> eldays, elhours, elminutes, elseconds); >>>>> printf("\n"); >>>>> } >>>>> >>>>> int main(int argc, char *argv[]) { >>>>> print_date_and_time((double)86399); >>>>> print_date_and_time((double)86400); >>>>> print_date_and_time((double)86401); >>>>> printf("\n"); >>>>> >>>>> print_date_and_time((double)86399.999); >>>>> print_date_and_time((double)86400.999); >>>>> print_date_and_time((double)86401.999); >>>>> printf("\n"); >>>>> >>>>> print_date_and_time((double)(-86399)); >>>>> print_date_and_time((double)(-86400)); >>>>> print_date_and_time((double)(-86401)); >>>>> printf("\n"); >>>>> >>>>> print_date_and_time((double)INT_MAX); >>>>> print_date_and_time((double)(INT_MAX+1)); >>>>> print_date_and_time((double)UINT_MAX); >>>>> } >>>>> --- >>>>> >>>>> --- Run the test program >>>>> $ ./test_print_time >>>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>>> >>>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>>> >>>>> elapsed time: -86399 seconds (0d -23h -59m -59s) >>>>> elapsed time: -86400 seconds (-1d 0h 0m 0s) >>>>> elapsed time: -86401 seconds (-1d 0h 0m -1s) >>>>> >>>>> elapsed time: 2147483647 seconds (24855d 3h 14m 7s) >>>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>>> --- >>>>> >>>>> >>>>> (2) Tested using a JNI program causing Segmentation Violation. >>>>> Tested on the following platforms: >>>>> solaris sparcv9 >>>>> solaris x64 >>>>> linux x86 >>>>> linux x64 >>>>> windows x86 >>>>> windows x64 >>>>> macosx x64 >>>>> hs_err_pid.log file was successfully generated with expected >>>>> ?elapsed time? line on each platform. >>>>> >>>>> >>>>> --- TestCrash.java --- >>>>> public class TestCrash { >>>>> static { >>>>> System.loadLibrary("testcrash"); >>>>> } >>>>> >>>>> public static native void crash(); >>>>> >>>>> public static void main(String[] args) { >>>>> try { >>>>> Thread.sleep(61000); >>>>> } catch (InterruptedException e) { >>>>> e.printStackTrace(); >>>>> } >>>>> crash(); >>>>> } >>>>> } >>>>> --- >>>>> >>>>> --- TestCrash.c --- >>>>> #include >>>>> >>>>> #ifdef __cplusplus >>>>> extern "C" { >>>>> #endif >>>>> /* >>>>> * Class: TestCrash >>>>> * Method: crash >>>>> * Signature: ()V >>>>> */ >>>>> JNIEXPORT void JNICALL Java_TestCrash_crash(JNIEnv *env, jclass cls) { >>>>> const char *p = "Hello, world!"; >>>>> *(char *)p = 'a'; >>>>> } >>>>> >>>>> #ifdef __cplusplus >>>>> } >>>>> #endif >>>>> --- >>>>> >>>>> >>>>> Thanks and best regards, >>>>> Masato >>>>> >>>>> >>>>> >> > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From kevin.walls at oracle.com Wed Apr 2 14:35:37 2014 From: kevin.walls at oracle.com (Kevin Walls) Date: Wed, 02 Apr 2014 15:35:37 +0100 Subject: RR(S): 8026334: hs_err improvement: Print elapsed time in a humanly readable format In-Reply-To: <533C2000.4000108@oracle.com> References: <53335DEE.3080805@oracle.com> <53336666.2060909@oracle.com> <533B275C.5070008@oracle.com> <533BC043.4050701@oracle.com> <533C1E47.6090107@oracle.com> <533C2000.4000108@oracle.com> Message-ID: <533C2039.1000508@oracle.com> Great, thanks Coleen, thanks Dmitry! Regards Kevin On 02/04/14 15:34, Dmitry Samersoff wrote: > Kevin, > > Looks good for me. > > -Dmitry > > On 2014-04-02 18:27, Kevin Walls wrote: >> Hi Dmitry, all, >> >> So we exchanged emails off the list about the accuracy, and are content >> to keep the ints for the calculations. They can be re-multiplied to >> accurately reconstruct the int value of the "elapsed time" that we >> print, which we did as an exercise. Any accuracy concerns after the >> initial cast from double to int, which we already do, don't seem >> relevant within the expected uptime of most life forms, let alone >> processes[1]. >> >> It is with formatting changes alone that we refresh the webrev: >> >> http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ >> >> Thanks >> Kevin >> >> [1] that's a forward-looking statement, should come with a disclaimer. >> >> >> >> On 02/04/14 08:46, Dmitry Samersoff wrote: >>> Kevin, >>> >>> 1. It's better to use double for arithmetics and convert it to int on >>> printing. >>> >>> >>> 2. we probably can get rid of intermittent variables >>> day_secs, hour_secs, minute_secs >>> >>> >>> 3. I would prefer to have constants as all-caps #defines outside of >>> function definition or (if you or Coleen disagree with it) at least >>> moved to ll.935 with empty line before and after it. >>> >>> -Dmitry >>> >>> On 2014-04-02 00:53, Kevin Walls wrote: >>>> Thanks Coleen - >>>> >>>> Here's an update, the constants are good, here's an attempt to use >>>> constants and keep it not too verbose: >>>> >>>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.01/ >>>> >>>> Thanks >>>> Kevin & Masato >>>> >>>> >>>> On 26/03/14 23:44, Coleen Phillimore wrote: >>>>> Can you make these expressions into a variable for the >>>>> calculations? IE. >>>>> 86400 = seconds_in_a_day >>>>> 3600 = seconds_in_an_hour >>>>> 60 = seconds_in_a_minute >>>>> >>>>> and then have >>>>> eldays * 86400 be something like day_seconds >>>>> >>>>> Thanks - it would be nice if these numbers only appear once each. >>>>> Coleen >>>>> On 3/26/14 7:08 PM, Kevin Walls wrote: >>>>>> Hi, >>>>>> >>>>>> I'd like to get a review of this change: >>>>>> >>>>>> It's adding a human-readable breakdown of the elapsed time, which is >>>>>> currently printed in raw seconds in the hs_err file (it's the last >>>>>> item printed). >>>>>> >>>>>> This is on behalf of Masato Yoshido who has worked on it. Further >>>>>> details below, including a method that was used for manual testing. >>>>>> >>>>>> bug: >>>>>> https://bugs.openjdk.java.net/browse/JDK-8026334 >>>>>> >>>>>> webrev: >>>>>> http://cr.openjdk.java.net/~kevinw/8026334/webrev.00/ >>>>>> >>>>>> Many thanks, >>>>>> Kevin >>>>>> Masato >>>>>> >>>>>> >>>>>> [Change details] >>>>>> >>>>>> - Time format will change as follows: >>>>>> >>>>>> (from) >>>>>> elapsed time: %d seconds >>>>>> >>>>>> (to) >>>>>> elapsed time: %d seconds (%dd %dh %dm %ds) >>>>>> >>>>>> - The reason why I leave the original elapsed time format is: >>>>>> -- We don?t need to remove the original format. If we remove it, >>>>>> ones >>>>>> who want time information in seconds need to calculate from >>>>>> day-, >>>>>> hour-, minute- and second-parts. >>>>>> >>>>>> - There is no code doing exactly the same thing. Another code to which >>>>>> we might be able to apply calculation similar to this conversion is >>>>>> the GC log with -XX:+PrintGCTimeStamps. However, the elapsed time >>>>>> in GC log is a floating point number, while the time in hs_err log >>>>>> is an integer since there is a problem when %f is used in printf >>>>>> on Linux platform (See comments in os::print_date_and_time >>>>>> function). >>>>>> Therefore, the same code as this cannot simply be share with GC >>>>>> log. >>>>>> >>>>>> >>>>>> [Test] >>>>>> >>>>>> (1) Tested only part of code of elapsed time calculation and printing. >>>>>> >>>>>> --- test_print_time.cpp --- >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> >>>>>> void print_date_and_time(double t) { >>>>>> int eltime = (int)t; // elapsed time in seconds >>>>>> int eldays, elhours, elminutes, elseconds; // for printing elapsed >>>>>> time in a humanly readable format >>>>>> eldays = eltime / 86400; >>>>>> elhours = (eltime - eldays * 86400) / 3600; >>>>>> elminutes = (eltime - eldays * 86400 - elhours * 3600) / 60; >>>>>> elseconds = (eltime - eldays * 86400 - elhours * 3600 - elminutes * >>>>>> 60); >>>>>> printf("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, >>>>>> eldays, elhours, elminutes, elseconds); >>>>>> printf("\n"); >>>>>> } >>>>>> >>>>>> int main(int argc, char *argv[]) { >>>>>> print_date_and_time((double)86399); >>>>>> print_date_and_time((double)86400); >>>>>> print_date_and_time((double)86401); >>>>>> printf("\n"); >>>>>> >>>>>> print_date_and_time((double)86399.999); >>>>>> print_date_and_time((double)86400.999); >>>>>> print_date_and_time((double)86401.999); >>>>>> printf("\n"); >>>>>> >>>>>> print_date_and_time((double)(-86399)); >>>>>> print_date_and_time((double)(-86400)); >>>>>> print_date_and_time((double)(-86401)); >>>>>> printf("\n"); >>>>>> >>>>>> print_date_and_time((double)INT_MAX); >>>>>> print_date_and_time((double)(INT_MAX+1)); >>>>>> print_date_and_time((double)UINT_MAX); >>>>>> } >>>>>> --- >>>>>> >>>>>> --- Run the test program >>>>>> $ ./test_print_time >>>>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>>>> >>>>>> elapsed time: 86399 seconds (0d 23h 59m 59s) >>>>>> elapsed time: 86400 seconds (1d 0h 0m 0s) >>>>>> elapsed time: 86401 seconds (1d 0h 0m 1s) >>>>>> >>>>>> elapsed time: -86399 seconds (0d -23h -59m -59s) >>>>>> elapsed time: -86400 seconds (-1d 0h 0m 0s) >>>>>> elapsed time: -86401 seconds (-1d 0h 0m -1s) >>>>>> >>>>>> elapsed time: 2147483647 seconds (24855d 3h 14m 7s) >>>>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>>>> elapsed time: -2147483648 seconds (-24855d -3h -14m -8s) >>>>>> --- >>>>>> >>>>>> >>>>>> (2) Tested using a JNI program causing Segmentation Violation. >>>>>> Tested on the following platforms: >>>>>> solaris sparcv9 >>>>>> solaris x64 >>>>>> linux x86 >>>>>> linux x64 >>>>>> windows x86 >>>>>> windows x64 >>>>>> macosx x64 >>>>>> hs_err_pid.log file was successfully generated with expected >>>>>> ?elapsed time? line on each platform. >>>>>> >>>>>> >>>>>> --- TestCrash.java --- >>>>>> public class TestCrash { >>>>>> static { >>>>>> System.loadLibrary("testcrash"); >>>>>> } >>>>>> >>>>>> public static native void crash(); >>>>>> >>>>>> public static void main(String[] args) { >>>>>> try { >>>>>> Thread.sleep(61000); >>>>>> } catch (InterruptedException e) { >>>>>> e.printStackTrace(); >>>>>> } >>>>>> crash(); >>>>>> } >>>>>> } >>>>>> --- >>>>>> >>>>>> --- TestCrash.c --- >>>>>> #include >>>>>> >>>>>> #ifdef __cplusplus >>>>>> extern "C" { >>>>>> #endif >>>>>> /* >>>>>> * Class: TestCrash >>>>>> * Method: crash >>>>>> * Signature: ()V >>>>>> */ >>>>>> JNIEXPORT void JNICALL Java_TestCrash_crash(JNIEnv *env, jclass cls) { >>>>>> const char *p = "Hello, world!"; >>>>>> *(char *)p = 'a'; >>>>>> } >>>>>> >>>>>> #ifdef __cplusplus >>>>>> } >>>>>> #endif >>>>>> --- >>>>>> >>>>>> >>>>>> Thanks and best regards, >>>>>> Masato >>>>>> >>>>>> >>>>>> > From andreas.eriksson at oracle.com Wed Apr 2 15:26:46 2014 From: andreas.eriksson at oracle.com (Andreas Eriksson) Date: Wed, 02 Apr 2014 17:26:46 +0200 Subject: RFR: JDK-8033696: "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction In-Reply-To: <5332A001.3080203@oracle.com> References: <52F8FC95.5090608@oracle.com> <530E4B1C.2070201@oracle.com> <530F122F.1090107@oracle.com> <530F23DE.8010008@oracle.com> <530F30C1.7070601@oracle.com> <53151A83.1090106@oracle.com> <5331529E.8090209@oracle.com> <5332A001.3080203@oracle.com> Message-ID: <533C2C36.1060106@oracle.com> Thanks David. Could I get a second review as well? Thanks, Andreas On 2014-03-26 10:38, David Holmes wrote: > Still seems okay to me. > > Thanks, > David > > On 25/03/2014 7:55 PM, Andreas Eriksson wrote: >> Hi, >> >> Could I get some eyes on this new webrev? >> >> Thanks, >> Andreas >> >> On 2014-03-04 01:12, Andreas Eriksson wrote: >>> That output was because the VMThread didn't reset it's TLS before >>> exiting (presumably since the VM is shutting down anyway). >>> This meant that the thread pointer destructor was run until the >>> pthread implementation gave up. >>> I added code that sets the thread pointer to NULL before exiting the >>> VMThread, ensuring the thread pointer destructor is never called for >>> the exiting VMThread. >>> >>> A new updated webrev can be found here: >>> http://cr.openjdk.java.net/~aeriksso/8033696/webrev.01/ >>> >>> I also removed the bug reference from the comments, since I got the >>> feeling that it's usually discouraged. >>> >>> Thanks, >>> Andreas >>> >>> On 2014-02-27 13:34, Andreas Eriksson wrote: >>>> Oh, sorry, I misread your mail. >>>> >>>> I will look into the pthread output from java -version. >>>> >>>> Thread 80103f400 has exited with leftover thread-specific data after 4 >>>> destructor iterations >>>> >>>> Thanks, >>>> Andreas >>>> >>>> On 2014-02-27 12:39, Dmitry Samersoff wrote: >>>>> Andreas, >>>>> >>>>> I's not growing - always only two threads. >>>>> >>>>> -Dmitry >>>>> >>>>> On 2014-02-27 14:23, Andreas Eriksson wrote: >>>>>> Thanks Dmitry. >>>>>> >>>>>> There are no crashes, only an assert that is hit if running with a >>>>>> debug >>>>>> build. >>>>>> Otherwise the active threads keep growing, like you are seeing. >>>>>> >>>>>> It is worrying that they keep growing with the patch as well. >>>>>> I will have to look at it and see what can be done. >>>>>> >>>>>> Regards, >>>>>> Andreas >>>>>> >>>>>> On 2014-02-26 21:14, Dmitry Samersoff wrote: >>>>>>> Andreas, >>>>>>> >>>>>>> With JDK7 I didn't observe any crash with or without your patch. >>>>>>> Without the patch the number of active threads constantly grows, >>>>>>> with patch it remains the same. >>>>>>> >>>>>>> >>>>>>> uname -a >>>>>>> FreeBSD samersoff.net 9.2-RELEASE FreeBSD 9.2-RELEASE #1: Thu >>>>>>> Jan 2 >>>>>>> 02:15:13 MSK 2014 dms at minext:/sys/amd64/compile/MIRCAT amd64 >>>>>>> >>>>>>> >>>>>>> With patch: >>>>>>> >>>>>>> #java -version >>>>>>> >>>>>>> openjdk version "1.7.0_45" >>>>>>> OpenJDK Runtime Environment (build 1.7.0_45-b18) >>>>>>> OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode) >>>>>>> Thread 80103f400 has exited with leftover thread-specific data >>>>>>> after 4 >>>>>>> destructor iterations >>>>>>> >>>>>>> #$JAVA_HOME/bin/java -Djava.library.path=$NATIVE >>>>>>> com.test.callback.App >>>>>>> >>>>>>> Java callback: native thread: 34376799232, java thread: >>>>>>> Thread-391, 2 >>>>>>> active threads >>>>>>> Successfully detached native thread 0x801045400 >>>>>>> Deleting callback >>>>>>> >>>>>>> >>>>>>> Without patch: >>>>>>> >>>>>>> #/opt/openjdk7/bin/java -version >>>>>>> >>>>>>> openjdk version "1.7.0_25" >>>>>>> OpenJDK Runtime Environment (build 1.7.0_25-b15) >>>>>>> OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) >>>>>>> >>>>>>> #/opt/openjdk7/bin/java -Djava.library.path=$NATIVE >>>>>>> com.test.callback.App >>>>>>> >>>>>>> Java callback: native thread: 34376788992, java thread: >>>>>>> Thread-402, 404 >>>>>>> active threads >>>>>>> Successfully detached native thread 0x801042c00 >>>>>>> Deleting callback >>>>>>> >>>>>>> -Dmitry >>>>>>> >>>>>>> >>>>>>> On 2014-02-10 20:21, Andreas Eriksson wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> Could I please get reviews for this change. >>>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8033696 >>>>>>>> Webrev: http://cr.openjdk.java.net/~aeriksso/8033696/webrev.00/ >>>>>>>> Mail discussion: >>>>>>>> http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-February/010759.html >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Summary: >>>>>>>> JNI code is using pthread_key_create with a destructor to >>>>>>>> detach the >>>>>>>> thread from the JVM when the thread is exiting. >>>>>>>> For some flavors of Linux and BSD the JVM is also using the >>>>>>>> pthread_key_create, to store the Thread::current() value in a >>>>>>>> thread >>>>>>>> local storage. >>>>>>>> Since the thread local storage containing the thread pointer is >>>>>>>> erased >>>>>>>> (by pthread) before the JNI destructor runs, we run >>>>>>>> detachCurrentThread >>>>>>>> on a thread that has NULL as current thread. >>>>>>>> This fix uses a destructor for the thread pointer that restores >>>>>>>> the >>>>>>>> value, so that the JNI destructor can run detachCurrentThread >>>>>>>> successfully. >>>>>>>> More info in JBS. >>>>>>>> >>>>>>>> Testing: >>>>>>>> Native code regtest attached to JBS tested on Linux, but not on >>>>>>>> Mac >>>>>>>> since I don't have access to one. >>>>>>>> JPRT ran without a problem. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Andreas >>>>> >>>> >>> >> From dmitry.samersoff at oracle.com Wed Apr 2 15:36:22 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Wed, 02 Apr 2014 19:36:22 +0400 Subject: RFR: JDK-8033696: "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction In-Reply-To: <533C2C36.1060106@oracle.com> References: <52F8FC95.5090608@oracle.com> <530E4B1C.2070201@oracle.com> <530F122F.1090107@oracle.com> <530F23DE.8010008@oracle.com> <530F30C1.7070601@oracle.com> <53151A83.1090106@oracle.com> <5331529E.8090209@oracle.com> <5332A001.3080203@oracle.com> <533C2C36.1060106@oracle.com> Message-ID: <533C2E76.5030903@oracle.com> Andreas, Looks good for me! -Dmitry On 2014-04-02 19:26, Andreas Eriksson wrote: > Thanks David. > > Could I get a second review as well? > > Thanks, > Andreas > > On 2014-03-26 10:38, David Holmes wrote: >> Still seems okay to me. >> >> Thanks, >> David >> >> On 25/03/2014 7:55 PM, Andreas Eriksson wrote: >>> Hi, >>> >>> Could I get some eyes on this new webrev? >>> >>> Thanks, >>> Andreas >>> >>> On 2014-03-04 01:12, Andreas Eriksson wrote: >>>> That output was because the VMThread didn't reset it's TLS before >>>> exiting (presumably since the VM is shutting down anyway). >>>> This meant that the thread pointer destructor was run until the >>>> pthread implementation gave up. >>>> I added code that sets the thread pointer to NULL before exiting the >>>> VMThread, ensuring the thread pointer destructor is never called for >>>> the exiting VMThread. >>>> >>>> A new updated webrev can be found here: >>>> http://cr.openjdk.java.net/~aeriksso/8033696/webrev.01/ >>>> >>>> I also removed the bug reference from the comments, since I got the >>>> feeling that it's usually discouraged. >>>> >>>> Thanks, >>>> Andreas >>>> >>>> On 2014-02-27 13:34, Andreas Eriksson wrote: >>>>> Oh, sorry, I misread your mail. >>>>> >>>>> I will look into the pthread output from java -version. >>>>> >>>>> Thread 80103f400 has exited with leftover thread-specific data after 4 >>>>> destructor iterations >>>>> >>>>> Thanks, >>>>> Andreas >>>>> >>>>> On 2014-02-27 12:39, Dmitry Samersoff wrote: >>>>>> Andreas, >>>>>> >>>>>> I's not growing - always only two threads. >>>>>> >>>>>> -Dmitry >>>>>> >>>>>> On 2014-02-27 14:23, Andreas Eriksson wrote: >>>>>>> Thanks Dmitry. >>>>>>> >>>>>>> There are no crashes, only an assert that is hit if running with a >>>>>>> debug >>>>>>> build. >>>>>>> Otherwise the active threads keep growing, like you are seeing. >>>>>>> >>>>>>> It is worrying that they keep growing with the patch as well. >>>>>>> I will have to look at it and see what can be done. >>>>>>> >>>>>>> Regards, >>>>>>> Andreas >>>>>>> >>>>>>> On 2014-02-26 21:14, Dmitry Samersoff wrote: >>>>>>>> Andreas, >>>>>>>> >>>>>>>> With JDK7 I didn't observe any crash with or without your patch. >>>>>>>> Without the patch the number of active threads constantly grows, >>>>>>>> with patch it remains the same. >>>>>>>> >>>>>>>> >>>>>>>> uname -a >>>>>>>> FreeBSD samersoff.net 9.2-RELEASE FreeBSD 9.2-RELEASE #1: Thu >>>>>>>> Jan 2 >>>>>>>> 02:15:13 MSK 2014 dms at minext:/sys/amd64/compile/MIRCAT amd64 >>>>>>>> >>>>>>>> >>>>>>>> With patch: >>>>>>>> >>>>>>>> #java -version >>>>>>>> >>>>>>>> openjdk version "1.7.0_45" >>>>>>>> OpenJDK Runtime Environment (build 1.7.0_45-b18) >>>>>>>> OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode) >>>>>>>> Thread 80103f400 has exited with leftover thread-specific data >>>>>>>> after 4 >>>>>>>> destructor iterations >>>>>>>> >>>>>>>> #$JAVA_HOME/bin/java -Djava.library.path=$NATIVE >>>>>>>> com.test.callback.App >>>>>>>> >>>>>>>> Java callback: native thread: 34376799232, java thread: >>>>>>>> Thread-391, 2 >>>>>>>> active threads >>>>>>>> Successfully detached native thread 0x801045400 >>>>>>>> Deleting callback >>>>>>>> >>>>>>>> >>>>>>>> Without patch: >>>>>>>> >>>>>>>> #/opt/openjdk7/bin/java -version >>>>>>>> >>>>>>>> openjdk version "1.7.0_25" >>>>>>>> OpenJDK Runtime Environment (build 1.7.0_25-b15) >>>>>>>> OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) >>>>>>>> >>>>>>>> #/opt/openjdk7/bin/java -Djava.library.path=$NATIVE >>>>>>>> com.test.callback.App >>>>>>>> >>>>>>>> Java callback: native thread: 34376788992, java thread: >>>>>>>> Thread-402, 404 >>>>>>>> active threads >>>>>>>> Successfully detached native thread 0x801042c00 >>>>>>>> Deleting callback >>>>>>>> >>>>>>>> -Dmitry >>>>>>>> >>>>>>>> >>>>>>>> On 2014-02-10 20:21, Andreas Eriksson wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> Could I please get reviews for this change. >>>>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8033696 >>>>>>>>> Webrev: http://cr.openjdk.java.net/~aeriksso/8033696/webrev.00/ >>>>>>>>> Mail discussion: >>>>>>>>> http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-February/010759.html >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Summary: >>>>>>>>> JNI code is using pthread_key_create with a destructor to >>>>>>>>> detach the >>>>>>>>> thread from the JVM when the thread is exiting. >>>>>>>>> For some flavors of Linux and BSD the JVM is also using the >>>>>>>>> pthread_key_create, to store the Thread::current() value in a >>>>>>>>> thread >>>>>>>>> local storage. >>>>>>>>> Since the thread local storage containing the thread pointer is >>>>>>>>> erased >>>>>>>>> (by pthread) before the JNI destructor runs, we run >>>>>>>>> detachCurrentThread >>>>>>>>> on a thread that has NULL as current thread. >>>>>>>>> This fix uses a destructor for the thread pointer that restores >>>>>>>>> the >>>>>>>>> value, so that the JNI destructor can run detachCurrentThread >>>>>>>>> successfully. >>>>>>>>> More info in JBS. >>>>>>>>> >>>>>>>>> Testing: >>>>>>>>> Native code regtest attached to JBS tested on Linux, but not on >>>>>>>>> Mac >>>>>>>>> since I don't have access to one. >>>>>>>>> JPRT ran without a problem. >>>>>>>>> >>>>>>>>> Regards, >>>>>>>>> Andreas >>>>>> >>>>> >>>> >>> > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From andreas.eriksson at oracle.com Wed Apr 2 15:49:48 2014 From: andreas.eriksson at oracle.com (Andreas Eriksson) Date: Wed, 02 Apr 2014 17:49:48 +0200 Subject: RFR: JDK-8033696: "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction In-Reply-To: <533C2E76.5030903@oracle.com> References: <52F8FC95.5090608@oracle.com> <530E4B1C.2070201@oracle.com> <530F122F.1090107@oracle.com> <530F23DE.8010008@oracle.com> <530F30C1.7070601@oracle.com> <53151A83.1090106@oracle.com> <5331529E.8090209@oracle.com> <5332A001.3080203@oracle.com> <533C2C36.1060106@oracle.com> <533C2E76.5030903@oracle.com> Message-ID: <533C319C.9080105@oracle.com> Thanks Dmitry. /Andreas On 2014-04-02 17:36, Dmitry Samersoff wrote: > Andreas, > > Looks good for me! > > -Dmitry > > On 2014-04-02 19:26, Andreas Eriksson wrote: >> Thanks David. >> >> Could I get a second review as well? >> >> Thanks, >> Andreas >> >> On 2014-03-26 10:38, David Holmes wrote: >>> Still seems okay to me. >>> >>> Thanks, >>> David >>> >>> On 25/03/2014 7:55 PM, Andreas Eriksson wrote: >>>> Hi, >>>> >>>> Could I get some eyes on this new webrev? >>>> >>>> Thanks, >>>> Andreas >>>> >>>> On 2014-03-04 01:12, Andreas Eriksson wrote: >>>>> That output was because the VMThread didn't reset it's TLS before >>>>> exiting (presumably since the VM is shutting down anyway). >>>>> This meant that the thread pointer destructor was run until the >>>>> pthread implementation gave up. >>>>> I added code that sets the thread pointer to NULL before exiting the >>>>> VMThread, ensuring the thread pointer destructor is never called for >>>>> the exiting VMThread. >>>>> >>>>> A new updated webrev can be found here: >>>>> http://cr.openjdk.java.net/~aeriksso/8033696/webrev.01/ >>>>> >>>>> I also removed the bug reference from the comments, since I got the >>>>> feeling that it's usually discouraged. >>>>> >>>>> Thanks, >>>>> Andreas >>>>> >>>>> On 2014-02-27 13:34, Andreas Eriksson wrote: >>>>>> Oh, sorry, I misread your mail. >>>>>> >>>>>> I will look into the pthread output from java -version. >>>>>> >>>>>> Thread 80103f400 has exited with leftover thread-specific data after 4 >>>>>> destructor iterations >>>>>> >>>>>> Thanks, >>>>>> Andreas >>>>>> >>>>>> On 2014-02-27 12:39, Dmitry Samersoff wrote: >>>>>>> Andreas, >>>>>>> >>>>>>> I's not growing - always only two threads. >>>>>>> >>>>>>> -Dmitry >>>>>>> >>>>>>> On 2014-02-27 14:23, Andreas Eriksson wrote: >>>>>>>> Thanks Dmitry. >>>>>>>> >>>>>>>> There are no crashes, only an assert that is hit if running with a >>>>>>>> debug >>>>>>>> build. >>>>>>>> Otherwise the active threads keep growing, like you are seeing. >>>>>>>> >>>>>>>> It is worrying that they keep growing with the patch as well. >>>>>>>> I will have to look at it and see what can be done. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Andreas >>>>>>>> >>>>>>>> On 2014-02-26 21:14, Dmitry Samersoff wrote: >>>>>>>>> Andreas, >>>>>>>>> >>>>>>>>> With JDK7 I didn't observe any crash with or without your patch. >>>>>>>>> Without the patch the number of active threads constantly grows, >>>>>>>>> with patch it remains the same. >>>>>>>>> >>>>>>>>> >>>>>>>>> uname -a >>>>>>>>> FreeBSD samersoff.net 9.2-RELEASE FreeBSD 9.2-RELEASE #1: Thu >>>>>>>>> Jan 2 >>>>>>>>> 02:15:13 MSK 2014 dms at minext:/sys/amd64/compile/MIRCAT amd64 >>>>>>>>> >>>>>>>>> >>>>>>>>> With patch: >>>>>>>>> >>>>>>>>> #java -version >>>>>>>>> >>>>>>>>> openjdk version "1.7.0_45" >>>>>>>>> OpenJDK Runtime Environment (build 1.7.0_45-b18) >>>>>>>>> OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode) >>>>>>>>> Thread 80103f400 has exited with leftover thread-specific data >>>>>>>>> after 4 >>>>>>>>> destructor iterations >>>>>>>>> >>>>>>>>> #$JAVA_HOME/bin/java -Djava.library.path=$NATIVE >>>>>>>>> com.test.callback.App >>>>>>>>> >>>>>>>>> Java callback: native thread: 34376799232, java thread: >>>>>>>>> Thread-391, 2 >>>>>>>>> active threads >>>>>>>>> Successfully detached native thread 0x801045400 >>>>>>>>> Deleting callback >>>>>>>>> >>>>>>>>> >>>>>>>>> Without patch: >>>>>>>>> >>>>>>>>> #/opt/openjdk7/bin/java -version >>>>>>>>> >>>>>>>>> openjdk version "1.7.0_25" >>>>>>>>> OpenJDK Runtime Environment (build 1.7.0_25-b15) >>>>>>>>> OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) >>>>>>>>> >>>>>>>>> #/opt/openjdk7/bin/java -Djava.library.path=$NATIVE >>>>>>>>> com.test.callback.App >>>>>>>>> >>>>>>>>> Java callback: native thread: 34376788992, java thread: >>>>>>>>> Thread-402, 404 >>>>>>>>> active threads >>>>>>>>> Successfully detached native thread 0x801042c00 >>>>>>>>> Deleting callback >>>>>>>>> >>>>>>>>> -Dmitry >>>>>>>>> >>>>>>>>> >>>>>>>>> On 2014-02-10 20:21, Andreas Eriksson wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> Could I please get reviews for this change. >>>>>>>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8033696 >>>>>>>>>> Webrev: http://cr.openjdk.java.net/~aeriksso/8033696/webrev.00/ >>>>>>>>>> Mail discussion: >>>>>>>>>> http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-February/010759.html >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Summary: >>>>>>>>>> JNI code is using pthread_key_create with a destructor to >>>>>>>>>> detach the >>>>>>>>>> thread from the JVM when the thread is exiting. >>>>>>>>>> For some flavors of Linux and BSD the JVM is also using the >>>>>>>>>> pthread_key_create, to store the Thread::current() value in a >>>>>>>>>> thread >>>>>>>>>> local storage. >>>>>>>>>> Since the thread local storage containing the thread pointer is >>>>>>>>>> erased >>>>>>>>>> (by pthread) before the JNI destructor runs, we run >>>>>>>>>> detachCurrentThread >>>>>>>>>> on a thread that has NULL as current thread. >>>>>>>>>> This fix uses a destructor for the thread pointer that restores >>>>>>>>>> the >>>>>>>>>> value, so that the JNI destructor can run detachCurrentThread >>>>>>>>>> successfully. >>>>>>>>>> More info in JBS. >>>>>>>>>> >>>>>>>>>> Testing: >>>>>>>>>> Native code regtest attached to JBS tested on Linux, but not on >>>>>>>>>> Mac >>>>>>>>>> since I don't have access to one. >>>>>>>>>> JPRT ran without a problem. >>>>>>>>>> >>>>>>>>>> Regards, >>>>>>>>>> Andreas > From yumin.qi at oracle.com Wed Apr 2 17:33:11 2014 From: yumin.qi at oracle.com (Yumin Qi) Date: Wed, 02 Apr 2014 10:33:11 -0700 Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness In-Reply-To: <74f24048-4476-46db-ade9-8c5085b581c9@default> References: <74f24048-4476-46db-ade9-8c5085b581c9@default> Message-ID: <533C49D7.8030104@oracle.com> Markus, Excellent finding and fix. I have question: 324 StackValueCollection* interpretedVFrame::expressions() const { 325 326 int length = 0; 327 InterpreterOopMap oop_mask; <<<< ------------------ default initialize will set _expression_stack_size to 0. 328 329 if (!method()->is_native()) { 330 // Get oopmap describing oops and int for current bci 331 if (TraceDeoptimization && Verbose) { 332 methodHandle m_h(method()); 333 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); 334 } else { 335 method()->mask_for(bci(), &oop_mask); 336 } 337 338 length = oop_mask.expression_stack_size(); <<<<<-------------------------- 1) 339 } 340 341 StackValueCollection* result = new StackValueCollection(length); 342 343 if (0 == length) { 344 return result; 345 } 346 347 int nof_locals = method()->max_locals(); 348 349 // handle expressions 350 for(int i=0; i < length; i++) { <<<<------------------------------------------------------2) 351 // Find stack location 352 intptr_t *addr = fr().interpreter_frame_expression_stack_at(i); <<<<------------------- 2) 353 354 // Depending on oop/int put it in the right package 355 StackValue *sv; 356 if (oop_mask.is_oop(i + nof_locals)) { 357 // oop value 358 Handle h(*(oop *)addr); 359 sv = new StackValue(h); 360 } else { 361 // integer 362 sv = new StackValue(*addr); 363 } 364 assert(sv != NULL, "sanity check"); 365 result->add(sv); 366 } 367 return result; 368 } For 1) and 2), the length may not be consistent, this is from your analysis from JIRA, what if interpreter_frame_expression_stack_size() is different from 'length'? Is there a possibility out of bound here? Thanks Yumin On 4/2/2014 7:29 AM, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following change: > > Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 > > https://bugs.openjdk.java.net/browse/JDK-8038344 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ > > > Problem description: > > An InterpreterOopMap for a particular bci position does not include > expression/operand stack liveness info in the oop_mask/bit_mask if the > bci is a call instruction, i.e. for the invoke* instructions > (invokevirtual, invokespecial, invokestatic, invokedynamic, > invokeinterface). > > This leads to a discrepancy between what is actually on the > expression/operand stack (given via > fr().interpreter_frame_expression_stack_size()) and what is given in > the liveness oop_mask/bit_mask (given via InterpreterOopMap) at a > particular bci. > > The code in interpretedVFrame::expressions() is currently based on > information given from fr().interpreter_frame_expression_stack_size(), > and will index into the retrieved oop_mask/bit_mask based on this > information (expression slot nr + _max_locals). These indexes either: > > 1. Fetches a 0 (since no live info at that position in the mask) if > the index is low enough to still be inside the bit_mask word boundary. > It will then proceed to treat the expression slot (which might be a > real reference) as a T_INT (0 is a value, 1 is a reference) > > 2. Indexes out of bounds for the oop_map/bit_mask (see > https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up > information outside that is not related to a liveness bit mask. If > that position happens to yield a 1, but the real expression slot is a > value ("v"), the system can assert "(obj->is_oop()) failed: not an > oop: 0x00000001" > > Tested by running: > > nsk/jdi/* > > Other info: > > I dislike having to create a new StackValueCollection even though I > know the length is 0 and it will not be actively used. However, this > pattern of always creating and returning empty objects is prevalent in > this piece of code and is not easily detangled. > > Thanks in advance > > Markus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Wed Apr 2 18:41:31 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Wed, 2 Apr 2014 11:41:31 -0700 (PDT) Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness In-Reply-To: <533C49D7.8030104@oracle.com> References: <74f24048-4476-46db-ade9-8c5085b581c9@default> <533C49D7.8030104@oracle.com> Message-ID: <58a70e29-a55b-472f-b66f-6f3bb1ae5625@default> Hi Yumin, ? Thanks for taking a look. ? For 1, ? Thanks for pointing out the default initialization step. I have updated the code to use it. ? For 2, ? >From what I have seen so far, the bci liveness information in the bit_mask for the expression stack is, for all bytecodes (except invoke*), reflecting the current top-of-stack state (tos) *before* the seeked bci is executed. For these, the fr().interpreter_frame_expression_stack_size() should == length. ? For invoke* instructions, the bci liveness information in the bit_mask reflects the current top-of-stack state *after* the seeked bci is executed. Here, fr().interpreter_frame_expression_stack_size() will most likely ?be > length. ? This means indexing into via fr().interpreter_frame_expression_stack_at(i) should be safe ( index variable will index subset or equal to real expression stack len -1) ? I have updated the webrev to check this invariant in an assertion as well. ? Updated webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev02/ ? Thanks Markus ? ? ? From: Yumin Qi Sent: den 2 april 2014 19:33 To: Markus Gr?nlund; serviceability-dev at openjdk.net; hotspot-runtime-dev Subject: Re: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness ? Markus, ? Excellent finding and fix. I have question: 324 StackValueCollection* interpretedVFrame::expressions() const { 325 ?326?? int length = 0; 327?? InterpreterOopMap oop_mask;??? <<<< ------------------ default initialize will set _expression_stack_size to 0. 328 ?329?? if (!method()->is_native()) { 330???? // Get oopmap describing oops and int for current bci 331???? if (TraceDeoptimization && Verbose) { 332?????? methodHandle m_h(method()); 333?????? OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); 334???? } else { 335?????? method()->mask_for(bci(), &oop_mask); 336???? } 337 ?338???? length = oop_mask.expression_stack_size();??????? <<<<<-------------------------- 1) ?339?? } 340 ?341?? StackValueCollection* result = new StackValueCollection(length); 342 ?343?? if (0 == length) { 344???? return result; 345?? } 346 ?347?? int nof_locals = method()->max_locals(); 348 ?349?? // handle expressions 350?? for(int i=0; i < length; i++) {? <<<<------------------------------------------------------2) 351???? // Find stack location 352???? intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);? <<<<------------------- 2) 353 ?354???? // Depending on oop/int put it in the right package 355???? StackValue *sv; 356???? if (oop_mask.is_oop(i + nof_locals)) { 357?????? // oop value 358?????? Handle h(*(oop *)addr); 359?????? sv = new StackValue(h); 360???? } else { 361?????? // integer 362?????? sv = new StackValue(*addr); 363???? } 364???? assert(sv != NULL, "sanity check"); 365???? result->add(sv); 366?? } 367?? return result; 368 } For 1) and 2), the length may not be consistent, this is from your analysis from JIRA, what if?? interpreter_frame_expression_stack_size() is different from 'length'? Is there a possibility out of bound here? ? Thanks Yumin ? ? ? ? On 4/2/2014 7:29 AM, Markus Gr?nlund wrote: Greetings, ? Kindly asking for reviews for the following change: ? Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 https://bugs.openjdk.java.net/browse/JDK-8038344 ? Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Emgronlun/8038624/webrev01/"http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ ? Problem description: ? An InterpreterOopMap for a particular bci position does not include expression/operand stack liveness info in the oop_mask/bit_mask if the bci is a call instruction, i.e. for the invoke* instructions (invokevirtual, invokespecial, invokestatic, invokedynamic, invokeinterface). ? This leads to a discrepancy between what is actually on the expression/operand stack (given via fr().interpreter_frame_expression_stack_size()) and what is given in the liveness oop_mask/bit_mask (given via InterpreterOopMap) at a particular bci. The code in interpretedVFrame::expressions() is currently based on information given from fr().interpreter_frame_expression_stack_size(), and will index into the retrieved oop_mask/bit_mask based on this information (expression slot nr + _max_locals). These indexes either: 1. Fetches a 0 (since no live info at that position in the mask) if the index is low enough to still be inside the bit_mask word boundary. It will then proceed to treat the expression slot (which might be a real reference) as a T_INT (0 is a value, 1 is a reference) 2. Indexes out of bounds for the oop_map/bit_mask (see https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up information outside that is not related to a liveness bit mask. If that position happens to yield a 1, but the real expression slot is a value ("v"), the system can assert "(obj->is_oop()) failed: not an oop: 0x00000001" ? Tested by running: ? nsk/jdi/* ? ? Other info: ? I dislike having to create a new StackValueCollection even though I know the length is 0 and it will not be actively used. However, this pattern of always creating and returning empty objects is prevalent in this piece of code and is not easily detangled. ? ? Thanks in advance Markus ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From yumin.qi at oracle.com Wed Apr 2 19:23:53 2014 From: yumin.qi at oracle.com (Yumin Qi) Date: Wed, 02 Apr 2014 12:23:53 -0700 Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness In-Reply-To: <58a70e29-a55b-472f-b66f-6f3bb1ae5625@default> References: <74f24048-4476-46db-ade9-8c5085b581c9@default> <533C49D7.8030104@oracle.com> <58a70e29-a55b-472f-b66f-6f3bb1ae5625@default> Message-ID: <533C63C9.10601@oracle.com> Looks good to me. (not a reviewer:-) ) Thanks for the explain. Yumin On 4/2/2014 11:41 AM, Markus Gr?nlund wrote: > > Hi Yumin, > > Thanks for taking a look. > > For 1, > > Thanks for pointing out the default initialization step. I have > updated the code to use it. > > For 2, > > From what I have seen so far, the bci liveness information in the > bit_mask for the expression stack is, for all bytecodes (except > invoke*), reflecting the current top-of-stack state (tos) **before** > the seeked bci is executed. For these, the > fr().interpreter_frame_expression_stack_size() should == length. > > For invoke* instructions, the bci liveness information in the bit_mask > reflects the current top-of-stack state *after* the seeked bci is > executed. Here, fr().interpreter_frame_expression_stack_size() will > most likely be > length. > > This means indexing into via > fr().interpreter_frame_expression_stack_at(i) should be safe ( index > variable will index subset or equal to real expression stack len -1) > > I have updated the webrev to check this invariant in an assertion as well. > > Updated webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev02/ > > > Thanks > > Markus > > *From:*Yumin Qi > *Sent:* den 2 april 2014 19:33 > *To:* Markus Gr?nlund; serviceability-dev at openjdk.net; hotspot-runtime-dev > *Subject:* Re: RFR(S): 8038624:interpretedVFrame::expressions() must > respect InterpreterOopMap for liveness > > Markus, > > Excellent finding and fix. I have question: > > > 324 StackValueCollection* interpretedVFrame::expressions() const { > 325 > 326 int length = 0; > 327 InterpreterOopMap oop_mask; <<<< ------------------ default initialize will set _expression_stack_size > to 0. > 328 > 329 if (!method()->is_native()) { > 330 // Get oopmap describing oops and int for current bci > 331 if (TraceDeoptimization && Verbose) { > 332 methodHandle m_h(method()); > 333 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); > 334 } else { > 335 method()->mask_for(bci(), &oop_mask); > 336 } > 337 > 338 length = oop_mask.expression_stack_size(); <<<<<-------------------------- 1) > 339 } > 340 > 341 StackValueCollection* result = new StackValueCollection(length); > 342 > 343 if (0 == length) { > 344 return result; > 345 } > 346 > 347 int nof_locals = method()->max_locals(); > 348 > 349 // handle expressions > 350 for(int i=0; i < length; i++) { <<<<------------------------------------------------------2) > 351 // Find stack location > 352 intptr_t *addr = fr().interpreter_frame_expression_stack_at(i); <<<<------------------- 2) > 353 > 354 // Depending on oop/int put it in the right package > 355 StackValue *sv; > 356 if (oop_mask.is_oop(i + nof_locals)) { > 357 // oop value > 358 Handle h(*(oop *)addr); > 359 sv = new StackValue(h); > 360 } else { > 361 // integer > 362 sv = new StackValue(*addr); > 363 } > 364 assert(sv != NULL, "sanity check"); > 365 result->add(sv); > 366 } > 367 return result; > 368 } > > > For 1) and 2), the length may not be consistent, this is from your > analysis from JIRA, what if > > interpreter_frame_expression_stack_size() is different from 'length'? Is there a possibility out of bound here? > > Thanks > Yumin > > > > > On 4/2/2014 7:29 AM, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following change: > > Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 > > https://bugs.openjdk.java.net/browse/JDK-8038344 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ > > > Problem description: > > An InterpreterOopMap for a particular bci position does not > include expression/operand stack liveness info in the > oop_mask/bit_mask if the bci is a call instruction, i.e. for the > invoke* instructions (invokevirtual, invokespecial, invokestatic, > invokedynamic, invokeinterface). > > This leads to a discrepancy between what is actually on the > expression/operand stack (given via > fr().interpreter_frame_expression_stack_size()) and what is given > in the liveness oop_mask/bit_mask (given via InterpreterOopMap) at > a particular bci. > > The code in interpretedVFrame::expressions() is currently based on > information given from > fr().interpreter_frame_expression_stack_size(), and will index > into the retrieved oop_mask/bit_mask based on this information > (expression slot nr + _max_locals). These indexes either: > > 1. Fetches a 0 (since no live info at that position in the mask) > if the index is low enough to still be inside the bit_mask word > boundary. It will then proceed to treat the expression slot (which > might be a real reference) as a T_INT (0 is a value, 1 is a > reference) > > 2. Indexes out of bounds for the oop_map/bit_mask (see > https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up > information outside that is not related to a liveness bit mask. If > that position happens to yield a 1, but the real expression slot > is a value ("v"), the system can assert "(obj->is_oop()) failed: > not an oop: 0x00000001" > > Tested by running: > > nsk/jdi/* > > Other info: > > I dislike having to create a new StackValueCollection even though > I know the length is 0 and it will not be actively used. However, > this pattern of always creating and returning empty objects is > prevalent in this piece of code and is not easily detangled. > > Thanks in advance > > Markus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Wed Apr 2 20:56:37 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 02 Apr 2014 16:56:37 -0400 Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness In-Reply-To: <74f24048-4476-46db-ade9-8c5085b581c9@default> References: <74f24048-4476-46db-ade9-8c5085b581c9@default> Message-ID: <533C7985.6020606@oracle.com> Markus, This is really disturbing because deoptimization uses this code to layout the interpreter frame (unpack_on_stack). Bugs in deoptimization can be very subtle but we would see some bugs if this was wrong, I think. Is this a recent failure and there was a change in some other area that made this crash? I don't know why interpreter_frame_stack_size wouldn't be the same as oopmap.expression_stack_size() unless it doesn't include the pushed arguments? There's some odd code I've never understood for deoptimization in interpreter/interpreter.cpp. I think you should have someone from the compiler group (added) who understands deoptimization review your change. Coleen On 4/2/14 10:29 AM, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following change: > > Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 > > https://bugs.openjdk.java.net/browse/JDK-8038344 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ > > > Problem description: > > An InterpreterOopMap for a particular bci position does not include > expression/operand stack liveness info in the oop_mask/bit_mask if the > bci is a call instruction, i.e. for the invoke* instructions > (invokevirtual, invokespecial, invokestatic, invokedynamic, > invokeinterface). > > This leads to a discrepancy between what is actually on the > expression/operand stack (given via > fr().interpreter_frame_expression_stack_size()) and what is given in > the liveness oop_mask/bit_mask (given via InterpreterOopMap) at a > particular bci. > > The code in interpretedVFrame::expressions() is currently based on > information given from fr().interpreter_frame_expression_stack_size(), > and will index into the retrieved oop_mask/bit_mask based on this > information (expression slot nr + _max_locals). These indexes either: > > 1. Fetches a 0 (since no live info at that position in the mask) if > the index is low enough to still be inside the bit_mask word boundary. > It will then proceed to treat the expression slot (which might be a > real reference) as a T_INT (0 is a value, 1 is a reference) > > 2. Indexes out of bounds for the oop_map/bit_mask (see > https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up > information outside that is not related to a liveness bit mask. If > that position happens to yield a 1, but the real expression slot is a > value ("v"), the system can assert "(obj->is_oop()) failed: not an > oop: 0x00000001" > > Tested by running: > > nsk/jdi/* > > Other info: > > I dislike having to create a new StackValueCollection even though I > know the length is 0 and it will not be actively used. However, this > pattern of always creating and returning empty objects is prevalent in > this piece of code and is not easily detangled. > > Thanks in advance > > Markus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikhailo.seledtsov at oracle.com Wed Apr 2 23:55:21 2014 From: mikhailo.seledtsov at oracle.com (Mikhailo Seledtsov) Date: Wed, 02 Apr 2014 19:55:21 -0400 Subject: RFR (M): JDK-8038587: [TESTBUG] Create CDS tests to exercise region sizes and classlist In-Reply-To: <533B6D4F.3010509@oracle.com> References: <53347D4C.4070406@oracle.com> <533A52AB.9010401@oracle.com> <533B2A66.3030403@oracle.com> <533B6D4F.3010509@oracle.com> Message-ID: <533CA369.8080601@oracle.com> David, Thank you. I will rework ClassListExerciser test to take your comments into consideration, and will submit a new webrev. Misha On 4/1/2014 9:52 PM, David Holmes wrote: > On 2/04/2014 7:06 AM, Mikhailo Seledtsov wrote: >> Hi David, >> >> Thank you for review and your feedback. >> >> The intent of this test is sanity check of basic functionality, making >> sure the shared classes are loaded w/o crashes or errors. Even though >> creating a shared archive with -Xshare:dump does exercise loading of the >> classes from the classlist, I believe SQE should verify it, by >> explicitly performing this operation. In my experience I have found that >> basic tests often find interesting bugs. >> >> I did drop the attempt to instantiate classes, because the amount of >> classes in the class list that have default constructors and instantiate >> successfully is quite small, and not worth the trouble. Many classes >> fail instantiation due to the absence of UI, or other valid reasons. > > Okay. Dropping that seems to alleviate most of my concerns. > >> What I have found, however, as part of this exercise, is that the >> default SE classlist is optimized for the client, not the server. >> >> As for classes that are part of the classlist, but are really missing >> from rt.jar: will you consider this to be a bug? > > No. The default classlist, as you note is defined for a particular > scenario - at the moment "client" apps. But many of those classes are > not present in Compact Profiles. So unless/until we have customized > default classlists for Compact Profiles, missing classes can be > expected. I don't see this as an issue that warrants such customized > classlists. > > Thanks, > David > >> >> Thank you, >> Misha >> >> >> On 4/1/2014 1:46 AM, David Holmes wrote: >>> Hi Misha, >>> >>> On 28/03/2014 5:34 AM, Mikhailo Seledtsov wrote: >>>> Please review these 3 new CDS tests, an ongoing effort in >>>> implementation >>>> of the CDS test specification. >>>> >>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8038587 >>>> Webrev: http://cr.openjdk.java.net/~mseledtsov/8038587/webrev.00/ >>>> Testing: >>>> Local testing on multiple platforms >>>> JPRT to exercise the added tests: >>>> 2014-03-27-184953.mseledtsov.cds (PASS) >>>> These tests found 2 bugs, and one potential issue >>> >>> I don't quite get the point of the ClassListExerciser test. The >>> classlist may well contain classes that do not exist, or that can not >>> be instantiated in the test context, even if they have a no-arg >>> constructor. Simply creating an archive "exercises" the classlist, so >>> I'm really not sure what this test is intending to test. >>> >>> Also this test won't work with SE Embedded as we have a customized >>> default classlist for the Embedded stack. >>> >>> Thanks, >>> David >>> >>>> Thank you, >>>> Misha >> From staffan.larsen at oracle.com Thu Apr 3 09:31:07 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Thu, 3 Apr 2014 11:31:07 +0200 Subject: RFR: 8038296 sun/tools/jinfo/Basic.sh: java.io.IOException: Command failed in target VM In-Reply-To: <533514F4.8050906@oracle.com> References: <5817E015-E567-4524-B685-8E1AE1E7CF36@oracle.com> <53317A9F.7050400@oracle.com> <5331CCB7.4090206@oracle.com> <6D3336E3-E5A1-45F9-9309-D2C777070342@oracle.com> <533514F4.8050906@oracle.com> Message-ID: <48DC532D-2D99-4106-90CA-5E3289A6256B@oracle.com> Thanks Serguei, I don?t think it is necessary to initialize ?end? since strtol will always set it. I still need an official Reviewer for this change. Thanks, /Staffan On 28 mar 2014, at 07:21, serguei.spitsyn at oracle.com wrote: > On 3/27/14 12:55 AM, Staffan Larsen wrote: >> Here is an updated webrev which incorporates Dmitry?s feedback: >> >> http://cr.openjdk.java.net/~sla/8038296/webrev.01/ > > > It looks good. > The only suggestion is to initialize the 'end': > char* end; > > Not sure what value is better to use for initialization. > Probably, end = probe would work Ok. > > Thanks, > Serguei >> >> Thanks, >> /Staffan >> >> On 25 mar 2014, at 19:36, Dmitry Samersoff wrote: >> >>> Staffan, >>> >>>> Yes, that will find problems when trying to convert something like >>>> ?bla?. It will not capture the case where the input string is a too >>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>> both cases it looks like we need something like: >>>> errno = 0; >>>> char* end; >>>> int probe_typess = (int) strtol(probe, &end, 10); >>>> if (end == probe || errno) { >>>> return JNI_ERR; >>>> } >>> As probe_typess is positive and you are converting long to int >>> It's be better to check value boundaries explicitly: >>> >>> char* end; >>> long ptl = strtol(probe, &end, 10); >>> if (end == probe || ptl < 0 || ptl > MAX_INT) { >>> return JNI_ERR; >>> } >>> >>> int probe_typess = (int) ptl; >>> >>> >>> -Dmitry >>> >>> >>> On 2014-03-25 17:35, Staffan Larsen wrote: >>>> On 25 mar 2014, at 13:46, Dmitry Samersoff >>>> wrote: >>>> >>>>> Staffan, >>>>> >>>>> strtol() sets errno in two cases - >>>>> >>>>> ERANGE if supplied value is less then LONG_MIN or greater than >>>>> LONG_MAX EINVAL if supplied base is not supported. >>>>> >>>>> if you pass probe == 'bla', strtol just return 0 and errno will not >>>>> be set. So I'm not sure that check for errno has any value here. >>>>> >>>>> One of possible way to check that supplied value is convertible to >>>>> long is >>>>> >>>>> char *eptr = probe; strtol(probe, (char **)&eptr, 10); if (eptr == >>>>> probe) { // we can't convert supplied value return JNI_ERR; } >>>> Yes, that will find problems when trying to convert something like >>>> ?bla?. It will not capture the case where the input string is a too >>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>> both cases it looks like we need something like: >>>> >>>> errno = 0; char* end; int probe_typess = (int) strtol(probe, &end, >>>> 10); if (end == probe || errno) { return JNI_ERR; } >>>> >>>> >>>> /Staffan >>>> >>>>> -Dmitry >>>>> >>>>> >>>>> On 2014-03-25 11:31, Staffan Larsen wrote: >>>>>> attachListener_solaris.cpp calls atoi() and then checks errno to >>>>>> see if any errors occurred. The problem is that atoi() does not >>>>>> set errno, so some old value of errno is checked which sometimes >>>>>> causes the function to fail. >>>>>> >>>>>> The fix is to replace atoi() with strtol() which does set errno. >>>>>> But errno is only set if an error occurred and not set to 0 in >>>>>> case of success. Thus, I set errno to 0 before calling strtol() >>>>>> and check the value afterwards. >>>>>> >>>>>> Verified with a JPRT run. >>>>>> >>>>>> webrev: http://cr.openjdk.java.net/~sla/8038296/webrev.00/ bug: >>>>>> https://bugs.openjdk.java.net/browse/JDK-8038296 >>>>>> >>>>>> Thanks, /Staffan >>>>>> >>>>> >>>>> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, >>>>> Russia * I would love to change the world, but they won't give me >>>>> the sources. >>> >>> -- >>> Dmitry Samersoff >>> Oracle Java development team, Saint Petersburg, Russia >>> * I would love to change the world, but they won't give me the sources. > From frederic.parain at oracle.com Thu Apr 3 09:32:57 2014 From: frederic.parain at oracle.com (Frederic Parain) Date: Thu, 03 Apr 2014 11:32:57 +0200 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <533B259B.5080702@oracle.com> References: <53395EB7.1000108@oracle.com> <533A5C54.9010403@oracle.com> <533A8132.8010908@oracle.com> <533B259B.5080702@oracle.com> Message-ID: <533D2AC9.9030506@oracle.com> Hi Dan, Thanks for the review. Fred On 04/01/2014 10:46 PM, Daniel D. Daugherty wrote: > On 4/1/14 3:04 AM, Frederic Parain wrote: >> Hi David, >> >> Thank you for the review, the indentation is now fixed: >> >> http://cr.openjdk.java.net/~fparain/8038473/webrev.01/ > > Thumbs up! > > > src/os/aix/vm/os_aix.cpp > No comments. > > src/os/bsd/vm/os_bsd.cpp > No comments. > > src/os/linux/vm/os_linux.cpp > No comments. > > src/os/solaris/vm/osThread_solaris.cpp > No comments. > > src/os/solaris/vm/osThread_solaris.hpp > No comments. > > src/os/solaris/vm/os_solaris.cpp > No comments. > > src/os/solaris/vm/os_solaris.hpp > No comments. > > src/os/windows/vm/os_windows.cpp > No comments. > > src/os/windows/vm/os_windows.inline.hpp > No comments. > > src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp > No comments. > > src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp > No comments. > > src/share/vm/runtime/arguments.cpp > No comments. > > src/share/vm/runtime/os.hpp > No comments. > > src/share/vm/runtime/safepoint.cpp > No comments. > > src/share/vm/runtime/sharedRuntime.cpp > No comments. > > src/share/vm/runtime/sharedRuntime.hpp > No comments. > > Dan > > >> >> Regards, >> >> Fred >> >> On 04/01/2014 08:27 AM, David Holmes wrote: >>> Hi Fred, >>> >>> This looks okay to me. Great to see so much red :) Probably worth >>> mentioning to other readers that you're going to re-examine the use of >>> yield_all() in the future. >>> >>> Minor nit in os_solaris.cpp: >>> >>> void os::yield_all() { >>> // Yields to all threads, including threads with lower priorities >>> os::sleep(Thread::current(), 1, false); >>> } >>> >>> the indent for sleep needs to be 4 spaces less now. >>> >>> Thanks, >>> David >>> >>> On 31/03/2014 10:25 PM, frederic parain wrote: >>>> Greetings, >>>> >>>> Back in Solaris 8 days, the JVM used a thread library >>>> called T1. In Solaris 9, a new thread library, called T2, >>>> was added to Solaris. The JVM code was extended to be able >>>> to use either the T1 libthread or the T2 libthread. >>>> Since Solaris 10, T2 is the default thread library and the >>>> T1 libthread is not part of Solaris anymore, all its APIs >>>> are wrappers around T2 APIs. This changeset removes the >>>> support for the T1 libthread and the workarounds put in >>>> VM code to deal with some T1 issues. >>>> >>>> Note: the minimal requirement for JDK9 is Solaris 10u9. >>>> >>>> CR: >>>> https://bugs.openjdk.java.net/browse/JDK-8038473 >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ >>>> >>>> Thank you, >>>> >>>> Fred >>>> >> > -- Frederic Parain - Oracle Grenoble Engineering Center - France Phone: +33 4 76 18 81 17 Email: Frederic.Parain at oracle.com From frederic.parain at oracle.com Thu Apr 3 09:33:23 2014 From: frederic.parain at oracle.com (Frederic Parain) Date: Thu, 03 Apr 2014 11:33:23 +0200 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <533AFF6C.8020603@oracle.com> References: <53395EB7.1000108@oracle.com> <533AFF6C.8020603@oracle.com> Message-ID: <533D2AE3.9090407@oracle.com> Coleen, Thanks for the review, Fred On 04/01/2014 08:03 PM, Coleen Phillimore wrote: > > Frederic, > This looks really nice. > Thanks! > Coleen > > On 03/31/2014 08:25 AM, frederic parain wrote: >> Greetings, >> >> Back in Solaris 8 days, the JVM used a thread library >> called T1. In Solaris 9, a new thread library, called T2, >> was added to Solaris. The JVM code was extended to be able >> to use either the T1 libthread or the T2 libthread. >> Since Solaris 10, T2 is the default thread library and the >> T1 libthread is not part of Solaris anymore, all its APIs >> are wrappers around T2 APIs. This changeset removes the >> support for the T1 libthread and the workarounds put in >> VM code to deal with some T1 issues. >> >> Note: the minimal requirement for JDK9 is Solaris 10u9. >> >> CR: >> https://bugs.openjdk.java.net/browse/JDK-8038473 >> >> Webrev: >> http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ >> >> Thank you, >> >> Fred >> > -- Frederic Parain - Oracle Grenoble Engineering Center - France Phone: +33 4 76 18 81 17 Email: Frederic.Parain at oracle.com From frederic.parain at oracle.com Thu Apr 3 09:36:24 2014 From: frederic.parain at oracle.com (Frederic Parain) Date: Thu, 03 Apr 2014 11:36:24 +0200 Subject: RFR: 8038473 Remove support for old T1 libthread In-Reply-To: <314C243A-805C-4926-99BF-E5C1CC13227F@oracle.com> References: <53395EB7.1000108@oracle.com> <314C243A-805C-4926-99BF-E5C1CC13227F@oracle.com> Message-ID: <533D2B98.1010101@oracle.com> Karen, Thanks for the review and your wise advices when I was preparing this changeset. Fred On 04/01/2014 09:02 PM, Karen Kinnear wrote: > Looks good. > Thank you Frederic, for all the careful work. > > thanks, > Karen > > On Mar 31, 2014, at 8:25 AM, frederic parain wrote: > >> Greetings, >> >> Back in Solaris 8 days, the JVM used a thread library >> called T1. In Solaris 9, a new thread library, called T2, >> was added to Solaris. The JVM code was extended to be able >> to use either the T1 libthread or the T2 libthread. >> Since Solaris 10, T2 is the default thread library and the >> T1 libthread is not part of Solaris anymore, all its APIs >> are wrappers around T2 APIs. This changeset removes the >> support for the T1 libthread and the workarounds put in >> VM code to deal with some T1 issues. >> >> Note: the minimal requirement for JDK9 is Solaris 10u9. >> >> CR: >> https://bugs.openjdk.java.net/browse/JDK-8038473 >> >> Webrev: >> http://cr.openjdk.java.net/~fparain/8038473/webrev.00/ >> >> Thank you, >> >> Fred >> >> -- >> Frederic Parain - Oracle >> Grenoble Engineering Center - France >> Phone: +33 4 76 18 81 17 >> Email: Frederic.Parain at oracle.com > -- Frederic Parain - Oracle Grenoble Engineering Center - France Phone: +33 4 76 18 81 17 Email: Frederic.Parain at oracle.com From marcus.larsson at oracle.com Thu Apr 3 13:17:08 2014 From: marcus.larsson at oracle.com (Marcus Larsson) Date: Thu, 03 Apr 2014 15:17:08 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion Message-ID: <533D5F54.4060202@oracle.com> Hello, I would like reviews for the following bugfix removing a redundant memcpy. Built on all platforms and tested with JCK. Webrev: http://cr.openjdk.java.net/~dsimms/6664815/ Bug: https://bugs.openjdk.java.net/browse/JDK-6664815 Regards, Marcus From staffan.larsen at oracle.com Thu Apr 3 13:29:53 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Thu, 3 Apr 2014 15:29:53 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533D5F54.4060202@oracle.com> References: <533D5F54.4060202@oracle.com> Message-ID: <7ABBE238-7C19-404F-856F-C16D3DFE02B5@oracle.com> Looks good to me. Thanks, /Staffan On 3 apr 2014, at 15:17, Marcus Larsson wrote: > Hello, > > I would like reviews for the following bugfix removing a redundant memcpy. > Built on all platforms and tested with JCK. > > Webrev: > http://cr.openjdk.java.net/~dsimms/6664815/ > > Bug: > https://bugs.openjdk.java.net/browse/JDK-6664815 > > Regards, > Marcus From goetz.lindenmaier at sap.com Thu Apr 3 13:33:27 2014 From: goetz.lindenmaier at sap.com (Lindenmaier, Goetz) Date: Thu, 3 Apr 2014 13:33:27 +0000 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top Message-ID: <4295855A5C1DE049A61835A1887419CC2CEAD6E3@DEWDFEMB12A.global.corp.sap> Hi, please review an test this small fix to the interpreters. I please need a sponsor. http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ JNIHandleBlock::_top is an int field. Various places store into this field using a pointer store. On 64-bit platforms this can cause errors. This change adapts the corresponding operations on sparc and both x86 variants to use fixed 32-bit operations. Best regards, Goetz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitry.samersoff at oracle.com Thu Apr 3 13:48:35 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Thu, 03 Apr 2014 17:48:35 +0400 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533D5F54.4060202@oracle.com> References: <533D5F54.4060202@oracle.com> Message-ID: <533D66B3.1@oracle.com> Andrew, Could you take a look at this changes, especially on jni.cpp:3154 ? -Dmitry On 2014-04-03 17:17, Marcus Larsson wrote: > Hello, > > I would like reviews for the following bugfix removing a redundant memcpy. > Built on all platforms and tested with JCK. > > Webrev: > http://cr.openjdk.java.net/~dsimms/6664815/ > > Bug: > https://bugs.openjdk.java.net/browse/JDK-6664815 > > Regards, > Marcus -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From andrew.gross at oracle.com Thu Apr 3 21:35:35 2014 From: andrew.gross at oracle.com (Andrew Gross) Date: Thu, 03 Apr 2014 14:35:35 -0700 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533D66B3.1@oracle.com> References: <533D5F54.4060202@oracle.com> <533D66B3.1@oracle.com> Message-ID: <533DD427.3020701@oracle.com> Hi, I understand your concern. However, this looks like a place where the spec allows callers to cause problems easily rather than one where we are causing the overflow. While not optimal, it does not introduce a vulnerability. Drew On 4/3/2014 6:48 AM, Dmitry Samersoff wrote: > Andrew, > > Could you take a look at this changes, especially on jni.cpp:3154 ? > > -Dmitry > > On 2014-04-03 17:17, Marcus Larsson wrote: >> Hello, >> >> I would like reviews for the following bugfix removing a redundant memcpy. >> Built on all platforms and tested with JCK. >> >> Webrev: >> http://cr.openjdk.java.net/~dsimms/6664815/ >> >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-6664815 >> >> Regards, >> Marcus > From ivan.gerasimov at oracle.com Fri Apr 4 07:30:49 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 04 Apr 2014 11:30:49 +0400 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533D5F54.4060202@oracle.com> References: <533D5F54.4060202@oracle.com> Message-ID: <533E5FA9.2030909@oracle.com> Hi Marcus! While it's not critical and not really connected to the issue you're solving, wouldn't it be better to replace 344 p = utf8_write(p, base[index]); with 344 p = utf8_write(p,*c*); in src/share/vm/utilities/utf8.cpp? Sincerely yours, Ivan On 03.04.2014 17:17, Marcus Larsson wrote: > Hello, > > I would like reviews for the following bugfix removing a redundant > memcpy. > Built on all platforms and tested with JCK. > > Webrev: > http://cr.openjdk.java.net/~dsimms/6664815/ > > Bug: > https://bugs.openjdk.java.net/browse/JDK-6664815 > > Regards, > Marcus > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.larsson at oracle.com Fri Apr 4 10:54:53 2014 From: marcus.larsson at oracle.com (Marcus Larsson) Date: Fri, 04 Apr 2014 12:54:53 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533E5FA9.2030909@oracle.com> References: <533D5F54.4060202@oracle.com> <533E5FA9.2030909@oracle.com> Message-ID: <533E8F7D.3010602@oracle.com> Good point, Updated: http://cr.openjdk.java.net/~dsimms/6664815/ Still looking for one more review for this. Thanks, Marcus On 04/04/2014 09:30 AM, Ivan Gerasimov wrote: > Hi Marcus! > > While it's not critical and not really connected to the issue you're > solving, wouldn't it be better to replace > 344 p = utf8_write(p, base[index]); > with > 344 p = utf8_write(p,*c*); > in src/share/vm/utilities/utf8.cpp? > > Sincerely yours, > Ivan > > > On 03.04.2014 17:17, Marcus Larsson wrote: >> Hello, >> >> I would like reviews for the following bugfix removing a redundant >> memcpy. >> Built on all platforms and tested with JCK. >> >> Webrev: >> http://cr.openjdk.java.net/~dsimms/6664815/ >> >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-6664815 >> >> Regards, >> Marcus >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Fri Apr 4 11:36:13 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 4 Apr 2014 13:36:13 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533E8F7D.3010602@oracle.com> References: <533D5F54.4060202@oracle.com> <533E5FA9.2030909@oracle.com> <533E8F7D.3010602@oracle.com> Message-ID: <18B5C5F1-AA4E-4201-9FA0-D155FF41BB96@oracle.com> Still good! Thanks, /Staffan On 4 apr 2014, at 12:54, Marcus Larsson wrote: > Good point, > > Updated: http://cr.openjdk.java.net/~dsimms/6664815/ > > Still looking for one more review for this. > > Thanks, > Marcus > > On 04/04/2014 09:30 AM, Ivan Gerasimov wrote: >> Hi Marcus! >> >> While it's not critical and not really connected to the issue you're solving, wouldn't it be better to replace >> 344 p = utf8_write(p, base[index]); >> with >> 344 p = utf8_write(p, c); >> in src/share/vm/utilities/utf8.cpp? >> >> Sincerely yours, >> Ivan >> >> >> On 03.04.2014 17:17, Marcus Larsson wrote: >>> Hello, >>> >>> I would like reviews for the following bugfix removing a redundant memcpy. >>> Built on all platforms and tested with JCK. >>> >>> Webrev: >>> http://cr.openjdk.java.net/~dsimms/6664815/ >>> >>> Bug: >>> https://bugs.openjdk.java.net/browse/JDK-6664815 >>> >>> Regards, >>> Marcus >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Fri Apr 4 12:26:37 2014 From: david.holmes at oracle.com (David Holmes) Date: Fri, 04 Apr 2014 22:26:37 +1000 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533E8F7D.3010602@oracle.com> References: <533D5F54.4060202@oracle.com> <533E5FA9.2030909@oracle.com> <533E8F7D.3010602@oracle.com> Message-ID: <533EA4FD.2090202@oracle.com> On 4/04/2014 8:54 PM, Marcus Larsson wrote: > Good point, > > Updated: http://cr.openjdk.java.net/~dsimms/6664815/ > > > Still looking for one more review for this. Looks okay to me. David ----- > Thanks, > Marcus > > On 04/04/2014 09:30 AM, Ivan Gerasimov wrote: >> Hi Marcus! >> >> While it's not critical and not really connected to the issue you're >> solving, wouldn't it be better to replace >> 344 p = utf8_write(p, base[index]); >> with >> 344 p = utf8_write(p,*c*); >> in src/share/vm/utilities/utf8.cpp? >> >> Sincerely yours, >> Ivan >> >> >> On 03.04.2014 17:17, Marcus Larsson wrote: >>> Hello, >>> >>> I would like reviews for the following bugfix removing a redundant >>> memcpy. >>> Built on all platforms and tested with JCK. >>> >>> Webrev: >>> http://cr.openjdk.java.net/~dsimms/6664815/ >>> >>> Bug: >>> https://bugs.openjdk.java.net/browse/JDK-6664815 >>> >>> Regards, >>> Marcus >>> >>> >> > From markus.gronlund at oracle.com Fri Apr 4 15:56:51 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Fri, 4 Apr 2014 08:56:51 -0700 (PDT) Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness In-Reply-To: <533C7985.6020606@oracle.com> References: <74f24048-4476-46db-ade9-8c5085b581c9@default> <533C7985.6020606@oracle.com> Message-ID: <12e437d6-45cf-4b05-80fb-dcf4c509f028@default> Hi Coleen, ? Deoptimization does not use this code for anything critical - deoptimization is based on compiledVFrame::expressions(), not InterpretedVFrame::expressions(). ? After deopting the compiled frame to an interpreter frame, there is an debug section in vframeArrayElement::unpack_on_stack (#ifndef PRODUCT which will call InterpretedVFrame::expressions() if you have set the TraceDeoptimization && Verbose), which is used for outputting debug information only. ? Thanks Markus ? From: Coleen Phillimore Sent: den 2 april 2014 22:57 To: hotspot-runtime-dev at openjdk.java.net; hotspot-compiler-dev at openjdk.java.net Subject: Re: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness ? Markus, This is really disturbing because deoptimization uses this code to layout the interpreter frame (unpack_on_stack).? Bugs in deoptimization can be very subtle but we would see some bugs if this was wrong, I think. Is this a recent failure and there was a change in some other area that made this crash? I don't know why interpreter_frame_stack_size wouldn't be the same as oopmap.expression_stack_size() unless it doesn't include the pushed arguments? There's some odd code I've never understood for deoptimization in interpreter/interpreter.cpp.?? I think you should have someone from the compiler group (added) who understands deoptimization review your change. Coleen On 4/2/14 10:29 AM, Markus Gr?nlund wrote: Greetings, ? Kindly asking for reviews for the following change: ? Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 https://bugs.openjdk.java.net/browse/JDK-8038344 ? Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Emgronlun/8038624/webrev01/"http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ ? Problem description: ? An InterpreterOopMap for a particular bci position does not include expression/operand stack liveness info in the oop_mask/bit_mask if the bci is a call instruction, i.e. for the invoke* instructions (invokevirtual, invokespecial, invokestatic, invokedynamic, invokeinterface). ? This leads to a discrepancy between what is actually on the expression/operand stack (given via fr().interpreter_frame_expression_stack_size()) and what is given in the liveness oop_mask/bit_mask (given via InterpreterOopMap) at a particular bci. The code in interpretedVFrame::expressions() is currently based on information given from fr().interpreter_frame_expression_stack_size(), and will index into the retrieved oop_mask/bit_mask based on this information (expression slot nr + _max_locals). These indexes either: 1. Fetches a 0 (since no live info at that position in the mask) if the index is low enough to still be inside the bit_mask word boundary. It will then proceed to treat the expression slot (which might be a real reference) as a T_INT (0 is a value, 1 is a reference) 2. Indexes out of bounds for the oop_map/bit_mask (see https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up information outside that is not related to a liveness bit mask. If that position happens to yield a 1, but the real expression slot is a value ("v"), the system can assert "(obj->is_oop()) failed: not an oop: 0x00000001" ? Tested by running: ? nsk/jdi/* ? ? Other info: ? I dislike having to create a new StackValueCollection even though I know the length is 0 and it will not be actively used. However, this pattern of always creating and returning empty objects is prevalent in this piece of code and is not easily detangled. ? ? Thanks in advance Markus ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Fri Apr 4 16:02:26 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 04 Apr 2014 12:02:26 -0400 Subject: RFR(S): 8038624:interpretedVFrame::expressions() must respect InterpreterOopMap for liveness In-Reply-To: <12e437d6-45cf-4b05-80fb-dcf4c509f028@default> References: <74f24048-4476-46db-ade9-8c5085b581c9@default> <533C7985.6020606@oracle.com> <12e437d6-45cf-4b05-80fb-dcf4c509f028@default> Message-ID: <533ED792.5030805@oracle.com> Hi Markus, I double checked this myself and I agree with you. Your fix to this code looks really good. Before you check this in, can you add a short comment before line 338 why this doesn't equal fr().interpreter_frame_expression_stack_size(); in case someone wanders into this complicated code again? The comment below in your RFR is fine (I don't need to read it again). Thanks! Coleen On 4/4/14 11:56 AM, Markus Gr?nlund wrote: > > Hi Coleen, > > Deoptimization does not use this code for anything critical -- > deoptimization is based on compiledVFrame::expressions(), not > InterpretedVFrame::expressions(). > > After deopting the compiled frame to an interpreter frame, there is an > debug section in vframeArrayElement::unpack_on_stack (#ifndef PRODUCT > which will call InterpretedVFrame::expressions() if you have set the > TraceDeoptimization && Verbose), which is used for outputting debug > information only. > > Thanks > > Markus > > *From:*Coleen Phillimore > *Sent:* den 2 april 2014 22:57 > *To:* hotspot-runtime-dev at openjdk.java.net; > hotspot-compiler-dev at openjdk.java.net > *Subject:* Re: RFR(S): 8038624:interpretedVFrame::expressions() must > respect InterpreterOopMap for liveness > > > Markus, > > This is really disturbing because deoptimization uses this code to > layout the interpreter frame (unpack_on_stack). Bugs in > deoptimization can be very subtle but we would see some bugs if this > was wrong, I think. > Is this a recent failure and there was a change in some other area > that made this crash? > I don't know why interpreter_frame_stack_size wouldn't be the same as > oopmap.expression_stack_size() unless it doesn't include the pushed > arguments? > > There's some odd code I've never understood for deoptimization in > interpreter/interpreter.cpp. I think you should have someone from > the compiler group (added) who understands deoptimization review your > change. > > Coleen > > On 4/2/14 10:29 AM, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following change: > > Bug(s): http://bugs.openjdk.java.net/browse/JDK-8038624 > > https://bugs.openjdk.java.net/browse/JDK-8038344 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8038624/webrev01/ > > > Problem description: > > An InterpreterOopMap for a particular bci position does not > include expression/operand stack liveness info in the > oop_mask/bit_mask if the bci is a call instruction, i.e. for the > invoke* instructions (invokevirtual, invokespecial, invokestatic, > invokedynamic, invokeinterface). > > This leads to a discrepancy between what is actually on the > expression/operand stack (given via > fr().interpreter_frame_expression_stack_size()) and what is given > in the liveness oop_mask/bit_mask (given via InterpreterOopMap) at > a particular bci. > > The code in interpretedVFrame::expressions() is currently based on > information given from > fr().interpreter_frame_expression_stack_size(), and will index > into the retrieved oop_mask/bit_mask based on this information > (expression slot nr + _max_locals). These indexes either: > > 1. Fetches a 0 (since no live info at that position in the mask) > if the index is low enough to still be inside the bit_mask word > boundary. It will then proceed to treat the expression slot (which > might be a real reference) as a T_INT (0 is a value, 1 is a > reference) > > 2. Indexes out of bounds for the oop_map/bit_mask (see > https://bugs.openjdk.java.net/browse/JDK-8038344 ), and picks up > information outside that is not related to a liveness bit mask. If > that position happens to yield a 1, but the real expression slot > is a value ("v"), the system can assert "(obj->is_oop()) failed: > not an oop: 0x00000001" > > Tested by running: > > nsk/jdi/* > > Other info: > > I dislike having to create a new StackValueCollection even though > I know the length is 0 and it will not be actively used. However, > this pattern of always creating and returning empty objects is > prevalent in this piece of code and is not easily detangled. > > Thanks in advance > > Markus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Sun Apr 6 17:05:53 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Sun, 6 Apr 2014 10:05:53 -0700 (PDT) Subject: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM Message-ID: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> Greetings, ? Kindly asking for reviews for this small fix: ? Bug: https://bugs.openjdk.java.net/browse/JDK-8039348 Webrev: http://cr.openjdk.java.net/~mgronlun/8039348/webrev01/ ? Found when debugging: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp ? Using -Xcomp can cause an uncommon trap in java/lang/String constructors before the [C value field has been assigned. ? Thanks Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Sun Apr 6 18:24:24 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Sun, 6 Apr 2014 20:24:24 +0200 Subject: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM In-Reply-To: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> References: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> Message-ID: <3E384F09-F461-411C-A67A-E53B352169F7@oracle.com> You have changed the output when the ?value? field is not set from NULL to ??. Was this intentional? /Staffan On 6 apr 2014, at 19:05, Markus Gr?nlund wrote: > Greetings, > > Kindly asking for reviews for this small fix: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8039348 > Webrev: http://cr.openjdk.java.net/~mgronlun/8039348/webrev01/ > > Found when debugging: > -XX:+TraceDeoptimization -XX:+Verbose ?Xcomp > > Using ?Xcomp can cause an uncommon trap in java/lang/String constructors before the [C value field has been assigned. > > Thanks > Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Sun Apr 6 18:51:16 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Sun, 6 Apr 2014 11:51:16 -0700 (PDT) Subject: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM In-Reply-To: <3E384F09-F461-411C-A67A-E53B352169F7@oracle.com> References: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> <3E384F09-F461-411C-A67A-E53B352169F7@oracle.com> Message-ID: Yes. The java/lang/String object is not NULL but it's [C field is. ? In the local/expression slots output, there is an object there, it's not NULL, it's being created. ? /Markus ? From: Staffan Larsen Sent: den 6 april 2014 20:24 To: Markus Gr?nlund Cc: serviceability-dev at openjdk.net; hotspot-runtime-dev at openjdk.java.net Subject: Re: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM ? You have changed the output when the 'value' field is not set from NULL to "". Was this intentional? ? /Staffan ? On 6 apr 2014, at 19:05, Markus Gr?nlund wrote: Greetings, ? Kindly asking for reviews for this small fix: ? Bug:?https://bugs.openjdk.java.net/browse/JDK-8039348 Webrev:?http://cr.openjdk.java.net/~mgronlun/8039348/webrev01/ ? Found when debugging: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp ? Using -Xcomp can cause an uncommon trap in java/lang/String constructors before the [C value field has been assigned. ? Thanks Markus ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Sun Apr 6 19:07:55 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Sun, 6 Apr 2014 12:07:55 -0700 (PDT) Subject: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM In-Reply-To: References: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> <3E384F09-F461-411C-A67A-E53B352169F7@oracle.com> Message-ID: Actually, now reflecting a bit more on it, since this uncommon trap happens while executing the constructor itself, one could argue that the object instance is not yet created. ? In addition, the "normal" representation of the java/lang/String ?object in print() is the value of the [C array - so in that case it might very well be that "NULL" is? the value to output, since there is no [C. ? I can keep "NULL" as is. ? /Markus ? ? ? From: Markus Gr?nlund Sent: den 6 april 2014 20:51 To: Staffan Larsen Cc: serviceability-dev at openjdk.net; hotspot-runtime-dev at openjdk.java.net Subject: RE: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM ? Yes. The java/lang/String object is not NULL but it's [C field is. ? In the local/expression slots output, there is an object there, it's not NULL, it's being created. ? /Markus ? From: Staffan Larsen Sent: den 6 april 2014 20:24 To: Markus Gr?nlund Cc: HYPERLINK "mailto:serviceability-dev at openjdk.net"serviceability-dev at openjdk.net; HYPERLINK "mailto:hotspot-runtime-dev at openjdk.java.net"hotspot-runtime-dev at openjdk.java.net Subject: Re: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM ? You have changed the output when the 'value' field is not set from NULL to "". Was this intentional? ? /Staffan ? On 6 apr 2014, at 19:05, Markus Gr?nlund wrote: ? Greetings, ? Kindly asking for reviews for this small fix: ? Bug:?https://bugs.openjdk.java.net/browse/JDK-8039348 Webrev:?http://cr.openjdk.java.net/~mgronlun/8039348/webrev01/ ? Found when debugging: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp ? Using -Xcomp can cause an uncommon trap in java/lang/String constructors before the [C value field has been assigned. ? Thanks Markus ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Mon Apr 7 06:31:08 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Mon, 7 Apr 2014 08:31:08 +0200 Subject: RFR: 8038296 sun/tools/jinfo/Basic.sh: java.io.IOException: Command failed in target VM In-Reply-To: <48DC532D-2D99-4106-90CA-5E3289A6256B@oracle.com> References: <5817E015-E567-4524-B685-8E1AE1E7CF36@oracle.com> <53317A9F.7050400@oracle.com> <5331CCB7.4090206@oracle.com> <6D3336E3-E5A1-45F9-9309-D2C777070342@oracle.com> <533514F4.8050906@oracle.com> <48DC532D-2D99-4106-90CA-5E3289A6256B@oracle.com> Message-ID: <4B0BFA9A-4970-4BDB-A2A0-BF6057EB7298@oracle.com> Could I have an official Review of this change? Thanks, /Staffan On 3 apr 2014, at 11:31, Staffan Larsen wrote: > Thanks Serguei, > > I don?t think it is necessary to initialize ?end? since strtol will always set it. > > I still need an official Reviewer for this change. > > Thanks, > /Staffan > > On 28 mar 2014, at 07:21, serguei.spitsyn at oracle.com wrote: > >> On 3/27/14 12:55 AM, Staffan Larsen wrote: >>> Here is an updated webrev which incorporates Dmitry?s feedback: >>> >>> http://cr.openjdk.java.net/~sla/8038296/webrev.01/ >> >> >> It looks good. >> The only suggestion is to initialize the 'end': >> char* end; >> >> Not sure what value is better to use for initialization. >> Probably, end = probe would work Ok. >> >> Thanks, >> Serguei >>> >>> Thanks, >>> /Staffan >>> >>> On 25 mar 2014, at 19:36, Dmitry Samersoff wrote: >>> >>>> Staffan, >>>> >>>>> Yes, that will find problems when trying to convert something like >>>>> ?bla?. It will not capture the case where the input string is a too >>>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>>> both cases it looks like we need something like: >>>>> errno = 0; >>>>> char* end; >>>>> int probe_typess = (int) strtol(probe, &end, 10); >>>>> if (end == probe || errno) { >>>>> return JNI_ERR; >>>>> } >>>> As probe_typess is positive and you are converting long to int >>>> It's be better to check value boundaries explicitly: >>>> >>>> char* end; >>>> long ptl = strtol(probe, &end, 10); >>>> if (end == probe || ptl < 0 || ptl > MAX_INT) { >>>> return JNI_ERR; >>>> } >>>> >>>> int probe_typess = (int) ptl; >>>> >>>> >>>> -Dmitry >>>> >>>> >>>> On 2014-03-25 17:35, Staffan Larsen wrote: >>>>> On 25 mar 2014, at 13:46, Dmitry Samersoff >>>>> wrote: >>>>> >>>>>> Staffan, >>>>>> >>>>>> strtol() sets errno in two cases - >>>>>> >>>>>> ERANGE if supplied value is less then LONG_MIN or greater than >>>>>> LONG_MAX EINVAL if supplied base is not supported. >>>>>> >>>>>> if you pass probe == 'bla', strtol just return 0 and errno will not >>>>>> be set. So I'm not sure that check for errno has any value here. >>>>>> >>>>>> One of possible way to check that supplied value is convertible to >>>>>> long is >>>>>> >>>>>> char *eptr = probe; strtol(probe, (char **)&eptr, 10); if (eptr == >>>>>> probe) { // we can't convert supplied value return JNI_ERR; } >>>>> Yes, that will find problems when trying to convert something like >>>>> ?bla?. It will not capture the case where the input string is a too >>>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>>> both cases it looks like we need something like: >>>>> >>>>> errno = 0; char* end; int probe_typess = (int) strtol(probe, &end, >>>>> 10); if (end == probe || errno) { return JNI_ERR; } >>>>> >>>>> >>>>> /Staffan >>>>> >>>>>> -Dmitry >>>>>> >>>>>> >>>>>> On 2014-03-25 11:31, Staffan Larsen wrote: >>>>>>> attachListener_solaris.cpp calls atoi() and then checks errno to >>>>>>> see if any errors occurred. The problem is that atoi() does not >>>>>>> set errno, so some old value of errno is checked which sometimes >>>>>>> causes the function to fail. >>>>>>> >>>>>>> The fix is to replace atoi() with strtol() which does set errno. >>>>>>> But errno is only set if an error occurred and not set to 0 in >>>>>>> case of success. Thus, I set errno to 0 before calling strtol() >>>>>>> and check the value afterwards. >>>>>>> >>>>>>> Verified with a JPRT run. >>>>>>> >>>>>>> webrev: http://cr.openjdk.java.net/~sla/8038296/webrev.00/ bug: >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8038296 >>>>>>> >>>>>>> Thanks, /Staffan >>>>>>> >>>>>> >>>>>> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, >>>>>> Russia * I would love to change the world, but they won't give me >>>>>> the sources. >>>> >>>> -- >>>> Dmitry Samersoff >>>> Oracle Java development team, Saint Petersburg, Russia >>>> * I would love to change the world, but they won't give me the sources. >> > From serguei.spitsyn at oracle.com Mon Apr 7 07:05:57 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Mon, 07 Apr 2014 00:05:57 -0700 Subject: RFR: 8038296 sun/tools/jinfo/Basic.sh: java.io.IOException: Command failed in target VM In-Reply-To: <48DC532D-2D99-4106-90CA-5E3289A6256B@oracle.com> References: <5817E015-E567-4524-B685-8E1AE1E7CF36@oracle.com> <53317A9F.7050400@oracle.com> <5331CCB7.4090206@oracle.com> <6D3336E3-E5A1-45F9-9309-D2C777070342@oracle.com> <533514F4.8050906@oracle.com> <48DC532D-2D99-4106-90CA-5E3289A6256B@oracle.com> Message-ID: <53424E55.1020907@oracle.com> On 4/3/14 2:31 AM, Staffan Larsen wrote: > Thanks Serguei, > > I don?t think it is necessary to initialize ?end? since strtol will always set it. Ok. > > I still need an official Reviewer for this change. I'm not an official reviewer yet. Thanks, Serguei > > Thanks, > /Staffan > > On 28 mar 2014, at 07:21, serguei.spitsyn at oracle.com wrote: > >> On 3/27/14 12:55 AM, Staffan Larsen wrote: >>> Here is an updated webrev which incorporates Dmitry?s feedback: >>> >>> http://cr.openjdk.java.net/~sla/8038296/webrev.01/ >> >> It looks good. >> The only suggestion is to initialize the 'end': >> char* end; >> >> Not sure what value is better to use for initialization. >> Probably, end = probe would work Ok. >> >> Thanks, >> Serguei >>> Thanks, >>> /Staffan >>> >>> On 25 mar 2014, at 19:36, Dmitry Samersoff wrote: >>> >>>> Staffan, >>>> >>>>> Yes, that will find problems when trying to convert something like >>>>> ?bla?. It will not capture the case where the input string is a too >>>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>>> both cases it looks like we need something like: >>>>> errno = 0; >>>>> char* end; >>>>> int probe_typess = (int) strtol(probe, &end, 10); >>>>> if (end == probe || errno) { >>>>> return JNI_ERR; >>>>> } >>>> As probe_typess is positive and you are converting long to int >>>> It's be better to check value boundaries explicitly: >>>> >>>> char* end; >>>> long ptl = strtol(probe, &end, 10); >>>> if (end == probe || ptl < 0 || ptl > MAX_INT) { >>>> return JNI_ERR; >>>> } >>>> >>>> int probe_typess = (int) ptl; >>>> >>>> >>>> -Dmitry >>>> >>>> >>>> On 2014-03-25 17:35, Staffan Larsen wrote: >>>>> On 25 mar 2014, at 13:46, Dmitry Samersoff >>>>> wrote: >>>>> >>>>>> Staffan, >>>>>> >>>>>> strtol() sets errno in two cases - >>>>>> >>>>>> ERANGE if supplied value is less then LONG_MIN or greater than >>>>>> LONG_MAX EINVAL if supplied base is not supported. >>>>>> >>>>>> if you pass probe == 'bla', strtol just return 0 and errno will not >>>>>> be set. So I'm not sure that check for errno has any value here. >>>>>> >>>>>> One of possible way to check that supplied value is convertible to >>>>>> long is >>>>>> >>>>>> char *eptr = probe; strtol(probe, (char **)&eptr, 10); if (eptr == >>>>>> probe) { // we can't convert supplied value return JNI_ERR; } >>>>> Yes, that will find problems when trying to convert something like >>>>> ?bla?. It will not capture the case where the input string is a too >>>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>>> both cases it looks like we need something like: >>>>> >>>>> errno = 0; char* end; int probe_typess = (int) strtol(probe, &end, >>>>> 10); if (end == probe || errno) { return JNI_ERR; } >>>>> >>>>> >>>>> /Staffan >>>>> >>>>>> -Dmitry >>>>>> >>>>>> >>>>>> On 2014-03-25 11:31, Staffan Larsen wrote: >>>>>>> attachListener_solaris.cpp calls atoi() and then checks errno to >>>>>>> see if any errors occurred. The problem is that atoi() does not >>>>>>> set errno, so some old value of errno is checked which sometimes >>>>>>> causes the function to fail. >>>>>>> >>>>>>> The fix is to replace atoi() with strtol() which does set errno. >>>>>>> But errno is only set if an error occurred and not set to 0 in >>>>>>> case of success. Thus, I set errno to 0 before calling strtol() >>>>>>> and check the value afterwards. >>>>>>> >>>>>>> Verified with a JPRT run. >>>>>>> >>>>>>> webrev: http://cr.openjdk.java.net/~sla/8038296/webrev.00/ bug: >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8038296 >>>>>>> >>>>>>> Thanks, /Staffan >>>>>>> >>>>>> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, >>>>>> Russia * I would love to change the world, but they won't give me >>>>>> the sources. >>>> -- >>>> Dmitry Samersoff >>>> Oracle Java development team, Saint Petersburg, Russia >>>> * I would love to change the world, but they won't give me the sources. From goetz.lindenmaier at sap.com Mon Apr 7 10:07:41 2014 From: goetz.lindenmaier at sap.com (Lindenmaier, Goetz) Date: Mon, 7 Apr 2014 10:07:41 +0000 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top Message-ID: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> Hi, could I please get a review of this change? It fixes a rather obvious error, and is really simple. Is runtime the wrong mainling list for interpreter changes? Should I post to comp? Best regards, Goetz. From: Lindenmaier, Goetz Sent: Donnerstag, 3. April 2014 15:33 To: hotspot-runtime-dev at openjdk.java.net Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top Hi, please review an test this small fix to the interpreters. I please need a sponsor. http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ JNIHandleBlock::_top is an int field. Various places store into this field using a pointer store. On 64-bit platforms this can cause errors. This change adapts the corresponding operations on sparc and both x86 variants to use fixed 32-bit operations. Best regards, Goetz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Mon Apr 7 17:33:02 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Mon, 07 Apr 2014 13:33:02 -0400 Subject: RFR: 8038296 sun/tools/jinfo/Basic.sh: java.io.IOException: Command failed in target VM In-Reply-To: <53424E55.1020907@oracle.com> References: <5817E015-E567-4524-B685-8E1AE1E7CF36@oracle.com> <53317A9F.7050400@oracle.com> <5331CCB7.4090206@oracle.com> <6D3336E3-E5A1-45F9-9309-D2C777070342@oracle.com> <533514F4.8050906@oracle.com> <48DC532D-2D99-4106-90CA-5E3289A6256B@oracle.com> <53424E55.1020907@oracle.com> Message-ID: <5342E14E.4020801@oracle.com> Looks good. Coleen On 4/7/14, 3:05 AM, serguei.spitsyn at oracle.com wrote: > On 4/3/14 2:31 AM, Staffan Larsen wrote: >> Thanks Serguei, >> >> I don?t think it is necessary to initialize ?end? since strtol will >> always set it. > > Ok. > >> >> I still need an official Reviewer for this change. > > I'm not an official reviewer yet. > > > Thanks, > Serguei > >> >> Thanks, >> /Staffan >> >> On 28 mar 2014, at 07:21, serguei.spitsyn at oracle.com wrote: >> >>> On 3/27/14 12:55 AM, Staffan Larsen wrote: >>>> Here is an updated webrev which incorporates Dmitry?s feedback: >>>> >>>> http://cr.openjdk.java.net/~sla/8038296/webrev.01/ >>> >>> It looks good. >>> The only suggestion is to initialize the 'end': >>> char* end; >>> >>> Not sure what value is better to use for initialization. >>> Probably, end = probe would work Ok. >>> >>> Thanks, >>> Serguei >>>> Thanks, >>>> /Staffan >>>> >>>> On 25 mar 2014, at 19:36, Dmitry Samersoff >>>> wrote: >>>> >>>>> Staffan, >>>>> >>>>>> Yes, that will find problems when trying to convert something like >>>>>> ?bla?. It will not capture the case where the input string is a too >>>>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>>>> both cases it looks like we need something like: >>>>>> errno = 0; >>>>>> char* end; >>>>>> int probe_typess = (int) strtol(probe, &end, 10); >>>>>> if (end == probe || errno) { >>>>>> return JNI_ERR; >>>>>> } >>>>> As probe_typess is positive and you are converting long to int >>>>> It's be better to check value boundaries explicitly: >>>>> >>>>> char* end; >>>>> long ptl = strtol(probe, &end, 10); >>>>> if (end == probe || ptl < 0 || ptl > MAX_INT) { >>>>> return JNI_ERR; >>>>> } >>>>> >>>>> int probe_typess = (int) ptl; >>>>> >>>>> >>>>> -Dmitry >>>>> >>>>> >>>>> On 2014-03-25 17:35, Staffan Larsen wrote: >>>>>> On 25 mar 2014, at 13:46, Dmitry Samersoff >>>>>> wrote: >>>>>> >>>>>>> Staffan, >>>>>>> >>>>>>> strtol() sets errno in two cases - >>>>>>> >>>>>>> ERANGE if supplied value is less then LONG_MIN or greater than >>>>>>> LONG_MAX EINVAL if supplied base is not supported. >>>>>>> >>>>>>> if you pass probe == 'bla', strtol just return 0 and errno will not >>>>>>> be set. So I'm not sure that check for errno has any value here. >>>>>>> >>>>>>> One of possible way to check that supplied value is convertible to >>>>>>> long is >>>>>>> >>>>>>> char *eptr = probe; strtol(probe, (char **)&eptr, 10); if (eptr == >>>>>>> probe) { // we can't convert supplied value return JNI_ERR; } >>>>>> Yes, that will find problems when trying to convert something like >>>>>> ?bla?. It will not capture the case where the input string is a too >>>>>> large (or small) value (value < LONG_MIN or > LONG_MAX). To capture >>>>>> both cases it looks like we need something like: >>>>>> >>>>>> errno = 0; char* end; int probe_typess = (int) strtol(probe, &end, >>>>>> 10); if (end == probe || errno) { return JNI_ERR; } >>>>>> >>>>>> >>>>>> /Staffan >>>>>> >>>>>>> -Dmitry >>>>>>> >>>>>>> >>>>>>> On 2014-03-25 11:31, Staffan Larsen wrote: >>>>>>>> attachListener_solaris.cpp calls atoi() and then checks errno to >>>>>>>> see if any errors occurred. The problem is that atoi() does not >>>>>>>> set errno, so some old value of errno is checked which sometimes >>>>>>>> causes the function to fail. >>>>>>>> >>>>>>>> The fix is to replace atoi() with strtol() which does set errno. >>>>>>>> But errno is only set if an error occurred and not set to 0 in >>>>>>>> case of success. Thus, I set errno to 0 before calling strtol() >>>>>>>> and check the value afterwards. >>>>>>>> >>>>>>>> Verified with a JPRT run. >>>>>>>> >>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8038296/webrev.00/ bug: >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8038296 >>>>>>>> >>>>>>>> Thanks, /Staffan >>>>>>>> >>>>>>> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, >>>>>>> Russia * I would love to change the world, but they won't give me >>>>>>> the sources. >>>>> -- >>>>> Dmitry Samersoff >>>>> Oracle Java development team, Saint Petersburg, Russia >>>>> * I would love to change the world, but they won't give me the >>>>> sources. > From coleen.phillimore at oracle.com Mon Apr 7 17:41:05 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Mon, 07 Apr 2014 13:41:05 -0400 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top In-Reply-To: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> References: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> Message-ID: <5342E331.7090108@oracle.com> The change looks fine. I can sponsor it unless someone else would like to. Thanks, Coleen On 4/7/14, 6:07 AM, Lindenmaier, Goetz wrote: > > Hi, > > could I please get a review of this change? It fixes a rather > > obvious error, and is really simple. > > Is runtime the wrong mainling list for interpreter changes? Should I > > post to comp? > > Best regards, > > Goetz. > > *From:*Lindenmaier, Goetz > *Sent:* Donnerstag, 3. April 2014 15:33 > *To:* hotspot-runtime-dev at openjdk.java.net > *Subject:* RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top > > Hi, > > please review an test this small fix to the interpreters. I please need > > a sponsor. > > http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ > > > JNIHandleBlock::_top is an int field. Various places store into > > this field using a pointer store. On 64-bit platforms > > this can cause errors. > > This change adapts the corresponding operations on sparc > > and both x86 variants to use fixed 32-bit operations. > > Best regards, > > Goetz. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladimir.kozlov at oracle.com Mon Apr 7 17:55:57 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Mon, 07 Apr 2014 10:55:57 -0700 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top In-Reply-To: <5342E331.7090108@oracle.com> References: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> <5342E331.7090108@oracle.com> Message-ID: <5342E6AD.80402@oracle.com> Fix is good but it requires closed changes which we need to prepare before the push. Thanks, Vladimir On 4/7/14 10:41 AM, Coleen Phillimore wrote: > > The change looks fine. I can sponsor it unless someone else would like to. > Thanks, > Coleen > > On 4/7/14, 6:07 AM, Lindenmaier, Goetz wrote: >> >> Hi, >> >> could I please get a review of this change? It fixes a rather >> >> obvious error, and is really simple. >> >> Is runtime the wrong mainling list for interpreter changes? Should I >> >> post to comp? >> >> Best regards, >> >> Goetz. >> >> *From:*Lindenmaier, Goetz >> *Sent:* Donnerstag, 3. April 2014 15:33 >> *To:* hotspot-runtime-dev at openjdk.java.net >> *Subject:* RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top >> >> Hi, >> >> please review an test this small fix to the interpreters. I please need >> >> a sponsor. >> >> http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ >> >> >> JNIHandleBlock::_top is an int field. Various places store into >> >> this field using a pointer store. On 64-bit platforms >> >> this can cause errors. >> >> This change adapts the corresponding operations on sparc >> >> and both x86 variants to use fixed 32-bit operations. >> >> Best regards, >> >> Goetz. >> > From staffan.larsen at oracle.com Mon Apr 7 18:08:34 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Mon, 7 Apr 2014 20:08:34 +0200 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms Message-ID: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> The problem here is that the code for finding local VMs is not looking for the data in the correct place. When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. Thanks, /Staffan From markus.gronlund at oracle.com Mon Apr 7 18:24:23 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Mon, 7 Apr 2014 11:24:23 -0700 (PDT) Subject: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM In-Reply-To: References: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> <3E384F09-F461-411C-A67A-E53B352169F7@oracle.com> Message-ID: <0587b71c-04a4-4471-a67a-bd7ebfad0866@default> Hi again, ? Updated the webrev to give a bit more descriptive message for debugging purposes: ? Webrev02: http://cr.openjdk.java.net/~mgronlun/8039348/webrev02/ ? Thanks again Markus ? ? From: Markus Gr?nlund Sent: den 6 april 2014 21:08 To: Staffan Larsen Cc: serviceability-dev at openjdk.net; hotspot-runtime-dev at openjdk.java.net Subject: RE: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM ? Actually, now reflecting a bit more on it, since this uncommon trap happens while executing the constructor itself, one could argue that the object instance is not yet created. ? In addition, the "normal" representation of the java/lang/String ?object in print() is the value of the [C array - so in that case it might very well be that "NULL" is? the value to output, since there is no [C. ? I can keep "NULL" as is. ? /Markus ? ? ? From: Markus Gr?nlund Sent: den 6 april 2014 20:51 To: Staffan Larsen Cc: HYPERLINK "mailto:serviceability-dev at openjdk.net"serviceability-dev at openjdk.net; HYPERLINK "mailto:hotspot-runtime-dev at openjdk.java.net"hotspot-runtime-dev at openjdk.java.net Subject: RE: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM ? Yes. The java/lang/String object is not NULL but it's [C field is. ? In the local/expression slots output, there is an object there, it's not NULL, it's being created. ? /Markus ? From: Staffan Larsen Sent: den 6 april 2014 20:24 To: Markus Gr?nlund Cc: HYPERLINK "mailto:serviceability-dev at openjdk.net"serviceability-dev at openjdk.net; HYPERLINK "mailto:hotspot-runtime-dev at openjdk.java.net"hotspot-runtime-dev at openjdk.java.net Subject: Re: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM ? You have changed the output when the 'value' field is not set from NULL to "". Was this intentional? ? /Staffan ? On 6 apr 2014, at 19:05, Markus Gr?nlund wrote: ? Greetings, ? Kindly asking for reviews for this small fix: ? Bug:?https://bugs.openjdk.java.net/browse/JDK-8039348 Webrev:?http://cr.openjdk.java.net/~mgronlun/8039348/webrev01/ ? Found when debugging: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp ? Using -Xcomp can cause an uncommon trap in java/lang/String constructors before the [C value field has been assigned. ? Thanks Markus ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Mon Apr 7 19:19:03 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Mon, 7 Apr 2014 21:19:03 +0200 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> Message-ID: <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> And the links: bug: https://bugs.openjdk.java.net/browse/JDK-8033104 webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ Sorry about that, /Staffan On 7 apr 2014, at 20:08, Staffan Larsen wrote: > > The problem here is that the code for finding local VMs is not looking for the data in the correct place. > > When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. > > (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. > > The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. > > (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). > > The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. > > Thanks, > /Staffan From vladimir.kozlov at oracle.com Mon Apr 7 19:32:45 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Mon, 07 Apr 2014 12:32:45 -0700 Subject: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM In-Reply-To: <0587b71c-04a4-4471-a67a-bd7ebfad0866@default> References: <3939f4d1-150e-408e-b2b5-7ae96b7387d7@default> <3E384F09-F461-411C-A67A-E53B352169F7@oracle.com> <0587b71c-04a4-4471-a67a-bd7ebfad0866@default> Message-ID: <5342FD5D.8050106@oracle.com> Hi, Markus Thank you for fixing this. Please, keep "NULL" output as it was before. Otherwise it is good. Thanks, Vladimir On 4/7/14 11:24 AM, Markus Gr?nlund wrote: > Hi again, > > Updated the webrev to give a bit more descriptive message for debugging > purposes: > > Webrev02: http://cr.openjdk.java.net/~mgronlun/8039348/webrev02/ > > Thanks again > > Markus > > *From:*Markus Gr?nlund > *Sent:* den 6 april 2014 21:08 > *To:* Staffan Larsen > *Cc:* serviceability-dev at openjdk.net; hotspot-runtime-dev at openjdk.java.net > *Subject:* RE: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose > -Xcomp can crash VM > > Actually, now reflecting a bit more on it, since this uncommon trap > happens while executing the constructor itself, one could argue that the > object instance is not yet created. > > In addition, the ?normal? representation of the java/lang/String object > in print() is the value of the [C array ? so in that case it might very > well be that ?NULL? is the value to output, since there is no [C. > > I can keep ?NULL? as is. > > /Markus > > *From:*Markus Gr?nlund > *Sent:* den 6 april 2014 20:51 > *To:* Staffan Larsen > *Cc:* serviceability-dev at openjdk.net > ; > hotspot-runtime-dev at openjdk.java.net > > *Subject:* RE: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose > -Xcomp can crash VM > > Yes. The java/lang/String object is not NULL but it?s [C field is. > > In the local/expression slots output, there is an object there, it?s not > NULL, it?s being created. > > /Markus > > *From:*Staffan Larsen > *Sent:* den 6 april 2014 20:24 > *To:* Markus Gr?nlund > *Cc:* serviceability-dev at openjdk.net > ; > hotspot-runtime-dev at openjdk.java.net > > *Subject:* Re: RFR(XXS): 8039348: -XX:+TraceDeoptimization -XX:+Verbose > -Xcomp can crash VM > > You have changed the output when the ?value? field is not set from NULL > to ??. Was this intentional? > > /Staffan > > On 6 apr 2014, at 19:05, Markus Gr?nlund > wrote: > > Greetings, > > Kindly asking for reviews for this small fix: > > Bug:https://bugs.openjdk.java.net/browse/JDK-8039348 > > Webrev:http://cr.openjdk.java.net/~mgronlun/8039348/webrev01/ > > Found when debugging: > > -XX:+TraceDeoptimization -XX:+Verbose ?Xcomp > > Using ?Xcomp can cause an uncommon trap in java/lang/String constructors > before the [C value field has been assigned. > > Thanks > > Markus > From goetz.lindenmaier at sap.com Mon Apr 7 21:19:21 2014 From: goetz.lindenmaier at sap.com (Lindenmaier, Goetz) Date: Mon, 7 Apr 2014 21:19:21 +0000 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top In-Reply-To: <5342E331.7090108@oracle.com> References: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> <5342E331.7090108@oracle.com> Message-ID: <4295855A5C1DE049A61835A1887419CC2CEAE052@DEWDFEMB12A.global.corp.sap> Hi Coleen, thanks for the review and the sponsoring! Sorry I can't help with closed changes, I didn't expect any with this one. Best regards, Goetz. From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-bounces at openjdk.java.net] On Behalf Of Coleen Phillimore Sent: Monday, April 07, 2014 7:41 PM To: hotspot-runtime-dev at openjdk.java.net Subject: Re: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top The change looks fine. I can sponsor it unless someone else would like to. Thanks, Coleen On 4/7/14, 6:07 AM, Lindenmaier, Goetz wrote: Hi, could I please get a review of this change? It fixes a rather obvious error, and is really simple. Is runtime the wrong mainling list for interpreter changes? Should I post to comp? Best regards, Goetz. From: Lindenmaier, Goetz Sent: Donnerstag, 3. April 2014 15:33 To: hotspot-runtime-dev at openjdk.java.net Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top Hi, please review an test this small fix to the interpreters. I please need a sponsor. http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ JNIHandleBlock::_top is an int field. Various places store into this field using a pointer store. On 64-bit platforms this can cause errors. This change adapts the corresponding operations on sparc and both x86 variants to use fixed 32-bit operations. Best regards, Goetz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From goetz.lindenmaier at sap.com Mon Apr 7 21:20:03 2014 From: goetz.lindenmaier at sap.com (Lindenmaier, Goetz) Date: Mon, 7 Apr 2014 21:20:03 +0000 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top In-Reply-To: <5342E6AD.80402@oracle.com> References: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> <5342E331.7090108@oracle.com> <5342E6AD.80402@oracle.com> Message-ID: <4295855A5C1DE049A61835A1887419CC2CEAE06D@DEWDFEMB12A.global.corp.sap> Thanks for the review, Vladimir! Best regards, Goetz -----Original Message----- From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] Sent: Monday, April 07, 2014 7:56 PM To: hotspot-runtime-dev at openjdk.java.net Cc: Lindenmaier, Goetz Subject: Re: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top Fix is good but it requires closed changes which we need to prepare before the push. Thanks, Vladimir On 4/7/14 10:41 AM, Coleen Phillimore wrote: > > The change looks fine. I can sponsor it unless someone else would like to. > Thanks, > Coleen > > On 4/7/14, 6:07 AM, Lindenmaier, Goetz wrote: >> >> Hi, >> >> could I please get a review of this change? It fixes a rather >> >> obvious error, and is really simple. >> >> Is runtime the wrong mainling list for interpreter changes? Should I >> >> post to comp? >> >> Best regards, >> >> Goetz. >> >> *From:*Lindenmaier, Goetz >> *Sent:* Donnerstag, 3. April 2014 15:33 >> *To:* hotspot-runtime-dev at openjdk.java.net >> *Subject:* RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top >> >> Hi, >> >> please review an test this small fix to the interpreters. I please need >> >> a sponsor. >> >> http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ >> >> >> JNIHandleBlock::_top is an int field. Various places store into >> >> this field using a pointer store. On 64-bit platforms >> >> this can cause errors. >> >> This change adapts the corresponding operations on sparc >> >> and both x86 variants to use fixed 32-bit operations. >> >> Best regards, >> >> Goetz. >> > From vladimir.kozlov at oracle.com Mon Apr 7 21:45:23 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Mon, 07 Apr 2014 14:45:23 -0700 Subject: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top In-Reply-To: <4295855A5C1DE049A61835A1887419CC2CEAE06D@DEWDFEMB12A.global.corp.sap> References: <4295855A5C1DE049A61835A1887419CC2CEADE9A@DEWDFEMB12A.global.corp.sap> <5342E331.7090108@oracle.com> <5342E6AD.80402@oracle.com> <4295855A5C1DE049A61835A1887419CC2CEAE06D@DEWDFEMB12A.global.corp.sap> Message-ID: <53431C73.7080901@oracle.com> Turns out that we don't need closed changes. We can push this as it is. Thanks, Vladimir On 4/7/14 2:20 PM, Lindenmaier, Goetz wrote: > Thanks for the review, Vladimir! > > Best regards, > Goetz > > -----Original Message----- > From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] > Sent: Monday, April 07, 2014 7:56 PM > To: hotspot-runtime-dev at openjdk.java.net > Cc: Lindenmaier, Goetz > Subject: Re: RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top > > Fix is good but it requires closed changes which we need to prepare > before the push. > > Thanks, > Vladimir > > On 4/7/14 10:41 AM, Coleen Phillimore wrote: >> >> The change looks fine. I can sponsor it unless someone else would like to. >> Thanks, >> Coleen >> >> On 4/7/14, 6:07 AM, Lindenmaier, Goetz wrote: >>> >>> Hi, >>> >>> could I please get a review of this change? It fixes a rather >>> >>> obvious error, and is really simple. >>> >>> Is runtime the wrong mainling list for interpreter changes? Should I >>> >>> post to comp? >>> >>> Best regards, >>> >>> Goetz. >>> >>> *From:*Lindenmaier, Goetz >>> *Sent:* Donnerstag, 3. April 2014 15:33 >>> *To:* hotspot-runtime-dev at openjdk.java.net >>> *Subject:* RFR (S): 8039146: Fix 64-bit store to int JNIHandleBlock::_top >>> >>> Hi, >>> >>> please review an test this small fix to the interpreters. I please need >>> >>> a sponsor. >>> >>> http://cr.openjdk.java.net/~goetz/webrevs/8039146-intSt/webrev.00/ >>> >>> >>> JNIHandleBlock::_top is an int field. Various places store into >>> >>> this field using a pointer store. On 64-bit platforms >>> >>> this can cause errors. >>> >>> This change adapts the corresponding operations on sparc >>> >>> and both x86 variants to use fixed 32-bit operations. >>> >>> Best regards, >>> >>> Goetz. >>> >> From staffan.larsen at oracle.com Tue Apr 8 09:38:43 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 8 Apr 2014 11:38:43 +0200 Subject: RR(S, TEST) JDK-8037279: runtime/6929067/Test6929067.sh crashes on 32bit linux In-Reply-To: <5322C06E.3070203@oracle.com> References: <5321B267.1010904@oracle.com> <53222C6B.9070907@oracle.com> <5322C06E.3070203@oracle.com> Message-ID: <80174D17-79E5-4417-8270-457A153A13D9@oracle.com> Looks ok. Eventually these kinds of tests should be compiled when the product is compiled, not when the tests are bang run. /Staffan On 14 mar 2014, at 09:40, Dmitry Samersoff wrote: > Serguei, > > Thank you for review. > > On 2014-03-14 02:08, serguei.spitsyn at oracle.com wrote: > >> The fix looks good and seems to be a nice cleanup. >> >> Do you see this test always failing without your fix? > > It's always testing COMPILEJAVA not TESTJAVA so if both > points to the same image - test works as expected, if not - test result > is not predictable. > >> It is not clear if it fixes the original issue. >> But this step seems to be in the right direction anyway. > > Yes, I'm not sure it the root of crash. But it's better to fix it. > > -Dmitry > >> >> Thanks, >> Serguei >> >> >> On 3/13/14 6:28 AM, Dmitry Samersoff wrote: >>> Hi Everyone, >>> >>> Please review test-only fix: >>> >>> JDK-8037279: runtime/6929067/Test6929067.sh crashes on 32bit linux >>> >>> http://cr.openjdk.java.net/~dsamersoff/JDK-8037279/webrev.01/ >>> >>> The test has it's own java launcher. This launcher compiles against >>> $TESTJAVA but LD_LIBRARY_PATH set to $COMPILE java. >>> >>> Also I'd changed the test to use variables from test_env.sh >>> >>> -Dmitry >>> >> > > > -- > Dmitry Samersoff > Oracle Java development team, Saint Petersburg, Russia > * I would love to change the world, but they won't give me the sources. From dmitry.samersoff at oracle.com Tue Apr 8 09:40:09 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Tue, 08 Apr 2014 13:40:09 +0400 Subject: RR(S, TEST) JDK-8037279: runtime/6929067/Test6929067.sh crashes on 32bit linux In-Reply-To: <80174D17-79E5-4417-8270-457A153A13D9@oracle.com> References: <5321B267.1010904@oracle.com> <53222C6B.9070907@oracle.com> <5322C06E.3070203@oracle.com> <80174D17-79E5-4417-8270-457A153A13D9@oracle.com> Message-ID: <5343C3F9.40603@oracle.com> Staffan, On 2014-04-08 13:38, Staffan Larsen wrote: > Looks ok. Eventually these kinds of tests should be compiled when the product is compiled, not when the tests are bang run. Thanks. Yes, I agree. -Dmitry > > /Staffan > > On 14 mar 2014, at 09:40, Dmitry Samersoff wrote: > >> Serguei, >> >> Thank you for review. >> >> On 2014-03-14 02:08, serguei.spitsyn at oracle.com wrote: >> >>> The fix looks good and seems to be a nice cleanup. >>> >>> Do you see this test always failing without your fix? >> >> It's always testing COMPILEJAVA not TESTJAVA so if both >> points to the same image - test works as expected, if not - test result >> is not predictable. >> >>> It is not clear if it fixes the original issue. >>> But this step seems to be in the right direction anyway. >> >> Yes, I'm not sure it the root of crash. But it's better to fix it. >> >> -Dmitry >> >>> >>> Thanks, >>> Serguei >>> >>> >>> On 3/13/14 6:28 AM, Dmitry Samersoff wrote: >>>> Hi Everyone, >>>> >>>> Please review test-only fix: >>>> >>>> JDK-8037279: runtime/6929067/Test6929067.sh crashes on 32bit linux >>>> >>>> http://cr.openjdk.java.net/~dsamersoff/JDK-8037279/webrev.01/ >>>> >>>> The test has it's own java launcher. This launcher compiles against >>>> $TESTJAVA but LD_LIBRARY_PATH set to $COMPILE java. >>>> >>>> Also I'd changed the test to use variables from test_env.sh >>>> >>>> -Dmitry >>>> >>> >> >> >> -- >> Dmitry Samersoff >> Oracle Java development team, Saint Petersburg, Russia >> * I would love to change the world, but they won't give me the sources. > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the source code. From staffan.larsen at oracle.com Tue Apr 8 09:40:33 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 8 Apr 2014 11:40:33 +0200 Subject: RR(S, TEST) JDK-8029139: [TESTBUG] runtime/InitialThreadOverflow/testme.sh fails with exit code 127 In-Reply-To: <5321B30A.6010205@oracle.com> References: <5321B30A.6010205@oracle.com> Message-ID: <837EA54F-6F9C-4294-B4D0-C167AEC7088C@oracle.com> Looks good. Thanks, /Staffan On 13 mar 2014, at 14:30, Dmitry Samersoff wrote: > Hi Everyone, > > Please review test-only fix: > > JDK-8029139: [TESTBUG] runtime/InitialThreadOverflow/testme.sh fails > with exit code 127 > > http://cr.openjdk.java.net/~dsamersoff/JDK-8029139/webrev.01/ > > The test has it's own java launcher. This launcher compiles against > $TESTJAVA but LD_LIBRARY_PATH set to $COMPILE java. > > Also I'd changed the test to be C not C++ as C compilation seems to be > more reliable on test hosts. > > -Dmitry > > -- > Dmitry Samersoff > Oracle Java development team, Saint Petersburg, Russia > * I would love to change the world, but they won't give me the sources. From markus.gronlund at oracle.com Tue Apr 8 11:52:09 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Tue, 8 Apr 2014 04:52:09 -0700 (PDT) Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> Message-ID: <5b42d4a9-4606-4fc0-9104-a2659eee7e2a@default> Hi Staffan, I think it looks good. Some minor things: src/share/native/sun/misc/VMSupport.c: line 60: There is some weirdness with the indentation. src/share/javavm/export/jvm.h (both Hotspot and JDK): You might want to consider co-locating 114 JNIEXPORT jstring JNICALL 115 JVM_GetTemporaryDirectory(JNIEnv *env); with 1334 JNIEXPORT jobject JNICALL 1335 JVM_InitAgentProperties(JNIEnv *env, jobject agent_props); Other than that I thinks good - thanks for fixing this. /Markus -----Original Message----- From: Staffan Larsen Sent: den 7 april 2014 21:19 To: Staffan Larsen Cc: serviceability-dev at openjdk.java.net serviceability-dev at openjdk.java.net; hotspot-runtime-dev Subject: Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms And the links: bug: https://bugs.openjdk.java.net/browse/JDK-8033104 webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ Sorry about that, /Staffan On 7 apr 2014, at 20:08, Staffan Larsen wrote: > > The problem here is that the code for finding local VMs is not looking for the data in the correct place. > > When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. > > (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. > > The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. > > (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). > > The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. > > Thanks, > /Staffan From staffan.larsen at oracle.com Tue Apr 8 14:21:47 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 8 Apr 2014 16:21:47 +0200 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <5b42d4a9-4606-4fc0-9104-a2659eee7e2a@default> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <5b42d4a9-4606-4fc0-9104-a2659eee7e2a@default> Message-ID: <1D53CA94-1A49-457E-A6F9-8B94A17B2B66@oracle.com> Thanks Marcus, I will fix those two issues before pushing. /Staffan On 8 apr 2014, at 13:52, Markus Gr?nlund wrote: > Hi Staffan, > > I think it looks good. > > Some minor things: > > src/share/native/sun/misc/VMSupport.c: > > line 60: There is some weirdness with the indentation. > > src/share/javavm/export/jvm.h (both Hotspot and JDK): > > You might want to consider co-locating > > 114 JNIEXPORT jstring JNICALL > 115 JVM_GetTemporaryDirectory(JNIEnv *env); > > with > > 1334 JNIEXPORT jobject JNICALL > 1335 JVM_InitAgentProperties(JNIEnv *env, jobject agent_props); > > > Other than that I thinks good - thanks for fixing this. > > /Markus > > > -----Original Message----- > From: Staffan Larsen > Sent: den 7 april 2014 21:19 > To: Staffan Larsen > Cc: serviceability-dev at openjdk.java.net serviceability-dev at openjdk.java.net; hotspot-runtime-dev > Subject: Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms > > And the links: > > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ > > Sorry about that, > /Staffan > > On 7 apr 2014, at 20:08, Staffan Larsen wrote: > >> >> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >> >> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >> >> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >> >> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >> >> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >> >> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >> >> Thanks, >> /Staffan > From markus.gronlund at oracle.com Wed Apr 9 12:04:03 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Wed, 9 Apr 2014 05:04:03 -0700 (PDT) Subject: RFR(S): 8039458: Ensure consistency of Monitor/Mutex lock acquisitions in relation to safepoint protocol Message-ID: Greetings, ? Kindly asking for reviews for the following bug fix/enhancement ? Webrev: http://cr.openjdk.java.net/~mgronlun/8039458/webrev01/ Bug: https://bugs.openjdk.java.net/browse/JDK-8039458 ? Problem: ? VM code acquire Monitor/Mutex locks by respecting the correct lock order, which is enforced in debug builds (asserts). This is great. ? However, you could be taking locks in the correct order and everything might work just fine during development and testing (even product) but depending on runtime circumstances (load/concurrency), the way the lock(s) was acquired, i.e. the lock acquisition mode, can lead to very hard to debug problems (hangs/deadlocks). This is primarily related to the lock acquisition mode option "Mutex::_no_safepoint_check_flag" by which you inform your intent to respect or not-respect the safepoint protocol during lock acquisition/ownership. If a lock has already been acquired by a thread by passing the Mutex::_no_safepoint_check_flag to circumvent the safepoint protocol, the thread must *not* be allowed to attempt taking yet another lock on which it *might* block ( a lock which was not acquired by passing Mutex::_no_safepoint_check_flag in its acquisition operation), as such a lock would be participating in the safepoint protocol. ? Today, doing this mistake will work just fine _if the lock is currently uncontended_ which it normally is in development/testing situations. However, once the lock then becomes contended (highly volatile pressured/concurrent product deployment) you might get the worst kind of issues to debug (hangs/deadlocks). ? Naturally and as always, you have to very careful when you are taking locks using the Mutex::_no_safepoint_check_flag -however it can be very hard to determine what other code you can safely call once you are the owner of a Mutex::_no_safepoint_check_flag:ed lock ?- and ?today there is nothing but the developers attention to details that will find/help stay clear of this. I think we can do better here in enforcing some invariants in code for preempting potential deadlock prone situations. ? Description: ? Add debug assertions that enforce correct usages of the Mutex::_no_safepoint_check_flag when taking multiple locks. This suggestion leverages much of the existing code targeting enforcement of lock ordering- this is a simple additive change to also add invariant checking on "lock acquisition mode". ? Do note this primarily targets Java Threads running in the VM. ? Also included code comment: ? /* ?* Ensure consistency of Monitor/Mutex lock acquisitions ?* for Java Threads running inside the VM. ?* ?* If a thread has already acquired lock(s) using ?* "Mutex::_no_safepoint_check_flag" (effectively going outside the ?* safepoint protocol), the thread should be disallowed to acquire any ?* additional lock which _is_ participating in the safepoint protocol. ?* ?* If a "safepoint protocol aware" lock is contended, and the thread entering ?* is unable to "fast acquire" the lock using cas/try_spin, ?* it will need to block/park. Blocking on a contended lock involves a ?* state transition and a potential SafepointSynchronize::block() call. ?* Transitioning to a blocked state still holding "Mutex::_no_safepoint_check_flag" ?* acquired locks is allowed, but is *very* deadlock prone. ?* ?* The effect of allowing this state to happen without checking is subtle ?* and hard to debug since a problem might only appear under heavy load and ?* only in situations with increased concurrency levels (product builds). ?* ?*/ ? Testing: Artificial code changes to MutexLocker and Mutex::_no_safepoint_check_flag on certain locks for detecting potential deadlock situations. Speccjbb2005 Kitchensink ? Thank you Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuenag at gmail.com Wed Apr 9 13:22:23 2014 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Wed, 09 Apr 2014 22:22:23 +0900 Subject: -XX:MetaspaceSize is correct? Message-ID: <5345498F.20904@gmail.com> Hi all, I checked initial metaspace size through jcmd PerfCounter.print . However, it seems to be incorrect: - Java command: java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep - Output from -XX:+PrintFlagsFinal: uintx MetaspaceSize = 21807104 {pd product} - Result of "PerfCounter.print" sun.gc.metaspace.capacity=4194304 sun.gc.metaspace.maxCapacity=8388608 sun.gc.metaspace.minCapacity=0 I checked metaspace.cpp, initial size of metaspace is detected by InitialBootClassLoaderMetaspaceSize. However, description of MetaspaceSize in globals.hpp is "Initial size of Metaspaces (in bytes)" . Is description of MetaspaceSize is correct? And this behavior is correct? I have two plan for this mismatch: A) Change description of MetaspaceSize MetaspaceSize is used to HWM in metaspace.cpp . So we should change description for this behavior. ------------ diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 @@ -3160,7 +3156,7 @@ "non-daemon thread (in bytes)") \ \ product_pd(uintx, MetaspaceSize, \ - "Initial size of Metaspaces (in bytes)") \ + "Initial HWM of Metaspaces (in bytes)") \ \ product(uintx, MaxMetaspaceSize, max_uintx, \ "Maximum size of Metaspaces (in bytes)") \ ------------ B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize In currently, InitialBootClassLoaderMetaspaceSize is used to initialize metaspace. InitialBootClassLoaderMetaspaceSize is only to use for it. Thus we should remove this option and use MetaspaceSize to initialize metaspace. ------------ diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 @@ -3172,7 +3172,7 @@ #endif // Initialize these before initializing the VirtualSpaceList - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / BytesPerWord; + _first_chunk_word_size = MetaspaceSize / BytesPerWord; _first_chunk_word_size = align_word_size_up(_first_chunk_word_size); // Make the first class chunk bigger than a medium chunk so it's not put // on the medium chunk list. The next chunk will be small and progress diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 @@ -2333,10 +2333,6 @@ develop(bool, TraceClassLoaderData, false, \ "Trace class loader loader_data lifetime") \ \ - product(uintx, InitialBootClassLoaderMetaspaceSize, \ - NOT_LP64(2200*K) LP64_ONLY(4*M), \ - "Initial size of the boot class loader data metaspace") \ - \ product(bool, TraceGen0Time, false, \ "Trace accumulated time for Gen 0 collection") \ \ ------------ I prefer "B" . Because, I guess many users think MetaspaceSize decides initial metaspace size. If my idea is correct, I will file this to JBS and upload patch to webrev. Thanks, Yasumasa From jon.masamitsu at oracle.com Wed Apr 9 21:51:44 2014 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Wed, 09 Apr 2014 14:51:44 -0700 Subject: -XX:MetaspaceSize is correct? In-Reply-To: <5345498F.20904@gmail.com> References: <5345498F.20904@gmail.com> Message-ID: <5345C0F0.7020606@oracle.com> On 04/09/2014 06:22 AM, Yasumasa Suenaga wrote: > Hi all, > > I checked initial metaspace size through jcmd PerfCounter.print . > However, it seems to be incorrect: > > - Java command: > java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep > > - Output from -XX:+PrintFlagsFinal: > uintx MetaspaceSize = > 21807104 {pd product} > > - Result of "PerfCounter.print" > sun.gc.metaspace.capacity=4194304 > sun.gc.metaspace.maxCapacity=8388608 > sun.gc.metaspace.minCapacity=0 > > > I checked metaspace.cpp, initial size of metaspace is detected by > InitialBootClassLoaderMetaspaceSize. > However, description of MetaspaceSize in globals.hpp is > "Initial size of Metaspaces (in bytes)" . > > Is description of MetaspaceSize is correct? Description is not correct. > And this behavior is correct? Behavior is correct. > > I have two plan for this mismatch: > > A) Change description of MetaspaceSize > MetaspaceSize is used to HWM in metaspace.cpp . > So we should change description for this behavior. > ------------ > diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp > --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 > +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 > @@ -3160,7 +3156,7 @@ > "non-daemon thread (in > bytes)") \ > \ > product_pd(uintx, > MetaspaceSize, \ > - "Initial size of Metaspaces (in > bytes)") \ > + "Initial HWM of Metaspaces (in > bytes)") \ Explain what HWM is if you're going to use it. > \ > product(uintx, MaxMetaspaceSize, > max_uintx, \ > "Maximum size of Metaspaces (in > bytes)") \ > ------------ > > B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize > In currently, InitialBootClassLoaderMetaspaceSize is used to initialize > metaspace. > InitialBootClassLoaderMetaspaceSize is only to use for it. > Thus we should remove this option and use MetaspaceSize to initialize > metaspace. InitialBootClassLoaderMetaspaceSize is an optimization. It allows approximately enough space for the system classes without repeated allocations of Metaspaces. Not everyone agrees with this optimization but I would like it kept. > ------------ > diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp > --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 > +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 > @@ -3172,7 +3172,7 @@ > #endif > > // Initialize these before initializing the VirtualSpaceList > - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / > BytesPerWord; > + _first_chunk_word_size = MetaspaceSize / BytesPerWord; > _first_chunk_word_size = align_word_size_up(_first_chunk_word_size); > // Make the first class chunk bigger than a medium chunk so it's > not put > // on the medium chunk list. The next chunk will be small and > progress > diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp > --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 > +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 > @@ -2333,10 +2333,6 @@ > develop(bool, TraceClassLoaderData, > false, \ > "Trace class loader loader_data > lifetime") \ > \ > - product(uintx, > InitialBootClassLoaderMetaspaceSize, \ > - NOT_LP64(2200*K) > LP64_ONLY(4*M), \ > - "Initial size of the boot class loader data > metaspace") \ > - \ > product(bool, TraceGen0Time, > false, \ > "Trace accumulated time for Gen 0 > collection") \ > \ > ------------ > > I prefer "B" . > Because, I guess many users think MetaspaceSize decides initial > metaspace size. > > If my idea is correct, I will file this to JBS and upload patch to > webrev. Please only correct the description of MetaspaceSize. Jon > > > Thanks, > > Yasumasa > From yasuenag at gmail.com Thu Apr 10 03:37:16 2014 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Thu, 10 Apr 2014 12:37:16 +0900 Subject: -XX:MetaspaceSize is correct? In-Reply-To: <5345C0F0.7020606@oracle.com> References: <5345498F.20904@gmail.com> <5345C0F0.7020606@oracle.com> Message-ID: Hi Jon, Thank you for replying. I filed this issue as JDK-8039867: Incorrect description: -XX:MetaspaceSize . I attached a patch to this entry. I will upload webrev later. Thanks, Yasumasa 2014-04-10 6:51 GMT+09:00, Jon Masamitsu : > > On 04/09/2014 06:22 AM, Yasumasa Suenaga wrote: >> Hi all, >> >> I checked initial metaspace size through jcmd PerfCounter.print . >> However, it seems to be incorrect: >> >> - Java command: >> java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep >> >> - Output from -XX:+PrintFlagsFinal: >> uintx MetaspaceSize = >> 21807104 {pd product} >> >> - Result of "PerfCounter.print" >> sun.gc.metaspace.capacity=4194304 >> sun.gc.metaspace.maxCapacity=8388608 >> sun.gc.metaspace.minCapacity=0 >> >> >> I checked metaspace.cpp, initial size of metaspace is detected by >> InitialBootClassLoaderMetaspaceSize. >> However, description of MetaspaceSize in globals.hpp is >> "Initial size of Metaspaces (in bytes)" . >> >> Is description of MetaspaceSize is correct? > > Description is not correct. > >> And this behavior is correct? > > Behavior is correct. > >> >> I have two plan for this mismatch: >> >> A) Change description of MetaspaceSize >> MetaspaceSize is used to HWM in metaspace.cpp . >> So we should change description for this behavior. >> ------------ >> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >> @@ -3160,7 +3156,7 @@ >> "non-daemon thread (in >> bytes)") \ >> \ >> product_pd(uintx, >> MetaspaceSize, \ >> - "Initial size of Metaspaces (in >> bytes)") \ >> + "Initial HWM of Metaspaces (in >> bytes)") \ > > Explain what HWM is if you're going to use it. > >> \ >> product(uintx, MaxMetaspaceSize, >> max_uintx, \ >> "Maximum size of Metaspaces (in >> bytes)") \ >> ------------ >> >> B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize >> In currently, InitialBootClassLoaderMetaspaceSize is used to initialize >> metaspace. >> InitialBootClassLoaderMetaspaceSize is only to use for it. >> Thus we should remove this option and use MetaspaceSize to initialize >> metaspace. > > InitialBootClassLoaderMetaspaceSize is an optimization. It allows > approximately > enough space for the system classes without repeated allocations of > Metaspaces. > Not everyone agrees with this optimization but I would like it kept. > >> ------------ >> diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp >> --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 >> +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 >> @@ -3172,7 +3172,7 @@ >> #endif >> >> // Initialize these before initializing the VirtualSpaceList >> - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / >> BytesPerWord; >> + _first_chunk_word_size = MetaspaceSize / BytesPerWord; >> _first_chunk_word_size = align_word_size_up(_first_chunk_word_size); >> // Make the first class chunk bigger than a medium chunk so it's >> not put >> // on the medium chunk list. The next chunk will be small and >> progress >> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >> @@ -2333,10 +2333,6 @@ >> develop(bool, TraceClassLoaderData, >> false, \ >> "Trace class loader loader_data >> lifetime") \ >> \ >> - product(uintx, >> InitialBootClassLoaderMetaspaceSize, \ >> - NOT_LP64(2200*K) >> LP64_ONLY(4*M), \ >> - "Initial size of the boot class loader data >> metaspace") \ >> - \ >> product(bool, TraceGen0Time, >> false, \ >> "Trace accumulated time for Gen 0 >> collection") \ >> \ >> ------------ >> >> I prefer "B" . >> Because, I guess many users think MetaspaceSize decides initial >> metaspace size. >> >> If my idea is correct, I will file this to JBS and upload patch to >> webrev. > > Please only correct the description of MetaspaceSize. > > Jon > >> >> >> Thanks, >> >> Yasumasa >> > > From rednaxelafx at gmail.com Thu Apr 10 09:29:30 2014 From: rednaxelafx at gmail.com (Krystal Mok) Date: Thu, 10 Apr 2014 02:29:30 -0700 Subject: Unable to start VM with JDK8 on Linux/x64 Message-ID: Hi HotSpot runtime team, I'd like to report a bug on behave of someone from a discussion thread [1] from the HLLVM forum that I run. This is the symptom he reported: $ uname -a Linux IS-CDSM-166 2.6.32.61-cds-64 #1 SMP PREEMPT Tue Feb 25 20:23:18 PST 2014 x86_64 x86_64 x86_64 GNU/Linux $ java -version Error occurred during initialization of VM Could not allocate metaspace: 1073741824 bytes $ java -XX:MaxMetaspaceSize=1m -XX:MetaspaceSize=1m -version Error occurred during initialization of VM Could not allocate metaspace: 1073741824 bytes Apparently the error message says it's trying to allocate a 1GB metaspace, but failed. This seems to be related to JDK-8003424: Enable Class Data Sharing for CompressedOops [2]. He further tested working around with -XX:-UseCompressedClassPointers, and it worked: # java -XX:ClassMetaspaceSize=512m -version Unrecognized VM option 'ClassMetaspaceSize=512m' Did you mean 'MetaspaceSize='? Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. $ java -XX:-UseCompressedClassPointers -version java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) The tests above were run in a virtual machine with 3GB of memory. When he bumped up the memory for his virtual machine to 8GB, the VM is able to start without the workaround. Has this behavior been seen before? Best regards, Kris [1]: http://hllvm.group.iteye.com/group/topic/39890 [2]: https://bugs.openjdk.java.net/browse/JDK-8003424 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Thu Apr 10 09:39:38 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 10 Apr 2014 19:39:38 +1000 Subject: Trivial RFR: 8039891: Remove ppcsflt builds from JPRT Message-ID: <534666DA.9060507@oracle.com> Subject says it all, these builds (only used by SE Embedded) are no longer needed. http://cr.openjdk.java.net/~dholmes/8039891/webrev/ I'll be pushing this via jdk9/hs-rt and backporting to 8u and 7u. Thanks, David From david.holmes at oracle.com Thu Apr 10 10:00:10 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 10 Apr 2014 20:00:10 +1000 Subject: RFR(S): 8039458: Ensure consistency of Monitor/Mutex lock acquisitions in relation to safepoint protocol In-Reply-To: References: Message-ID: <53466BAA.4060809@oracle.com> Hi Markus, Not sure about the need to set _acquired_with_no_safepoint_check = false in unlock, but otherwise this looks okay to me. You only need to check the most recently acquired lock, because when you acquired it you would have checked the previously acquired lock and so forth. The double negation, !_acquired_with_no_safepoint_check, does make this a little hard to think about. :) I think you may need some additional test coverage to see if this is going to expose existing potentially broken behaviour. Thanks, David On 9/04/2014 10:04 PM, Markus Gr?nlund wrote: > Greetings, > > Kindly asking for reviews for the following bug fix/enhancement > > Webrev: http://cr.openjdk.java.net/~mgronlun/8039458/webrev01/ > > Bug: https://bugs.openjdk.java.net/browse/JDK-8039458 > > Problem: > > VM code acquire Monitor/Mutex locks by respecting the correct lock > order, which is enforced in debug builds (asserts). This is great. > > However, you could be taking locks in the correct order and everything > might work just fine during development and testing (even product) but > depending on runtime circumstances (load/concurrency), the way the > lock(s) was acquired, i.e. the lock acquisition /mode/, can lead to very > hard to debug problems (hangs/deadlocks). This is primarily related to > the lock acquisition mode option ?Mutex::_no_safepoint_check_flag? by > which you inform your intent to respect or not-respect the safepoint > protocol during lock acquisition/ownership. > > > If a lock has already been acquired by a thread by passing the > Mutex::_no_safepoint_check_flag to circumvent the safepoint protocol, > the thread must *not* be allowed to attempt taking yet another lock on > which it *might* block ( a lock which was not acquired by passing > Mutex::_no_safepoint_check_flag in its acquisition operation), as such a > lock would be participating in the safepoint protocol. > > Today, doing this mistake will work just fine _/if the lock is currently > uncontended_ /which it normally is in development/testing situations*.* > However, once the lock then becomes contended (highly volatile > pressured/concurrent product deployment) you might get the worst kind of > issues to debug (hangs/deadlocks). > > Naturally and as always, you have to very careful when you are taking > locks using the Mutex::_no_safepoint_check_flag ?however it can be very > hard to determine what other code you can safely call once you are the > owner of a Mutex::_no_safepoint_check_flag:ed lock - and today there > is nothing but the developers attention to details that will find/help > stay clear of this. I think we can do better here in enforcing some > invariants in code for preempting potential deadlock prone situations. > > Description: > > Add debug assertions that enforce correct usages of the > Mutex::_no_safepoint_check_flag when taking multiple locks. > > > This suggestion leverages much of the existing code targeting > enforcement of lock ordering- this is a simple additive change to also > add invariant checking on "lock acquisition mode". > > Do note this primarily targets Java Threads running in the VM. > > Also included code comment: > > /* > * Ensure consistency of Monitor/Mutex lock acquisitions > * for Java Threads running inside the VM. > * > * If a thread has already acquired lock(s) using > * "Mutex::_no_safepoint_check_flag" (effectively going outside the > * safepoint protocol), the thread should be disallowed to acquire any > * additional lock which _is_ participating in the safepoint protocol. > * > * If a "safepoint protocol aware" lock is contended, and the thread > entering > * is unable to "fast acquire" the lock using cas/try_spin, > * it will need to block/park. Blocking on a contended lock involves a > * state transition and a potential SafepointSynchronize::block() call. > * Transitioning to a blocked state still holding > "Mutex::_no_safepoint_check_flag" > * acquired locks is allowed, but is *very* deadlock prone. > * > * The effect of allowing this state to happen without checking is subtle > * and hard to debug since a problem might only appear under heavy load > and > * only in situations with increased concurrency levels (product builds). > * > */ > > Testing: > > Artificial code changes to MutexLocker and > Mutex::_no_safepoint_check_flag on certain locks for detecting potential > deadlock situations. > > Speccjbb2005 > > Kitchensink > > Thank you > > Markus > From staffan.larsen at oracle.com Thu Apr 10 11:23:37 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Thu, 10 Apr 2014 13:23:37 +0200 Subject: Trivial RFR: 8039891: Remove ppcsflt builds from JPRT In-Reply-To: <534666DA.9060507@oracle.com> References: <534666DA.9060507@oracle.com> Message-ID: Looks good! Thanks, /Staffan On 10 apr 2014, at 11:39, David Holmes wrote: > Subject says it all, these builds (only used by SE Embedded) are no longer needed. > > http://cr.openjdk.java.net/~dholmes/8039891/webrev/ > > I'll be pushing this via jdk9/hs-rt and backporting to 8u and 7u. > > Thanks, > David From stefan.karlsson at oracle.com Thu Apr 10 11:25:51 2014 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Thu, 10 Apr 2014 13:25:51 +0200 Subject: Unable to start VM with JDK8 on Linux/x64 In-Reply-To: References: Message-ID: <53467FBF.4040501@oracle.com> On 2014-04-10 11:29, Krystal Mok wrote: > Hi HotSpot runtime team, > > I'd like to report a bug on behave of someone from a discussion thread > [1] from the HLLVM forum that I run. > > This is the symptom he reported: > > $ uname -a > Linux IS-CDSM-166 2.6.32.61-cds-64 #1 SMP PREEMPT Tue Feb 25 20:23:18 > PST 2014 x86_64 x86_64 x86_64 GNU/Linux > > $ java -version > Error occurred during initialization of VM > Could not allocate metaspace: 1073741824 bytes > > $ java -XX:MaxMetaspaceSize=1m -XX:MetaspaceSize=1m -version > Error occurred during initialization of VM > Could not allocate metaspace: 1073741824 bytes > > Apparently the error message says it's trying to allocate a 1GB > metaspace, but failed. This seems to be related to JDK-8003424: Enable > Class Data Sharing for CompressedOops [2]. > > He further tested working around with -XX:-UseCompressedClassPointers, > and it worked: > > # java -XX:ClassMetaspaceSize=512m -version > Unrecognized VM option 'ClassMetaspaceSize=512m' > Did you mean 'MetaspaceSize='? > Error: Could not create the Java Virtual Machine. > Error: A fatal exception has occurred. Program will exit. The correct flag to use is: -XX:CompressedClassSpaceSize=512m > > $ java -XX:-UseCompressedClassPointers -version > java version "1.8.0" > Java(TM) SE Runtime Environment (build 1.8.0-b132) > Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) > > The tests above were run in a virtual machine with 3GB of memory. > When he bumped up the memory for his virtual machine to 8GB, the VM is > able to start without the workaround. > > Has this behavior been seen before? I think you'll see this behavior if overcommit_memory is set to 2. $ man 5 proc --- /proc/sys/vm/overcommit_memory This file contains the kernel virtual memory accounting mode. Values are: 0: heuristic overcommit (this is the default) 1: always overcommit, never check 2: always check, never overcommit In mode 0, calls of mmap(2) with MAP_NORESERVE are not checked, and the default check is very weak, leading to the risk of getting a process "OOM-killed". Under Linux 2.4 any nonzero value implies mode 1. In mode 2 (available since Linux 2.6), the total virtual address space on the system is limited to (SS + RAM*(r/100)), where SS is the size of the swap space, and RAM is the size of the physical memory, and r is the contents of the file /proc/sys/vm/overcommit_ratio. --- Could this be the reason why we fail to reserve the 1 GB large compressed class space? StefanK > > Best regards, > Kris > > [1]: http://hllvm.group.iteye.com/group/topic/39890 > [2]: https://bugs.openjdk.java.net/browse/JDK-8003424 From yasuenag at gmail.com Thu Apr 10 12:20:38 2014 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Thu, 10 Apr 2014 21:20:38 +0900 Subject: -XX:MetaspaceSize is correct? In-Reply-To: References: <5345498F.20904@gmail.com> <5345C0F0.7020606@oracle.com> Message-ID: <53468C96.6080107@gmail.com> I uploaded webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8039867/webrev.00/ Please review and sponsoring! Yasumasa On 04/10/2014 12:37 PM, Yasumasa Suenaga wrote: > Hi Jon, > Thank you for replying. > > I filed this issue as JDK-8039867: Incorrect description: -XX:MetaspaceSize . > > I attached a patch to this entry. > I will upload webrev later. > > > Thanks, > > Yasumasa > > > > 2014-04-10 6:51 GMT+09:00, Jon Masamitsu : >> On 04/09/2014 06:22 AM, Yasumasa Suenaga wrote: >>> Hi all, >>> >>> I checked initial metaspace size through jcmd PerfCounter.print . >>> However, it seems to be incorrect: >>> >>> - Java command: >>> java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep >>> >>> - Output from -XX:+PrintFlagsFinal: >>> uintx MetaspaceSize = >>> 21807104 {pd product} >>> >>> - Result of "PerfCounter.print" >>> sun.gc.metaspace.capacity=4194304 >>> sun.gc.metaspace.maxCapacity=8388608 >>> sun.gc.metaspace.minCapacity=0 >>> >>> >>> I checked metaspace.cpp, initial size of metaspace is detected by >>> InitialBootClassLoaderMetaspaceSize. >>> However, description of MetaspaceSize in globals.hpp is >>> "Initial size of Metaspaces (in bytes)" . >>> >>> Is description of MetaspaceSize is correct? >> Description is not correct. >> >>> And this behavior is correct? >> Behavior is correct. >> >>> I have two plan for this mismatch: >>> >>> A) Change description of MetaspaceSize >>> MetaspaceSize is used to HWM in metaspace.cpp . >>> So we should change description for this behavior. >>> ------------ >>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>> @@ -3160,7 +3156,7 @@ >>> "non-daemon thread (in >>> bytes)") \ >>> \ >>> product_pd(uintx, >>> MetaspaceSize, \ >>> - "Initial size of Metaspaces (in >>> bytes)") \ >>> + "Initial HWM of Metaspaces (in >>> bytes)") \ >> Explain what HWM is if you're going to use it. >> >>> \ >>> product(uintx, MaxMetaspaceSize, >>> max_uintx, \ >>> "Maximum size of Metaspaces (in >>> bytes)") \ >>> ------------ >>> >>> B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize >>> In currently, InitialBootClassLoaderMetaspaceSize is used to initialize >>> metaspace. >>> InitialBootClassLoaderMetaspaceSize is only to use for it. >>> Thus we should remove this option and use MetaspaceSize to initialize >>> metaspace. >> InitialBootClassLoaderMetaspaceSize is an optimization. It allows >> approximately >> enough space for the system classes without repeated allocations of >> Metaspaces. >> Not everyone agrees with this optimization but I would like it kept. >> >>> ------------ >>> diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp >>> --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 >>> +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 >>> @@ -3172,7 +3172,7 @@ >>> #endif >>> >>> // Initialize these before initializing the VirtualSpaceList >>> - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / >>> BytesPerWord; >>> + _first_chunk_word_size = MetaspaceSize / BytesPerWord; >>> _first_chunk_word_size = align_word_size_up(_first_chunk_word_size); >>> // Make the first class chunk bigger than a medium chunk so it's >>> not put >>> // on the medium chunk list. The next chunk will be small and >>> progress >>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>> @@ -2333,10 +2333,6 @@ >>> develop(bool, TraceClassLoaderData, >>> false, \ >>> "Trace class loader loader_data >>> lifetime") \ >>> \ >>> - product(uintx, >>> InitialBootClassLoaderMetaspaceSize, \ >>> - NOT_LP64(2200*K) >>> LP64_ONLY(4*M), \ >>> - "Initial size of the boot class loader data >>> metaspace") \ >>> - \ >>> product(bool, TraceGen0Time, >>> false, \ >>> "Trace accumulated time for Gen 0 >>> collection") \ >>> \ >>> ------------ >>> >>> I prefer "B" . >>> Because, I guess many users think MetaspaceSize decides initial >>> metaspace size. >>> >>> If my idea is correct, I will file this to JBS and upload patch to >>> webrev. >> Please only correct the description of MetaspaceSize. >> >> Jon >> >>> >>> Thanks, >>> >>> Yasumasa >>> >> From harold.seigel at oracle.com Thu Apr 10 12:26:11 2014 From: harold.seigel at oracle.com (harold seigel) Date: Thu, 10 Apr 2014 08:26:11 -0400 Subject: Trivial RFR: 8039891: Remove ppcsflt builds from JPRT In-Reply-To: <534666DA.9060507@oracle.com> References: <534666DA.9060507@oracle.com> Message-ID: <53468DE3.7060102@oracle.com> Hi David, It looks good. Harold On 4/10/2014 5:39 AM, David Holmes wrote: > Subject says it all, these builds (only used by SE Embedded) are no > longer needed. > > http://cr.openjdk.java.net/~dholmes/8039891/webrev/ > > I'll be pushing this via jdk9/hs-rt and backporting to 8u and 7u. > > Thanks, > David From coleen.phillimore at oracle.com Thu Apr 10 12:30:19 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Thu, 10 Apr 2014 08:30:19 -0400 Subject: Trivial RFR: 8039891: Remove ppcsflt builds from JPRT In-Reply-To: References: <534666DA.9060507@oracle.com> Message-ID: <53468EDB.9020507@oracle.com> +1 Coleen On 4/10/14, 7:23 AM, Staffan Larsen wrote: > Looks good! > > Thanks, > /Staffan > > On 10 apr 2014, at 11:39, David Holmes wrote: > >> Subject says it all, these builds (only used by SE Embedded) are no longer needed. >> >> http://cr.openjdk.java.net/~dholmes/8039891/webrev/ >> >> I'll be pushing this via jdk9/hs-rt and backporting to 8u and 7u. >> >> Thanks, >> David From rednaxelafx at gmail.com Thu Apr 10 19:54:31 2014 From: rednaxelafx at gmail.com (Krystal Mok) Date: Thu, 10 Apr 2014 12:54:31 -0700 Subject: Unable to start VM with JDK8 on Linux/x64 In-Reply-To: <53467FBF.4040501@oracle.com> References: <53467FBF.4040501@oracle.com> Message-ID: Hi Stefan, Thank you for your explanation. The overcommit_memory=2 theory looks reasonable. Let me pass it back to the original discussion thread and see if that's the case. Anyway, it'd still be nice if Java could start in a more graceful way. Thanks, Kris On Thu, Apr 10, 2014 at 4:25 AM, Stefan Karlsson wrote: > > On 2014-04-10 11:29, Krystal Mok wrote: > >> Hi HotSpot runtime team, >> >> I'd like to report a bug on behave of someone from a discussion thread >> [1] from the HLLVM forum that I run. >> >> This is the symptom he reported: >> >> $ uname -a >> Linux IS-CDSM-166 2.6.32.61-cds-64 #1 SMP PREEMPT Tue Feb 25 20:23:18 PST >> 2014 x86_64 x86_64 x86_64 GNU/Linux >> >> $ java -version >> Error occurred during initialization of VM >> Could not allocate metaspace: 1073741824 bytes >> >> $ java -XX:MaxMetaspaceSize=1m -XX:MetaspaceSize=1m -version >> Error occurred during initialization of VM >> Could not allocate metaspace: 1073741824 bytes >> >> Apparently the error message says it's trying to allocate a 1GB >> metaspace, but failed. This seems to be related to JDK-8003424: Enable >> Class Data Sharing for CompressedOops [2]. >> >> He further tested working around with -XX:-UseCompressedClassPointers, >> and it worked: >> >> # java -XX:ClassMetaspaceSize=512m -version >> Unrecognized VM option 'ClassMetaspaceSize=512m' >> Did you mean 'MetaspaceSize='? >> Error: Could not create the Java Virtual Machine. >> Error: A fatal exception has occurred. Program will exit. >> > > The correct flag to use is: -XX:CompressedClassSpaceSize=512m > > > >> $ java -XX:-UseCompressedClassPointers -version >> java version "1.8.0" >> Java(TM) SE Runtime Environment (build 1.8.0-b132) >> Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) >> >> The tests above were run in a virtual machine with 3GB of memory. >> When he bumped up the memory for his virtual machine to 8GB, the VM is >> able to start without the workaround. >> >> Has this behavior been seen before? >> > > I think you'll see this behavior if overcommit_memory is set to 2. > > $ man 5 proc > --- > /proc/sys/vm/overcommit_memory > This file contains the kernel virtual memory accounting > mode. Values are: > > 0: heuristic overcommit (this is the default) > 1: always overcommit, never check > 2: always check, never overcommit > > In mode 0, calls of mmap(2) with MAP_NORESERVE are not > checked, and the default check is very weak, leading to the risk of getting > a process "OOM-killed". Under Linux 2.4 any nonzero value implies mode 1. > In mode 2 > (available since Linux 2.6), the total virtual address > space on the system is limited to (SS + RAM*(r/100)), where SS is the size > of the swap space, and RAM is the size of the physical memory, and r is the > contents of > the file /proc/sys/vm/overcommit_ratio. > --- > > Could this be the reason why we fail to reserve the 1 GB large compressed > class space? > > StefanK > > > >> Best regards, >> Kris >> >> [1]: http://hllvm.group.iteye.com/group/topic/39890 >> [2]: https://bugs.openjdk.java.net/browse/JDK-8003424 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.simms at oracle.com Fri Apr 11 10:44:17 2014 From: david.simms at oracle.com (David Simms) Date: Fri, 11 Apr 2014 12:44:17 +0200 Subject: RFR (XS) 8039947: Dtrace return probe name for jni_SetStaticBooleanField named incorrectly Message-ID: <5347C781.5030508@oracle.com> Gidday, I have an embarrassingly small one line fix... https://bugs.openjdk.java.net/browse/JDK-8039947 http://cr.openjdk.java.net/~dsimms/8039947/ From david.holmes at oracle.com Fri Apr 11 11:16:21 2014 From: david.holmes at oracle.com (David Holmes) Date: Fri, 11 Apr 2014 21:16:21 +1000 Subject: RFR (XS) 8039947: Dtrace return probe name for jni_SetStaticBooleanField named incorrectly In-Reply-To: <5347C781.5030508@oracle.com> References: <5347C781.5030508@oracle.com> Message-ID: <5347CF05.5030005@oracle.com> On 11/04/2014 8:44 PM, David Simms wrote: > Gidday, > > I have an embarrassingly small one line fix... Ship it! :) David > > https://bugs.openjdk.java.net/browse/JDK-8039947 > > http://cr.openjdk.java.net/~dsimms/8039947/ > > > > From david.simms at oracle.com Fri Apr 11 11:18:34 2014 From: david.simms at oracle.com (David Simms) Date: Fri, 11 Apr 2014 13:18:34 +0200 Subject: RFR (XS) 8039947: Dtrace return probe name for jni_SetStaticBooleanField named incorrectly In-Reply-To: <5347CF05.5030005@oracle.com> References: <5347C781.5030508@oracle.com> <5347CF05.5030005@oracle.com> Message-ID: <5347CF8A.1040902@oracle.com> Thanks David ! On 04/11/2014 01:16 PM, David Holmes wrote: > On 11/04/2014 8:44 PM, David Simms wrote: >> Gidday, >> >> I have an embarrassingly small one line fix... > > Ship it! :) > > David > >> >> https://bugs.openjdk.java.net/browse/JDK-8039947 >> >> http://cr.openjdk.java.net/~dsimms/8039947/ >> >> >> >> From staffan.larsen at oracle.com Fri Apr 11 11:21:50 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 11 Apr 2014 13:21:50 +0200 Subject: RFR (XS) 8039947: Dtrace return probe name for jni_SetStaticBooleanField named incorrectly In-Reply-To: <5347C781.5030508@oracle.com> References: <5347C781.5030508@oracle.com> Message-ID: Looks good! Thanks, /Staffan On 11 apr 2014, at 12:44, David Simms wrote: > Gidday, > > I have an embarrassingly small one line fix... > > > https://bugs.openjdk.java.net/browse/JDK-8039947 > > http://cr.openjdk.java.net/~dsimms/8039947/ > > > From george.triantafillou at oracle.com Fri Apr 11 11:36:31 2014 From: george.triantafillou at oracle.com (George Triantafillou) Date: Fri, 11 Apr 2014 07:36:31 -0400 Subject: RFR (XS) 8039947: Dtrace return probe name for jni_SetStaticBooleanField named incorrectly In-Reply-To: <5347C781.5030508@oracle.com> References: <5347C781.5030508@oracle.com> Message-ID: <5347D3BF.8070606@oracle.com> David, Looks good. -George On 4/11/2014 6:44 AM, David Simms wrote: > Gidday, > > I have an embarrassingly small one line fix... > > > https://bugs.openjdk.java.net/browse/JDK-8039947 > > http://cr.openjdk.java.net/~dsimms/8039947/ > > > > From lois.foltan at oracle.com Fri Apr 11 13:04:13 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 09:04:13 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <5339C72A.8040405@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> Message-ID: <5347E84D.60304@oracle.com> Please review the updated fix, webrev at: http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ This includes Keith's suggestion below. All testing has been rerun successfully. Thank you, Lois On 3/31/2014 3:51 PM, Lois Foltan wrote: > > On 3/31/2014 2:08 PM, Keith McGuigan wrote: >> Hi Lois, >> >> I think that looks good. I like it much better than doing the static >> method check in the default method processing. >> My only suggestion is that it would be nice to encode new parameter >> to uncached_lookup_method to be some sort of enum instead of a >> boolean, so that it is obvious from the call-site what the behavior >> should be (having just "false" in the parameter list requires you to >> reference back to the declaration to figure out what that "false" means). >> >> So instead of: >> uncached_lookup_method(field_name, field_sig, false); >> It'd be: >> uncached_lookup_method(field_name, field_sig, NORMAL); or >> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >> >> (or something like that -- I'm no good at names). > > Thank you Keith. Good suggestion. I will implement and repost an > updated webrev for review. > Lois > >> >> -- >> - Keith >> >> >> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan > > wrote: >> >> Hi, >> >> Please review the following fix: >> >> Webrev: >> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >> >> >> Bug: invokestatic: IncompatibleClassChangeError trying to invoke >> static method from a parent in presence of conflicting defaults >> https://bugs.openjdk.java.net/browse/JDK-8033150 >> >> Summary of fix: >> During default method processing, determine_target(), is >> responsible for making decisions on whether >> to create and add an overpass method to the current class for >> issues that have been encountered during the walk >> of the default methods. The routine >> defaultMethods.cpp/has_matching_static() helped determine this >> decision by looking within the current class for a static method >> that should be preferred during method >> resolution over an overpass method being created. However, >> has_matching_static() did not continue to >> look for a static method in current class' superclasses which >> JDK-8033150 exposed. >> >> After looking at the code more closely, the has >> _matching_static() concept is being moved out out of default >> method processing and into method resolution processing. The >> primary reason for this is to allow >> default method processing to match method selection where statics >> are and should be ignored. According >> to JVMS, static methods should only be preferred over an overpass >> method at method and interface >> method resolution time. To enable method resolution to >> potentially find a static method over an overpass >> method, a new parameter "ignore_overpass" was added to >> InstanceKlass::uncached_lookup_method(). >> It has the affect of indicating to find_method_index() to ignore >> overpass methods and continue the search >> in case a static method of the same name and signature is present >> in the current class or its superclasses. >> >> Tests: >> - jtreg hotspot/test/*, JDK java.lang & java.util, >> vm.quick.testlist, JCK lang & vm, defmeth tests >> - Test will be added to the defmeth test system >> >> Thank you, >> Lois >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Fri Apr 11 13:19:12 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 09:19:12 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 Message-ID: <5347EBD0.4080906@oracle.com> Hello, Please review the following fix: Webrev: http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ Bug: constraint on multianewarray instruction is not checked since class version 50 https://bugs.openjdk.java.net/browse/JDK-8038076 Summary of fix: The incorrect placement of a post increment operator was causing the calculated dimensions of a multianewarray bytecode to be 1 greater than reality. The end result of this bug was that a VerifyError would not be correctly generated if the multianewarray bytecode contained an array type descriptor that was 1 dimension smaller than the number of dimensions specified. Thank you to Christian Tornqvist for writing the test case included. Tests: - jtreg hotspot/test/*, JDK java.lang & java.util, vm.quick.testlist, JCK lang tests - JCK vm in progress Thank you, Lois From harold.seigel at oracle.com Fri Apr 11 13:32:23 2014 From: harold.seigel at oracle.com (harold seigel) Date: Fri, 11 Apr 2014 09:32:23 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <5347EBD0.4080906@oracle.com> References: <5347EBD0.4080906@oracle.com> Message-ID: <5347EEE7.4090309@oracle.com> Hi Lois, This looks good. Harold On 4/11/2014 9:19 AM, Lois Foltan wrote: > Hello, > > Please review the following fix: > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ > > Bug: constraint on multianewarray instruction is not checked since > class version 50 > https://bugs.openjdk.java.net/browse/JDK-8038076 > > Summary of fix: > The incorrect placement of a post increment operator was causing the > calculated dimensions of a multianewarray bytecode to be 1 greater > than reality. The end result of this bug was that a VerifyError would > not be correctly generated if the multianewarray bytecode contained an > array type descriptor that was 1 dimension smaller than the number of > dimensions specified. Thank you to Christian Tornqvist for writing > the test case included. > > Tests: > - jtreg hotspot/test/*, JDK java.lang & java.util, > vm.quick.testlist, JCK lang tests > - JCK vm in progress > > Thank you, > Lois From christian.tornqvist at oracle.com Fri Apr 11 13:35:38 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Fri, 11 Apr 2014 09:35:38 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <5347EBD0.4080906@oracle.com> References: <5347EBD0.4080906@oracle.com> Message-ID: <051a01cf558a$ed3e61d0$c7bb2570$@oracle.com> Looks good, thanks for fixing this. Thanks, Christian -----Original Message----- From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-bounces at openjdk.java.net] On Behalf Of Lois Foltan Sent: Friday, April 11, 2014 9:19 AM To: hotspot-runtime-dev Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 Hello, Please review the following fix: Webrev: http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ Bug: constraint on multianewarray instruction is not checked since class version 50 https://bugs.openjdk.java.net/browse/JDK-8038076 Summary of fix: The incorrect placement of a post increment operator was causing the calculated dimensions of a multianewarray bytecode to be 1 greater than reality. The end result of this bug was that a VerifyError would not be correctly generated if the multianewarray bytecode contained an array type descriptor that was 1 dimension smaller than the number of dimensions specified. Thank you to Christian Tornqvist for writing the test case included. Tests: - jtreg hotspot/test/*, JDK java.lang & java.util, vm.quick.testlist, JCK lang tests - JCK vm in progress Thank you, Lois From lois.foltan at oracle.com Fri Apr 11 13:41:22 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 09:41:22 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <051a01cf558a$ed3e61d0$c7bb2570$@oracle.com> References: <5347EBD0.4080906@oracle.com> <051a01cf558a$ed3e61d0$c7bb2570$@oracle.com> Message-ID: <5347F102.1030904@oracle.com> Thank you Harold and Christian for the review! Lois On 4/11/2014 9:35 AM, Christian Tornqvist wrote: > Looks good, thanks for fixing this. > > Thanks, > Christian > > -----Original Message----- > From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-bounces at openjdk.java.net] On Behalf Of Lois Foltan > Sent: Friday, April 11, 2014 9:19 AM > To: hotspot-runtime-dev > Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 > > Hello, > > Please review the following fix: > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ > > Bug: constraint on multianewarray instruction is not checked since class version 50 > https://bugs.openjdk.java.net/browse/JDK-8038076 > > Summary of fix: > The incorrect placement of a post increment operator was causing the calculated dimensions of a multianewarray bytecode to be 1 greater than reality. The end result of this bug was that a VerifyError would not be correctly generated if the multianewarray bytecode contained an array type descriptor that was 1 dimension smaller than the number of dimensions specified. Thank you to Christian Tornqvist for writing the test case included. > > Tests: > - jtreg hotspot/test/*, JDK java.lang & java.util, vm.quick.testlist, JCK lang tests > - JCK vm in progress > > Thank you, > Lois > From kmcguigan at twitter.com Fri Apr 11 13:51:01 2014 From: kmcguigan at twitter.com (Keith McGuigan) Date: Fri, 11 Apr 2014 09:51:01 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <5347E84D.60304@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> Message-ID: Hi Lois, Looks good, thanks for making that change! -- - Keith On Fri, Apr 11, 2014 at 9:04 AM, Lois Foltan wrote: > > Please review the updated fix, webrev at: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ > > This includes Keith's suggestion below. All testing has been rerun > successfully. > > Thank you, > Lois > > > On 3/31/2014 3:51 PM, Lois Foltan wrote: > > > On 3/31/2014 2:08 PM, Keith McGuigan wrote: > > Hi Lois, > > I think that looks good. I like it much better than doing the static > method check in the default method processing. > My only suggestion is that it would be nice to encode new parameter to > uncached_lookup_method to be some sort of enum instead of a boolean, so > that it is obvious from the call-site what the behavior should be (having > just "false" in the parameter list requires you to reference back to the > declaration to figure out what that "false" means). > > So instead of: > uncached_lookup_method(field_name, field_sig, false); > It'd be: > uncached_lookup_method(field_name, field_sig, NORMAL); or > uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); > > (or something like that -- I'm no good at names). > > > Thank you Keith. Good suggestion. I will implement and repost an updated > webrev for review. > Lois > > > -- > - Keith > > > On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan wrote: > >> Hi, >> >> Please review the following fix: >> >> Webrev: >> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >> >> Bug: invokestatic: IncompatibleClassChangeError trying to invoke static >> method from a parent in presence of conflicting defaults >> https://bugs.openjdk.java.net/browse/JDK-8033150 >> >> Summary of fix: >> During default method processing, determine_target(), is responsible for >> making decisions on whether >> to create and add an overpass method to the current class for issues that >> have been encountered during the walk >> of the default methods. The routine >> defaultMethods.cpp/has_matching_static() helped determine this >> decision by looking within the current class for a static method that >> should be preferred during method >> resolution over an overpass method being created. However, >> has_matching_static() did not continue to >> look for a static method in current class' superclasses which JDK-8033150 >> exposed. >> >> After looking at the code more closely, the has _matching_static() >> concept is being moved out out of default >> method processing and into method resolution processing. The primary >> reason for this is to allow >> default method processing to match method selection where statics are and >> should be ignored. According >> to JVMS, static methods should only be preferred over an overpass method >> at method and interface >> method resolution time. To enable method resolution to potentially find >> a static method over an overpass >> method, a new parameter "ignore_overpass" was added to >> InstanceKlass::uncached_lookup_method(). >> It has the affect of indicating to find_method_index() to ignore overpass >> methods and continue the search >> in case a static method of the same name and signature is present in the >> current class or its superclasses. >> >> Tests: >> - jtreg hotspot/test/*, JDK java.lang & java.util, vm.quick.testlist, >> JCK lang & vm, defmeth tests >> - Test will be added to the defmeth test system >> >> Thank you, >> Lois >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kmcguigan at twitter.com Fri Apr 11 13:54:46 2014 From: kmcguigan at twitter.com (Keith McGuigan) Date: Fri, 11 Apr 2014 09:54:46 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <5347EBD0.4080906@oracle.com> References: <5347EBD0.4080906@oracle.com> Message-ID: D'oh! That'd be my bad. Darn off-by-one errors. Fix looks good, thanks for doing it! -- - Keith On Fri, Apr 11, 2014 at 9:19 AM, Lois Foltan wrote: > Hello, > > Please review the following fix: > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ > > Bug: constraint on multianewarray instruction is not checked since class > version 50 > https://bugs.openjdk.java.net/browse/JDK-8038076 > > Summary of fix: > The incorrect placement of a post increment operator was causing the > calculated dimensions of a multianewarray bytecode to be 1 greater than > reality. The end result of this bug was that a VerifyError would not be > correctly generated if the multianewarray bytecode contained an array type > descriptor that was 1 dimension smaller than the number of dimensions > specified. Thank you to Christian Tornqvist for writing the test case > included. > > Tests: > - jtreg hotspot/test/*, JDK java.lang & java.util, > vm.quick.testlist, JCK lang tests > - JCK vm in progress > > Thank you, > Lois > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Fri Apr 11 13:58:03 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 09:58:03 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <5347EBD0.4080906@oracle.com> References: <5347EBD0.4080906@oracle.com> Message-ID: <5347F4EB.3050502@oracle.com> Looks good. Coleen On 4/11/14, 9:19 AM, Lois Foltan wrote: > Hello, > > Please review the following fix: > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ > > Bug: constraint on multianewarray instruction is not checked since > class version 50 > https://bugs.openjdk.java.net/browse/JDK-8038076 > > Summary of fix: > The incorrect placement of a post increment operator was causing the > calculated dimensions of a multianewarray bytecode to be 1 greater > than reality. The end result of this bug was that a VerifyError would > not be correctly generated if the multianewarray bytecode contained an > array type descriptor that was 1 dimension smaller than the number of > dimensions specified. Thank you to Christian Tornqvist for writing > the test case included. > > Tests: > - jtreg hotspot/test/*, JDK java.lang & java.util, > vm.quick.testlist, JCK lang tests > - JCK vm in progress > > Thank you, > Lois From coleen.phillimore at oracle.com Fri Apr 11 14:02:35 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 10:02:35 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <5347E84D.60304@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> Message-ID: <5347F5FB.20309@oracle.com> This code looks good. The MethodLookupMode enum is a nice improvement. It's a good warning of the complexity of this code. Did something part of the build complain about MethodLookupMode not being in vmStructs? I'd prefer the serviceability agent not be tempted to duplicate the method lookup code in the JVM, so not have this change. Thanks, Coleen On 4/11/14, 9:04 AM, Lois Foltan wrote: > > Please review the updated fix, webrev at: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ > > This includes Keith's suggestion below. All testing has been rerun > successfully. > > Thank you, > Lois > > > On 3/31/2014 3:51 PM, Lois Foltan wrote: >> >> On 3/31/2014 2:08 PM, Keith McGuigan wrote: >>> Hi Lois, >>> >>> I think that looks good. I like it much better than doing the >>> static method check in the default method processing. >>> My only suggestion is that it would be nice to encode new parameter >>> to uncached_lookup_method to be some sort of enum instead of a >>> boolean, so that it is obvious from the call-site what the behavior >>> should be (having just "false" in the parameter list requires you to >>> reference back to the declaration to figure out what that "false" >>> means). >>> >>> So instead of: >>> uncached_lookup_method(field_name, field_sig, false); >>> It'd be: >>> uncached_lookup_method(field_name, field_sig, NORMAL); or >>> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >>> >>> (or something like that -- I'm no good at names). >> >> Thank you Keith. Good suggestion. I will implement and repost an >> updated webrev for review. >> Lois >> >>> >>> -- >>> - Keith >>> >>> >>> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan >> > wrote: >>> >>> Hi, >>> >>> Please review the following fix: >>> >>> Webrev: >>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >>> >>> >>> Bug: invokestatic: IncompatibleClassChangeError trying to invoke >>> static method from a parent in presence of conflicting defaults >>> https://bugs.openjdk.java.net/browse/JDK-8033150 >>> >>> Summary of fix: >>> During default method processing, determine_target(), is >>> responsible for making decisions on whether >>> to create and add an overpass method to the current class for >>> issues that have been encountered during the walk >>> of the default methods. The routine >>> defaultMethods.cpp/has_matching_static() helped determine this >>> decision by looking within the current class for a static method >>> that should be preferred during method >>> resolution over an overpass method being created. However, >>> has_matching_static() did not continue to >>> look for a static method in current class' superclasses which >>> JDK-8033150 exposed. >>> >>> After looking at the code more closely, the has >>> _matching_static() concept is being moved out out of default >>> method processing and into method resolution processing. The >>> primary reason for this is to allow >>> default method processing to match method selection where >>> statics are and should be ignored. According >>> to JVMS, static methods should only be preferred over an >>> overpass method at method and interface >>> method resolution time. To enable method resolution to >>> potentially find a static method over an overpass >>> method, a new parameter "ignore_overpass" was added to >>> InstanceKlass::uncached_lookup_method(). >>> It has the affect of indicating to find_method_index() to ignore >>> overpass methods and continue the search >>> in case a static method of the same name and signature is >>> present in the current class or its superclasses. >>> >>> Tests: >>> - jtreg hotspot/test/*, JDK java.lang & java.util, >>> vm.quick.testlist, JCK lang & vm, defmeth tests >>> - Test will be added to the defmeth test system >>> >>> Thank you, >>> Lois >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Fri Apr 11 14:06:10 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 10:06:10 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: References: <5347EBD0.4080906@oracle.com> Message-ID: <5347F6D2.8050101@oracle.com> On 4/11/2014 9:54 AM, Keith McGuigan wrote: > D'oh! That'd be my bad. Darn off-by-one errors. Fix looks good, > thanks for doing it! Hi Keith, No problem. Thanks for reviewing! Lois > > -- > - Keith > > > On Fri, Apr 11, 2014 at 9:19 AM, Lois Foltan > wrote: > > Hello, > > Please review the following fix: > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ > > > Bug: constraint on multianewarray instruction is not checked since > class version 50 > https://bugs.openjdk.java.net/browse/JDK-8038076 > > Summary of fix: > The incorrect placement of a post increment operator was causing > the calculated dimensions of a multianewarray bytecode to be 1 > greater than reality. The end result of this bug was that a > VerifyError would not be correctly generated if the multianewarray > bytecode contained an array type descriptor that was 1 dimension > smaller than the number of dimensions specified. Thank you to > Christian Tornqvist for writing the test case included. > > Tests: > - jtreg hotspot/test/*, JDK java.lang & java.util, > vm.quick.testlist, JCK lang tests > - JCK vm in progress > > Thank you, > Lois > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Fri Apr 11 14:06:34 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 10:06:34 -0400 Subject: RFR (XS) JDK-8038076: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <5347F4EB.3050502@oracle.com> References: <5347EBD0.4080906@oracle.com> <5347F4EB.3050502@oracle.com> Message-ID: <5347F6EA.7060603@oracle.com> Thanks Coleen! Lois On 4/11/2014 9:58 AM, Coleen Phillimore wrote: > > Looks good. > Coleen > > On 4/11/14, 9:19 AM, Lois Foltan wrote: >> Hello, >> >> Please review the following fix: >> >> Webrev: >> http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076/ >> >> Bug: constraint on multianewarray instruction is not checked since >> class version 50 >> https://bugs.openjdk.java.net/browse/JDK-8038076 >> >> Summary of fix: >> The incorrect placement of a post increment operator was causing the >> calculated dimensions of a multianewarray bytecode to be 1 greater >> than reality. The end result of this bug was that a VerifyError >> would not be correctly generated if the multianewarray bytecode >> contained an array type descriptor that was 1 dimension smaller than >> the number of dimensions specified. Thank you to Christian Tornqvist >> for writing the test case included. >> >> Tests: >> - jtreg hotspot/test/*, JDK java.lang & java.util, >> vm.quick.testlist, JCK lang tests >> - JCK vm in progress >> >> Thank you, >> Lois > From lois.foltan at oracle.com Fri Apr 11 14:07:11 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 10:07:11 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> Message-ID: <5347F70F.5020401@oracle.com> On 4/11/2014 9:51 AM, Keith McGuigan wrote: > Hi Lois, > > Looks good, thanks for making that change! Thank you Keith for reviewing. Lois > > -- > - Keith > > > On Fri, Apr 11, 2014 at 9:04 AM, Lois Foltan > wrote: > > > Please review the updated fix, webrev at: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ > > > This includes Keith's suggestion below. All testing has been > rerun successfully. > > Thank you, > Lois > > > On 3/31/2014 3:51 PM, Lois Foltan wrote: >> >> On 3/31/2014 2:08 PM, Keith McGuigan wrote: >>> Hi Lois, >>> >>> I think that looks good. I like it much better than doing the >>> static method check in the default method processing. >>> My only suggestion is that it would be nice to encode new >>> parameter to uncached_lookup_method to be some sort of enum >>> instead of a boolean, so that it is obvious from the call-site >>> what the behavior should be (having just "false" in the >>> parameter list requires you to reference back to the declaration >>> to figure out what that "false" means). >>> >>> So instead of: >>> uncached_lookup_method(field_name, field_sig, false); >>> It'd be: >>> uncached_lookup_method(field_name, field_sig, NORMAL); or >>> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >>> >>> (or something like that -- I'm no good at names). >> >> Thank you Keith. Good suggestion. I will implement and repost >> an updated webrev for review. >> Lois >> >>> >>> -- >>> - Keith >>> >>> >>> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan >>> > wrote: >>> >>> Hi, >>> >>> Please review the following fix: >>> >>> Webrev: >>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >>> >>> >>> Bug: invokestatic: IncompatibleClassChangeError trying to >>> invoke static method from a parent in presence of >>> conflicting defaults >>> https://bugs.openjdk.java.net/browse/JDK-8033150 >>> >>> Summary of fix: >>> During default method processing, determine_target(), is >>> responsible for making decisions on whether >>> to create and add an overpass method to the current class >>> for issues that have been encountered during the walk >>> of the default methods. The routine >>> defaultMethods.cpp/has_matching_static() helped determine this >>> decision by looking within the current class for a static >>> method that should be preferred during method >>> resolution over an overpass method being created. However, >>> has_matching_static() did not continue to >>> look for a static method in current class' superclasses >>> which JDK-8033150 exposed. >>> >>> After looking at the code more closely, the has >>> _matching_static() concept is being moved out out of default >>> method processing and into method resolution processing. >>> The primary reason for this is to allow >>> default method processing to match method selection where >>> statics are and should be ignored. According >>> to JVMS, static methods should only be preferred over an >>> overpass method at method and interface >>> method resolution time. To enable method resolution to >>> potentially find a static method over an overpass >>> method, a new parameter "ignore_overpass" was added to >>> InstanceKlass::uncached_lookup_method(). >>> It has the affect of indicating to find_method_index() to >>> ignore overpass methods and continue the search >>> in case a static method of the same name and signature is >>> present in the current class or its superclasses. >>> >>> Tests: >>> - jtreg hotspot/test/*, JDK java.lang & java.util, >>> vm.quick.testlist, JCK lang & vm, defmeth tests >>> - Test will be added to the defmeth test system >>> >>> Thank you, >>> Lois >>> >>> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Fri Apr 11 14:09:54 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 10:09:54 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <5347F5FB.20309@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> <5347F5FB.20309@oracle.com> Message-ID: <5347F7B2.5030704@oracle.com> On 4/11/2014 10:02 AM, Coleen Phillimore wrote: > > This code looks good. The MethodLookupMode enum is a nice > improvement. It's a good warning of the complexity of this code. > Did something part of the build complain about MethodLookupMode not > being in vmStructs? > I'd prefer the serviceability agent not be tempted to duplicate the > method lookup code in the JVM, so not have this change. Hi Coleen, Thanks for the review. The vmStructs.cpp change was a cautionary move on my part to include the new enum MethodLookupMode. The build did not complain without it. From your comments sounds like it would be better to leave this change to vmStructs.cpp out. I can do that and run through some minor testing. Are you okay with me going forward with this change and not sending it out for another round of review? Lois > > Thanks, > Coleen > > On 4/11/14, 9:04 AM, Lois Foltan wrote: >> >> Please review the updated fix, webrev at: >> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ >> >> This includes Keith's suggestion below. All testing has been rerun >> successfully. >> >> Thank you, >> Lois >> >> >> On 3/31/2014 3:51 PM, Lois Foltan wrote: >>> >>> On 3/31/2014 2:08 PM, Keith McGuigan wrote: >>>> Hi Lois, >>>> >>>> I think that looks good. I like it much better than doing the >>>> static method check in the default method processing. >>>> My only suggestion is that it would be nice to encode new parameter >>>> to uncached_lookup_method to be some sort of enum instead of a >>>> boolean, so that it is obvious from the call-site what the behavior >>>> should be (having just "false" in the parameter list requires you >>>> to reference back to the declaration to figure out what that >>>> "false" means). >>>> >>>> So instead of: >>>> uncached_lookup_method(field_name, field_sig, false); >>>> It'd be: >>>> uncached_lookup_method(field_name, field_sig, NORMAL); or >>>> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >>>> >>>> (or something like that -- I'm no good at names). >>> >>> Thank you Keith. Good suggestion. I will implement and repost an >>> updated webrev for review. >>> Lois >>> >>>> >>>> -- >>>> - Keith >>>> >>>> >>>> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan >>>> > wrote: >>>> >>>> Hi, >>>> >>>> Please review the following fix: >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >>>> >>>> >>>> Bug: invokestatic: IncompatibleClassChangeError trying to >>>> invoke static method from a parent in presence of conflicting >>>> defaults >>>> https://bugs.openjdk.java.net/browse/JDK-8033150 >>>> >>>> Summary of fix: >>>> During default method processing, determine_target(), is >>>> responsible for making decisions on whether >>>> to create and add an overpass method to the current class for >>>> issues that have been encountered during the walk >>>> of the default methods. The routine >>>> defaultMethods.cpp/has_matching_static() helped determine this >>>> decision by looking within the current class for a static >>>> method that should be preferred during method >>>> resolution over an overpass method being created. However, >>>> has_matching_static() did not continue to >>>> look for a static method in current class' superclasses which >>>> JDK-8033150 exposed. >>>> >>>> After looking at the code more closely, the has >>>> _matching_static() concept is being moved out out of default >>>> method processing and into method resolution processing. The >>>> primary reason for this is to allow >>>> default method processing to match method selection where >>>> statics are and should be ignored. According >>>> to JVMS, static methods should only be preferred over an >>>> overpass method at method and interface >>>> method resolution time. To enable method resolution to >>>> potentially find a static method over an overpass >>>> method, a new parameter "ignore_overpass" was added to >>>> InstanceKlass::uncached_lookup_method(). >>>> It has the affect of indicating to find_method_index() to >>>> ignore overpass methods and continue the search >>>> in case a static method of the same name and signature is >>>> present in the current class or its superclasses. >>>> >>>> Tests: >>>> - jtreg hotspot/test/*, JDK java.lang & java.util, >>>> vm.quick.testlist, JCK lang & vm, defmeth tests >>>> - Test will be added to the defmeth test system >>>> >>>> Thank you, >>>> Lois >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Fri Apr 11 14:48:17 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 10:48:17 -0400 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" Message-ID: <534800B1.5060201@oracle.com> Summary: Dtrace monitoring uses size before mirror size is set. The refactoring I did for bug https://bugs.openjdk.java.net/browse/JDK-8028497 caused this bug. The size of the mirror is filled in by the InstanceMirrorKlass allocation but was used for dtrace probes before it in the normal allocation pass. Pass the allocated size to dtrace function instead. Tested by dtrace tests on solaris sparcv9, testbase vm.quick.testlist also. open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ bug link https://bugs.openjdk.java.net/browse/JDK-8039904 Thanks, Coleen From coleen.phillimore at oracle.com Fri Apr 11 14:50:27 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 10:50:27 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <5347F7B2.5030704@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> <5347F5FB.20309@oracle.com> <5347F7B2.5030704@oracle.com> Message-ID: <53480133.2060704@oracle.com> On 4/11/14, 10:09 AM, Lois Foltan wrote: > > On 4/11/2014 10:02 AM, Coleen Phillimore wrote: >> >> This code looks good. The MethodLookupMode enum is a nice >> improvement. It's a good warning of the complexity of this code. >> Did something part of the build complain about MethodLookupMode not >> being in vmStructs? >> I'd prefer the serviceability agent not be tempted to duplicate the >> method lookup code in the JVM, so not have this change. > > Hi Coleen, > > Thanks for the review. The vmStructs.cpp change was a cautionary move > on my part to include the new enum MethodLookupMode. The build did > not complain without it. From your comments sounds like it would be > better to leave this change to vmStructs.cpp out. I can do that and > run through some minor testing. Are you okay with me going forward > with this change and not sending it out for another round of review? Yes, I'm fine with the change if you revert the change to vmStructs. I don't need another round of review. If vmStructs actually needed this new type, then there'd be changes in the serviceability agent required. I'm glad that isn't the case. Thanks! Coleen > > Lois > > >> >> Thanks, >> Coleen >> >> On 4/11/14, 9:04 AM, Lois Foltan wrote: >>> >>> Please review the updated fix, webrev at: >>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ >>> >>> This includes Keith's suggestion below. All testing has been rerun >>> successfully. >>> >>> Thank you, >>> Lois >>> >>> >>> On 3/31/2014 3:51 PM, Lois Foltan wrote: >>>> >>>> On 3/31/2014 2:08 PM, Keith McGuigan wrote: >>>>> Hi Lois, >>>>> >>>>> I think that looks good. I like it much better than doing the >>>>> static method check in the default method processing. >>>>> My only suggestion is that it would be nice to encode new >>>>> parameter to uncached_lookup_method to be some sort of enum >>>>> instead of a boolean, so that it is obvious from the call-site >>>>> what the behavior should be (having just "false" in the parameter >>>>> list requires you to reference back to the declaration to figure >>>>> out what that "false" means). >>>>> >>>>> So instead of: >>>>> uncached_lookup_method(field_name, field_sig, false); >>>>> It'd be: >>>>> uncached_lookup_method(field_name, field_sig, NORMAL); or >>>>> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >>>>> >>>>> (or something like that -- I'm no good at names). >>>> >>>> Thank you Keith. Good suggestion. I will implement and repost an >>>> updated webrev for review. >>>> Lois >>>> >>>>> >>>>> -- >>>>> - Keith >>>>> >>>>> >>>>> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan >>>>> > wrote: >>>>> >>>>> Hi, >>>>> >>>>> Please review the following fix: >>>>> >>>>> Webrev: >>>>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >>>>> >>>>> >>>>> Bug: invokestatic: IncompatibleClassChangeError trying to >>>>> invoke static method from a parent in presence of conflicting >>>>> defaults >>>>> https://bugs.openjdk.java.net/browse/JDK-8033150 >>>>> >>>>> Summary of fix: >>>>> During default method processing, determine_target(), is >>>>> responsible for making decisions on whether >>>>> to create and add an overpass method to the current class for >>>>> issues that have been encountered during the walk >>>>> of the default methods. The routine >>>>> defaultMethods.cpp/has_matching_static() helped determine this >>>>> decision by looking within the current class for a static >>>>> method that should be preferred during method >>>>> resolution over an overpass method being created. However, >>>>> has_matching_static() did not continue to >>>>> look for a static method in current class' superclasses which >>>>> JDK-8033150 exposed. >>>>> >>>>> After looking at the code more closely, the has >>>>> _matching_static() concept is being moved out out of default >>>>> method processing and into method resolution processing. The >>>>> primary reason for this is to allow >>>>> default method processing to match method selection where >>>>> statics are and should be ignored. According >>>>> to JVMS, static methods should only be preferred over an >>>>> overpass method at method and interface >>>>> method resolution time. To enable method resolution to >>>>> potentially find a static method over an overpass >>>>> method, a new parameter "ignore_overpass" was added to >>>>> InstanceKlass::uncached_lookup_method(). >>>>> It has the affect of indicating to find_method_index() to >>>>> ignore overpass methods and continue the search >>>>> in case a static method of the same name and signature is >>>>> present in the current class or its superclasses. >>>>> >>>>> Tests: >>>>> - jtreg hotspot/test/*, JDK java.lang & java.util, >>>>> vm.quick.testlist, JCK lang & vm, defmeth tests >>>>> - Test will be added to the defmeth test system >>>>> >>>>> Thank you, >>>>> Lois >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kmcguigan at twitter.com Fri Apr 11 16:00:02 2014 From: kmcguigan at twitter.com (Keith McGuigan) Date: Fri, 11 Apr 2014 12:00:02 -0400 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" In-Reply-To: <534800B1.5060201@oracle.com> References: <534800B1.5060201@oracle.com> Message-ID: Looks good, but why are you not using a newer version of webrev with "next" links?? -- - Keith On Fri, Apr 11, 2014 at 10:48 AM, Coleen Phillimore < coleen.phillimore at oracle.com> wrote: > Summary: Dtrace monitoring uses size before mirror size is set. > > The refactoring I did for bug https://bugs.openjdk.java.net/ > browse/JDK-8028497 caused this bug. The size of the mirror is filled in > by the InstanceMirrorKlass allocation but was used for dtrace probes before > it in the normal allocation pass. Pass the allocated size to dtrace > function instead. > > Tested by dtrace tests on solaris sparcv9, testbase vm.quick.testlist also. > > open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ > bug link https://bugs.openjdk.java.net/browse/JDK-8039904 > > Thanks, > Coleen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Fri Apr 11 16:22:28 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 12:22:28 -0400 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" In-Reply-To: References: <534800B1.5060201@oracle.com> Message-ID: <534816C4.9070904@oracle.com> On 4/11/14, 12:00 PM, Keith McGuigan wrote: > Looks good, but why are you not using a newer version of webrev with > "next" links?? Thanks Keith. The private copy I had of the "next" link webrev that I had broke for me for some mysterious reason. I filed a bug to see if the "official" version of webrev could have "next" links instead of debugging my own. Thanks! Coleen > > -- > - Keith > > > On Fri, Apr 11, 2014 at 10:48 AM, Coleen Phillimore > > > wrote: > > Summary: Dtrace monitoring uses size before mirror size is set. > > The refactoring I did for bug > https://bugs.openjdk.java.net/browse/JDK-8028497 caused this bug. > The size of the mirror is filled in by the InstanceMirrorKlass > allocation but was used for dtrace probes before it in the normal > allocation pass. Pass the allocated size to dtrace function instead. > > Tested by dtrace tests on solaris sparcv9, testbase > vm.quick.testlist also. > > open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ > > bug link https://bugs.openjdk.java.net/browse/JDK-8039904 > > Thanks, > Coleen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.seigel at oracle.com Fri Apr 11 16:25:48 2014 From: harold.seigel at oracle.com (harold seigel) Date: Fri, 11 Apr 2014 12:25:48 -0400 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" In-Reply-To: <534816C4.9070904@oracle.com> References: <534800B1.5060201@oracle.com> <534816C4.9070904@oracle.com> Message-ID: <5348178C.4090105@oracle.com> Hi Coleen, You changes look good. Harold On 4/11/2014 12:22 PM, Coleen Phillimore wrote: > > On 4/11/14, 12:00 PM, Keith McGuigan wrote: >> Looks good, but why are you not using a newer version of webrev with >> "next" links?? > > Thanks Keith. The private copy I had of the "next" link webrev that I > had broke for me for some mysterious reason. I filed a bug to see if > the "official" version of webrev could have "next" links instead of > debugging my own. > Thanks! > Coleen > >> >> -- >> - Keith >> >> >> On Fri, Apr 11, 2014 at 10:48 AM, Coleen Phillimore >> > >> wrote: >> >> Summary: Dtrace monitoring uses size before mirror size is set. >> >> The refactoring I did for bug >> https://bugs.openjdk.java.net/browse/JDK-8028497 caused this bug. >> The size of the mirror is filled in by the InstanceMirrorKlass >> allocation but was used for dtrace probes before it in the normal >> allocation pass. Pass the allocated size to dtrace function instead. >> >> Tested by dtrace tests on solaris sparcv9, testbase >> vm.quick.testlist also. >> >> open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ >> >> bug link https://bugs.openjdk.java.net/browse/JDK-8039904 >> >> Thanks, >> Coleen >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karen.kinnear at oracle.com Fri Apr 11 16:58:18 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Fri, 11 Apr 2014 12:58:18 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <5347E84D.60304@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> Message-ID: <38577856-7CA1-41CB-9D57-73D625FBE14C@oracle.com> Lois, I like the enum change. I agree with Coleen's suggestion of leaving out the vmstructs change. I had one question - instanceKlass.cll uncached_lookup_method - would it make sense to have a local holding the mode rather than overwriting the input argument of mode? Wouldn't that be better as a const input argument? thanks, Karen On Apr 11, 2014, at 9:04 AM, Lois Foltan wrote: > > Please review the updated fix, webrev at: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ > > This includes Keith's suggestion below. All testing has been rerun successfully. > > Thank you, > Lois > > > On 3/31/2014 3:51 PM, Lois Foltan wrote: >> >> On 3/31/2014 2:08 PM, Keith McGuigan wrote: >>> Hi Lois, >>> >>> I think that looks good. I like it much better than doing the static method check in the default method processing. >>> My only suggestion is that it would be nice to encode new parameter to uncached_lookup_method to be some sort of enum instead of a boolean, so that it is obvious from the call-site what the behavior should be (having just "false" in the parameter list requires you to reference back to the declaration to figure out what that "false" means). >>> >>> So instead of: >>> uncached_lookup_method(field_name, field_sig, false); >>> It'd be: >>> uncached_lookup_method(field_name, field_sig, NORMAL); or >>> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >>> >>> (or something like that -- I'm no good at names). >> >> Thank you Keith. Good suggestion. I will implement and repost an updated webrev for review. >> Lois >> >>> >>> -- >>> - Keith >>> >>> >>> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan wrote: >>> Hi, >>> >>> Please review the following fix: >>> >>> Webrev: >>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >>> >>> Bug: invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults >>> https://bugs.openjdk.java.net/browse/JDK-8033150 >>> >>> Summary of fix: >>> During default method processing, determine_target(), is responsible for making decisions on whether >>> to create and add an overpass method to the current class for issues that have been encountered during the walk >>> of the default methods. The routine defaultMethods.cpp/has_matching_static() helped determine this >>> decision by looking within the current class for a static method that should be preferred during method >>> resolution over an overpass method being created. However, has_matching_static() did not continue to >>> look for a static method in current class' superclasses which JDK-8033150 exposed. >>> >>> After looking at the code more closely, the has _matching_static() concept is being moved out out of default >>> method processing and into method resolution processing. The primary reason for this is to allow >>> default method processing to match method selection where statics are and should be ignored. According >>> to JVMS, static methods should only be preferred over an overpass method at method and interface >>> method resolution time. To enable method resolution to potentially find a static method over an overpass >>> method, a new parameter "ignore_overpass" was added to InstanceKlass::uncached_lookup_method(). >>> It has the affect of indicating to find_method_index() to ignore overpass methods and continue the search >>> in case a static method of the same name and signature is present in the current class or its superclasses. >>> >>> Tests: >>> - jtreg hotspot/test/*, JDK java.lang & java.util, vm.quick.testlist, JCK lang & vm, defmeth tests >>> - Test will be added to the defmeth test system >>> >>> Thank you, >>> Lois >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Fri Apr 11 19:38:36 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 15:38:36 -0400 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" In-Reply-To: <5348178C.4090105@oracle.com> References: <534800B1.5060201@oracle.com> <534816C4.9070904@oracle.com> <5348178C.4090105@oracle.com> Message-ID: <534844BC.4050300@oracle.com> Thanks Harold. Coleen On 4/11/14, 12:25 PM, harold seigel wrote: > Hi Coleen, > > You changes look good. > > Harold > > On 4/11/2014 12:22 PM, Coleen Phillimore wrote: >> >> On 4/11/14, 12:00 PM, Keith McGuigan wrote: >>> Looks good, but why are you not using a newer version of webrev with >>> "next" links?? >> >> Thanks Keith. The private copy I had of the "next" link webrev that >> I had broke for me for some mysterious reason. I filed a bug to see >> if the "official" version of webrev could have "next" links instead >> of debugging my own. >> Thanks! >> Coleen >> >>> >>> -- >>> - Keith >>> >>> >>> On Fri, Apr 11, 2014 at 10:48 AM, Coleen Phillimore >>> > >>> wrote: >>> >>> Summary: Dtrace monitoring uses size before mirror size is set. >>> >>> The refactoring I did for bug >>> https://bugs.openjdk.java.net/browse/JDK-8028497 caused this >>> bug. The size of the mirror is filled in by the >>> InstanceMirrorKlass allocation but was used for dtrace probes >>> before it in the normal allocation pass. Pass the allocated >>> size to dtrace function instead. >>> >>> Tested by dtrace tests on solaris sparcv9, testbase >>> vm.quick.testlist also. >>> >>> open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ >>> >>> bug link https://bugs.openjdk.java.net/browse/JDK-8039904 >>> >>> Thanks, >>> Coleen >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.spitsyn at oracle.com Fri Apr 11 19:49:18 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Fri, 11 Apr 2014 12:49:18 -0700 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" In-Reply-To: <534800B1.5060201@oracle.com> References: <534800B1.5060201@oracle.com> Message-ID: <5348473E.3070701@oracle.com> The fix looks good. Thanks, Serguei On 4/11/14 7:48 AM, Coleen Phillimore wrote: > Summary: Dtrace monitoring uses size before mirror size is set. > > The refactoring I did for bug > https://bugs.openjdk.java.net/browse/JDK-8028497 caused this bug. The > size of the mirror is filled in by the InstanceMirrorKlass allocation > but was used for dtrace probes before it in the normal allocation > pass. Pass the allocated size to dtrace function instead. > > Tested by dtrace tests on solaris sparcv9, testbase vm.quick.testlist > also. > > open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ > bug link https://bugs.openjdk.java.net/browse/JDK-8039904 > > Thanks, > Coleen From lois.foltan at oracle.com Fri Apr 11 20:08:23 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Apr 2014 16:08:23 -0400 Subject: RFR (M) JDK-8033150 (#2): invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <38577856-7CA1-41CB-9D57-73D625FBE14C@oracle.com> References: <5339A511.7000202@oracle.com> <5339C72A.8040405@oracle.com> <5347E84D.60304@oracle.com> <38577856-7CA1-41CB-9D57-73D625FBE14C@oracle.com> Message-ID: <53484BB7.4090305@oracle.com> On 4/11/2014 12:58 PM, Karen Kinnear wrote: > Lois, > > I like the enum change. I agree with Coleen's suggestion of leaving > out the vmstructs change. > > I had one question - instanceKlass.cll uncached_lookup_method - > would it make sense to have a local holding the mode rather than > overwriting the input argument of > mode? Wouldn't that be better as a const input argument? Hi Karen, Thanks for the review! Glad the enum change seems to be well liked. I have completed removing the vmStructs change. I have also taken your suggestion and implemented a local variable within InstanceKlass::uncached_lookup_method() to contain the incoming MethodLookupMode parameter. So far my sanity testing on these minor changes is going well. In case anyone wants to view the updated webrev, it is at http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.2/ Lois > > thanks, > Karen > > On Apr 11, 2014, at 9:04 AM, Lois Foltan wrote: > >> >> Please review the updated fix, webrev at: >> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150.1/ >> >> This includes Keith's suggestion below. All testing has been rerun >> successfully. >> >> Thank you, >> Lois >> >> >> On 3/31/2014 3:51 PM, Lois Foltan wrote: >>> >>> On 3/31/2014 2:08 PM, Keith McGuigan wrote: >>>> Hi Lois, >>>> >>>> I think that looks good. I like it much better than doing the >>>> static method check in the default method processing. >>>> My only suggestion is that it would be nice to encode new parameter >>>> to uncached_lookup_method to be some sort of enum instead of a >>>> boolean, so that it is obvious from the call-site what the behavior >>>> should be (having just "false" in the parameter list requires you >>>> to reference back to the declaration to figure out what that >>>> "false" means). >>>> >>>> So instead of: >>>> uncached_lookup_method(field_name, field_sig, false); >>>> It'd be: >>>> uncached_lookup_method(field_name, field_sig, NORMAL); or >>>> uncached_lookup_method(field_name, field_sig, IGNORE_OVERPASS); >>>> >>>> (or something like that -- I'm no good at names). >>> >>> Thank you Keith. Good suggestion. I will implement and repost an >>> updated webrev for review. >>> Lois >>> >>>> >>>> -- >>>> - Keith >>>> >>>> >>>> On Mon, Mar 31, 2014 at 1:25 PM, Lois Foltan >>>> > wrote: >>>> >>>> Hi, >>>> >>>> Please review the following fix: >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150/ >>>> >>>> >>>> Bug: invokestatic: IncompatibleClassChangeError trying to >>>> invoke static method from a parent in presence of conflicting >>>> defaults >>>> https://bugs.openjdk.java.net/browse/JDK-8033150 >>>> >>>> Summary of fix: >>>> During default method processing, determine_target(), is >>>> responsible for making decisions on whether >>>> to create and add an overpass method to the current class for >>>> issues that have been encountered during the walk >>>> of the default methods. The routine >>>> defaultMethods.cpp/has_matching_static() helped determine this >>>> decision by looking within the current class for a static >>>> method that should be preferred during method >>>> resolution over an overpass method being created. However, >>>> has_matching_static() did not continue to >>>> look for a static method in current class' superclasses which >>>> JDK-8033150 exposed. >>>> >>>> After looking at the code more closely, the has >>>> _matching_static() concept is being moved out out of default >>>> method processing and into method resolution processing. The >>>> primary reason for this is to allow >>>> default method processing to match method selection where >>>> statics are and should be ignored. According >>>> to JVMS, static methods should only be preferred over an >>>> overpass method at method and interface >>>> method resolution time. To enable method resolution to >>>> potentially find a static method over an overpass >>>> method, a new parameter "ignore_overpass" was added to >>>> InstanceKlass::uncached_lookup_method(). >>>> It has the affect of indicating to find_method_index() to >>>> ignore overpass methods and continue the search >>>> in case a static method of the same name and signature is >>>> present in the current class or its superclasses. >>>> >>>> Tests: >>>> - jtreg hotspot/test/*, JDK java.lang & java.util, >>>> vm.quick.testlist, JCK lang & vm, defmeth tests >>>> - Test will be added to the defmeth test system >>>> >>>> Thank you, >>>> Lois >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Fri Apr 11 20:42:42 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Apr 2014 16:42:42 -0400 Subject: RFR (S) 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" In-Reply-To: <5348473E.3070701@oracle.com> References: <534800B1.5060201@oracle.com> <5348473E.3070701@oracle.com> Message-ID: <534853C2.60007@oracle.com> Thank you Serguei. Coleen On 4/11/14, 3:49 PM, serguei.spitsyn at oracle.com wrote: > The fix looks good. > > Thanks, > Serguei > > On 4/11/14 7:48 AM, Coleen Phillimore wrote: >> Summary: Dtrace monitoring uses size before mirror size is set. >> >> The refactoring I did for bug >> https://bugs.openjdk.java.net/browse/JDK-8028497 caused this bug. The >> size of the mirror is filled in by the InstanceMirrorKlass allocation >> but was used for dtrace probes before it in the normal allocation >> pass. Pass the allocated size to dtrace function instead. >> >> Tested by dtrace tests on solaris sparcv9, testbase vm.quick.testlist >> also. >> >> open webrev at http://cr.openjdk.java.net/~coleenp/8039904/ >> bug link https://bugs.openjdk.java.net/browse/JDK-8039904 >> >> Thanks, >> Coleen > From mandy.chung at oracle.com Sun Apr 13 02:48:42 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Sat, 12 Apr 2014 19:48:42 -0700 Subject: Any native library calling JNI_FindClass from JNI_OnUnload? Message-ID: <5349FB0A.6020204@oracle.com> Does anyone know of a native library whose JNI_OnUnload calls JNI_FindClass? I'm wondering how much existing code out there depends on the existing behavior that is unsupported. During the investigation of JDK-4240589, I found that the implementation JNI_FindClass has a special handling that calls ClassLoader.NativeLibrary.getFromClass method to determine if JNI_FindClass is being called by JNI_OnLoad and JNI_OnUnload directly or indirectly. This special handling makes sense for JNI_OnLoad, i.e. when the native library is loaded, that may call JNI_FindClass. I don't think this should apply to JNI_OnUnload. When a native library is being unloaded, it means that the ClassLoader has become unreachable and GC'ed. When JNI_OnUnloader, there is no guarantee that the class loader still exists for doing any class loading. The JNI spec of JNI_OnUnload [1] also makes it clear: The VM calls JNI_OnUnload when the class loader containing the native library is garbage collected. This function can be used to perform cleanup operations. Because this function is called in an unknown context (such as from a finalizer), the programmer should be conservative on using Java VM services, and refrain from arbitrary Java call-backs. A little more background about this: The current ClassLoader uses finalizer to clean up and unload the native library, if any. I'm considering to replace the finalizer with phantom reference which is generally a good change and discover this VM/JNI/libs dependency. Any data would be appreciated. Mandy [1] http://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html#JNI_OnUnload From rednaxelafx at gmail.com Mon Apr 14 01:53:56 2014 From: rednaxelafx at gmail.com (Krystal Mok) Date: Sun, 13 Apr 2014 18:53:56 -0700 Subject: Unable to start VM with JDK8 on Linux/x64 In-Reply-To: References: <53467FBF.4040501@oracle.com> Message-ID: Hi Stefan, Unfortunately, overcommit_memory=2 isn't the cause. The original bug reporter ran the test again in a 3GB virtual machine [1], and saw: $ cat /proc/sys/vm/overcommit_memory 0 $ cat /proc/sys/vm/overcommit_ratio 50 $ ~/jdk1.8.0/bin/java Error occurred during initialization of VM Could not allocate metaspace: 1073741824 bytes - Kris [1]: http://hllvm.group.iteye.com/group/topic/39890?page=2#post-260951 On Thu, Apr 10, 2014 at 12:54 PM, Krystal Mok wrote: > Hi Stefan, > > Thank you for your explanation. The overcommit_memory=2 theory looks > reasonable. > Let me pass it back to the original discussion thread and see if that's > the case. > > Anyway, it'd still be nice if Java could start in a more graceful way. > > Thanks, > Kris > > > On Thu, Apr 10, 2014 at 4:25 AM, Stefan Karlsson < > stefan.karlsson at oracle.com> wrote: > >> >> On 2014-04-10 11:29, Krystal Mok wrote: >> >>> Hi HotSpot runtime team, >>> >>> I'd like to report a bug on behave of someone from a discussion thread >>> [1] from the HLLVM forum that I run. >>> >>> This is the symptom he reported: >>> >>> $ uname -a >>> Linux IS-CDSM-166 2.6.32.61-cds-64 #1 SMP PREEMPT Tue Feb 25 20:23:18 >>> PST 2014 x86_64 x86_64 x86_64 GNU/Linux >>> >>> $ java -version >>> Error occurred during initialization of VM >>> Could not allocate metaspace: 1073741824 bytes >>> >>> $ java -XX:MaxMetaspaceSize=1m -XX:MetaspaceSize=1m -version >>> Error occurred during initialization of VM >>> Could not allocate metaspace: 1073741824 bytes >>> >>> Apparently the error message says it's trying to allocate a 1GB >>> metaspace, but failed. This seems to be related to JDK-8003424: Enable >>> Class Data Sharing for CompressedOops [2]. >>> >>> He further tested working around with -XX:-UseCompressedClassPointers, >>> and it worked: >>> >>> # java -XX:ClassMetaspaceSize=512m -version >>> Unrecognized VM option 'ClassMetaspaceSize=512m' >>> Did you mean 'MetaspaceSize='? >>> Error: Could not create the Java Virtual Machine. >>> Error: A fatal exception has occurred. Program will exit. >>> >> >> The correct flag to use is: -XX:CompressedClassSpaceSize=512m >> >> >> >>> $ java -XX:-UseCompressedClassPointers -version >>> java version "1.8.0" >>> Java(TM) SE Runtime Environment (build 1.8.0-b132) >>> Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) >>> >>> The tests above were run in a virtual machine with 3GB of memory. >>> When he bumped up the memory for his virtual machine to 8GB, the VM is >>> able to start without the workaround. >>> >>> Has this behavior been seen before? >>> >> >> I think you'll see this behavior if overcommit_memory is set to 2. >> >> $ man 5 proc >> --- >> /proc/sys/vm/overcommit_memory >> This file contains the kernel virtual memory accounting >> mode. Values are: >> >> 0: heuristic overcommit (this is the default) >> 1: always overcommit, never check >> 2: always check, never overcommit >> >> In mode 0, calls of mmap(2) with MAP_NORESERVE are not >> checked, and the default check is very weak, leading to the risk of getting >> a process "OOM-killed". Under Linux 2.4 any nonzero value implies mode 1. >> In mode 2 >> (available since Linux 2.6), the total virtual address >> space on the system is limited to (SS + RAM*(r/100)), where SS is the size >> of the swap space, and RAM is the size of the physical memory, and r is the >> contents of >> the file /proc/sys/vm/overcommit_ratio. >> --- >> >> Could this be the reason why we fail to reserve the 1 GB large >> compressed class space? >> >> StefanK >> >> >> >>> Best regards, >>> Kris >>> >>> [1]: http://hllvm.group.iteye.com/group/topic/39890 >>> [2]: https://bugs.openjdk.java.net/browse/JDK-8003424 >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Mon Apr 14 04:26:20 2014 From: david.holmes at oracle.com (David Holmes) Date: Mon, 14 Apr 2014 14:26:20 +1000 Subject: 8u Trivial RFR: 8039891: Remove ppcsflt builds from JPRT Message-ID: <534B636C.2020309@oracle.com> This is the 8u version. It is different to the 9 version as the jprt.properties file differs from release to release. http://cr.openjdk.java.net/~dholmes/8039891/webrev.8u/ Pushing to jdk8u/hs-dev/hotspot Thanks, David From stefan.karlsson at oracle.com Mon Apr 14 06:37:43 2014 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Mon, 14 Apr 2014 08:37:43 +0200 Subject: Unable to start VM with JDK8 on Linux/x64 In-Reply-To: References: <53467FBF.4040501@oracle.com> Message-ID: <534B8237.2040404@oracle.com> Hi Kris, On 2014-04-14 03:53, Krystal Mok wrote: > Hi Stefan, > > Unfortunately, overcommit_memory=2 isn't the cause. The original bug > reporter ran the test again in a 3GB virtual machine [1], and saw: > > $ cat /proc/sys/vm/overcommit_memory > 0 > $ cat /proc/sys/vm/overcommit_ratio > 50 > $ ~/jdk1.8.0/bin/java > Error occurred during initialization of VM > Could not allocate metaspace: 1073741824 bytes Then I don't know. Maybe the virtualization layer prevents the overcommit? StefanK > > - Kris > > [1]: http://hllvm.group.iteye.com/group/topic/39890?page=2#post-260951 > > > On Thu, Apr 10, 2014 at 12:54 PM, Krystal Mok > wrote: > > Hi Stefan, > > Thank you for your explanation. The overcommit_memory=2 theory > looks reasonable. > Let me pass it back to the original discussion thread and see if > that's the case. > > Anyway, it'd still be nice if Java could start in a more graceful way. > > Thanks, > Kris > > > On Thu, Apr 10, 2014 at 4:25 AM, Stefan Karlsson > > > wrote: > > > On 2014-04-10 11:29, Krystal Mok wrote: > > Hi HotSpot runtime team, > > I'd like to report a bug on behave of someone from a > discussion thread [1] from the HLLVM forum that I run. > > This is the symptom he reported: > > $ uname -a > Linux IS-CDSM-166 2.6.32.61-cds-64 #1 SMP PREEMPT Tue Feb > 25 20:23:18 PST 2014 x86_64 x86_64 x86_64 GNU/Linux > > $ java -version > Error occurred during initialization of VM > Could not allocate metaspace: 1073741824 bytes > > $ java -XX:MaxMetaspaceSize=1m -XX:MetaspaceSize=1m -version > Error occurred during initialization of VM > Could not allocate metaspace: 1073741824 bytes > > Apparently the error message says it's trying to allocate > a 1GB metaspace, but failed. This seems to be related to > JDK-8003424: Enable Class Data Sharing for CompressedOops [2]. > > He further tested working around with > -XX:-UseCompressedClassPointers, and it worked: > > # java -XX:ClassMetaspaceSize=512m -version > Unrecognized VM option 'ClassMetaspaceSize=512m' > Did you mean 'MetaspaceSize='? > Error: Could not create the Java Virtual Machine. > Error: A fatal exception has occurred. Program will exit. > > > The correct flag to use is: -XX:CompressedClassSpaceSize=512m > > > > $ java -XX:-UseCompressedClassPointers -version > java version "1.8.0" > Java(TM) SE Runtime Environment (build 1.8.0-b132) > Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) > > The tests above were run in a virtual machine with 3GB of > memory. > When he bumped up the memory for his virtual machine to > 8GB, the VM is able to start without the workaround. > > Has this behavior been seen before? > > > I think you'll see this behavior if overcommit_memory is set to 2. > > $ man 5 proc > --- > /proc/sys/vm/overcommit_memory > This file contains the kernel virtual memory > accounting mode. Values are: > > 0: heuristic overcommit (this is the default) > 1: always overcommit, never check > 2: always check, never overcommit > > In mode 0, calls of mmap(2) with MAP_NORESERVE > are not checked, and the default check is very weak, leading > to the risk of getting a process "OOM-killed". Under Linux > 2.4 any nonzero value implies mode 1. In mode 2 > (available since Linux 2.6), the total virtual > address space on the system is limited to (SS + RAM*(r/100)), > where SS is the size of the swap space, and RAM is the size of > the physical memory, and r is the contents of > the file /proc/sys/vm/overcommit_ratio. > --- > > Could this be the reason why we fail to reserve the 1 GB > large compressed class space? > > StefanK > > > > Best regards, > Kris > > [1]: http://hllvm.group.iteye.com/group/topic/39890 > [2]: https://bugs.openjdk.java.net/browse/JDK-8003424 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikael.gerdin at oracle.com Mon Apr 14 06:50:55 2014 From: mikael.gerdin at oracle.com (Mikael Gerdin) Date: Mon, 14 Apr 2014 08:50:55 +0200 Subject: Unable to start VM with JDK8 on Linux/x64 In-Reply-To: References: Message-ID: <1665594.Oe3DkkAfJh@mgerdin03> Kris, On Sunday 13 April 2014 18.53.56 Krystal Mok wrote: > Hi Stefan, > > Unfortunately, overcommit_memory=2 isn't the cause. The original bug > reporter ran the test again in a 3GB virtual machine [1], and saw: > > $ cat /proc/sys/vm/overcommit_memory > 0 > $ cat /proc/sys/vm/overcommit_ratio > 50 > $ ~/jdk1.8.0/bin/java > Error occurred during initialization of VM > Could not allocate metaspace: 1073741824 bytes Is there a virtual memory ulimit set? (ulimit -v) What heap sizing command line flags are set? There is (AFAIK) nothing special with the way we reserve memory for the compressed class space compared to how we reserve memory for the main Java heap. Running with -XX:-UseCompressedClassPointers and increasing the maximum heap size with 1G should give the same problems I think. /Mikael > > - Kris > > [1]: http://hllvm.group.iteye.com/group/topic/39890?page=2#post-260951 > > On Thu, Apr 10, 2014 at 12:54 PM, Krystal Mok wrote: > > Hi Stefan, > > > > Thank you for your explanation. The overcommit_memory=2 theory looks > > reasonable. > > Let me pass it back to the original discussion thread and see if that's > > the case. > > > > Anyway, it'd still be nice if Java could start in a more graceful way. > > > > Thanks, > > Kris > > > > > > On Thu, Apr 10, 2014 at 4:25 AM, Stefan Karlsson < > > > > stefan.karlsson at oracle.com> wrote: > >> On 2014-04-10 11:29, Krystal Mok wrote: > >>> Hi HotSpot runtime team, > >>> > >>> I'd like to report a bug on behave of someone from a discussion thread > >>> [1] from the HLLVM forum that I run. > >>> > >>> This is the symptom he reported: > >>> > >>> $ uname -a > >>> Linux IS-CDSM-166 2.6.32.61-cds-64 #1 SMP PREEMPT Tue Feb 25 20:23:18 > >>> PST 2014 x86_64 x86_64 x86_64 GNU/Linux > >>> > >>> $ java -version > >>> Error occurred during initialization of VM > >>> Could not allocate metaspace: 1073741824 bytes > >>> > >>> $ java -XX:MaxMetaspaceSize=1m -XX:MetaspaceSize=1m -version > >>> Error occurred during initialization of VM > >>> Could not allocate metaspace: 1073741824 bytes > >>> > >>> Apparently the error message says it's trying to allocate a 1GB > >>> metaspace, but failed. This seems to be related to JDK-8003424: Enable > >>> Class Data Sharing for CompressedOops [2]. > >>> > >>> He further tested working around with -XX:-UseCompressedClassPointers, > >>> and it worked: > >>> > >>> # java -XX:ClassMetaspaceSize=512m -version > >>> Unrecognized VM option 'ClassMetaspaceSize=512m' > >>> Did you mean 'MetaspaceSize='? > >>> Error: Could not create the Java Virtual Machine. > >>> Error: A fatal exception has occurred. Program will exit. > >> > >> The correct flag to use is: -XX:CompressedClassSpaceSize=512m > >> > >>> $ java -XX:-UseCompressedClassPointers -version > >>> java version "1.8.0" > >>> Java(TM) SE Runtime Environment (build 1.8.0-b132) > >>> Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) > >>> > >>> The tests above were run in a virtual machine with 3GB of memory. > >>> When he bumped up the memory for his virtual machine to 8GB, the VM is > >>> able to start without the workaround. > >>> > >>> Has this behavior been seen before? > >> > >> I think you'll see this behavior if overcommit_memory is set to 2. > >> > >> $ man 5 proc > >> --- > >> > >> /proc/sys/vm/overcommit_memory > >> > >> This file contains the kernel virtual memory accounting > >> > >> mode. Values are: > >> 0: heuristic overcommit (this is the default) > >> 1: always overcommit, never check > >> 2: always check, never overcommit > >> > >> In mode 0, calls of mmap(2) with MAP_NORESERVE are not > >> > >> checked, and the default check is very weak, leading to the risk of > >> getting > >> a process "OOM-killed". Under Linux 2.4 any nonzero value implies mode > >> 1. > >> > >> In mode 2 > >> > >> (available since Linux 2.6), the total virtual address > >> > >> space on the system is limited to (SS + RAM*(r/100)), where SS is the > >> size > >> of the swap space, and RAM is the size of the physical memory, and r is > >> the > >> contents of > >> > >> the file /proc/sys/vm/overcommit_ratio. > >> > >> --- > >> > >> Could this be the reason why we fail to reserve the 1 GB large > >> compressed class space? > >> > >> StefanK > >> > >>> Best regards, > >>> Kris > >>> > >>> [1]: http://hllvm.group.iteye.com/group/topic/39890 > >>> [2]: https://bugs.openjdk.java.net/browse/JDK-8003424 From markus.gronlund at oracle.com Mon Apr 14 08:42:47 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Mon, 14 Apr 2014 01:42:47 -0700 (PDT) Subject: RFR(S): 8039458: Ensure consistency of Monitor/Mutex lock acquisitions in relation to safepoint protocol In-Reply-To: <53466BAA.4060809@oracle.com> References: <53466BAA.4060809@oracle.com> Message-ID: <2c051ef3-4340-4e44-a48d-95e86d27020f@default> Many thanks for taking a look David. I will add another accessor which will allow for some easier read: ... + if (acquired_with_safepoint_check()) { + if (locks->acquired_with_no_safepoint_check()) { ... I will also ensure to get some larger scale testing for detecting any existing potentially broken behaviour. Thanks again Markus -----Original Message----- From: David Holmes Sent: den 10 april 2014 12:00 To: Markus Gr?nlund; hotspot-runtime-dev; serviceability-dev at openjdk.net; hotspot-compiler-dev at openjdk.java.net; hotspot-gc-dev at openjdk.java.net Subject: Re: RFR(S): 8039458: Ensure consistency of Monitor/Mutex lock acquisitions in relation to safepoint protocol Hi Markus, Not sure about the need to set _acquired_with_no_safepoint_check = false in unlock, but otherwise this looks okay to me. You only need to check the most recently acquired lock, because when you acquired it you would have checked the previously acquired lock and so forth. The double negation, !_acquired_with_no_safepoint_check, does make this a little hard to think about. :) I think you may need some additional test coverage to see if this is going to expose existing potentially broken behaviour. Thanks, David On 9/04/2014 10:04 PM, Markus Gr?nlund wrote: > Greetings, > > Kindly asking for reviews for the following bug fix/enhancement > > Webrev: http://cr.openjdk.java.net/~mgronlun/8039458/webrev01/ > > Bug: https://bugs.openjdk.java.net/browse/JDK-8039458 > > Problem: > > VM code acquire Monitor/Mutex locks by respecting the correct lock > order, which is enforced in debug builds (asserts). This is great. > > However, you could be taking locks in the correct order and everything > might work just fine during development and testing (even product) but > depending on runtime circumstances (load/concurrency), the way the > lock(s) was acquired, i.e. the lock acquisition /mode/, can lead to > very hard to debug problems (hangs/deadlocks). This is primarily > related to the lock acquisition mode option > "Mutex::_no_safepoint_check_flag" by which you inform your intent to > respect or not-respect the safepoint protocol during lock acquisition/ownership. > > > If a lock has already been acquired by a thread by passing the > Mutex::_no_safepoint_check_flag to circumvent the safepoint protocol, > the thread must *not* be allowed to attempt taking yet another lock on > which it *might* block ( a lock which was not acquired by passing > Mutex::_no_safepoint_check_flag in its acquisition operation), as such > a lock would be participating in the safepoint protocol. > > Today, doing this mistake will work just fine _/if the lock is > currently uncontended_ /which it normally is in development/testing > situations*.* However, once the lock then becomes contended (highly > volatile pressured/concurrent product deployment) you might get the > worst kind of issues to debug (hangs/deadlocks). > > Naturally and as always, you have to very careful when you are taking > locks using the Mutex::_no_safepoint_check_flag -however it can be > very hard to determine what other code you can safely call once you > are the owner of a Mutex::_no_safepoint_check_flag:ed lock - and > today there is nothing but the developers attention to details that > will find/help stay clear of this. I think we can do better here in > enforcing some invariants in code for preempting potential deadlock prone situations. > > Description: > > Add debug assertions that enforce correct usages of the > Mutex::_no_safepoint_check_flag when taking multiple locks. > > > This suggestion leverages much of the existing code targeting > enforcement of lock ordering- this is a simple additive change to also > add invariant checking on "lock acquisition mode". > > Do note this primarily targets Java Threads running in the VM. > > Also included code comment: > > /* > * Ensure consistency of Monitor/Mutex lock acquisitions > * for Java Threads running inside the VM. > * > * If a thread has already acquired lock(s) using > * "Mutex::_no_safepoint_check_flag" (effectively going outside the > * safepoint protocol), the thread should be disallowed to acquire any > * additional lock which _is_ participating in the safepoint protocol. > * > * If a "safepoint protocol aware" lock is contended, and the thread > entering > * is unable to "fast acquire" the lock using cas/try_spin, > * it will need to block/park. Blocking on a contended lock involves a > * state transition and a potential SafepointSynchronize::block() call. > * Transitioning to a blocked state still holding > "Mutex::_no_safepoint_check_flag" > * acquired locks is allowed, but is *very* deadlock prone. > * > * The effect of allowing this state to happen without checking is subtle > * and hard to debug since a problem might only appear under heavy > load and > * only in situations with increased concurrency levels (product builds). > * > */ > > Testing: > > Artificial code changes to MutexLocker and > Mutex::_no_safepoint_check_flag on certain locks for detecting > potential deadlock situations. > > Speccjbb2005 > > Kitchensink > > Thank you > > Markus > From aph at redhat.com Mon Apr 14 08:38:35 2014 From: aph at redhat.com (Andrew Haley) Date: Mon, 14 Apr 2014 09:38:35 +0100 Subject: Unable to start VM with JDK8 on Linux/x64 In-Reply-To: <534B8237.2040404@oracle.com> References: <53467FBF.4040501@oracle.com> <534B8237.2040404@oracle.com> Message-ID: <534B9E8B.5020100@redhat.com> Hi, On 04/14/2014 07:37 AM, Stefan Karlsson wrote: > On 2014-04-14 03:53, Krystal Mok wrote: >> Hi Stefan, >> >> Unfortunately, overcommit_memory=2 isn't the cause. The original bug >> reporter ran the test again in a 3GB virtual machine [1], and saw: >> >> $ cat /proc/sys/vm/overcommit_memory >> 0 >> $ cat /proc/sys/vm/overcommit_ratio >> 50 >> $ ~/jdk1.8.0/bin/java >> Error occurred during initialization of VM >> Could not allocate metaspace: 1073741824 bytes > > Then I don't know. Maybe the virtualization layer prevents the overcommit? That is certainly possible. I know for certain that some virtualization layers effectively disable overcommit. Andrew. From staffan.larsen at oracle.com Mon Apr 14 14:55:20 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Mon, 14 Apr 2014 16:55:20 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X Message-ID: The current implementation of System.nanoTime() on OS X uses gettimeofday() which has only microsecond precision and no guarantees on being monotonic. The proposal is to use the system call mach_absolute_time() instead of gettimeofday() and to add safeguard to guarantee that the time is monotonic (similar to what we already have on solaris). mach_absolute_time() is essentially a direct call to RDTSC, but with conversion factor to offset for any system sleeps and frequency changes. The call returns something that can be converted to nanoseconds using information from mach_timebase_info(). Calls to mach_absolute_time() do not enter the kernel and are very fast. The resulting time has nanosecond precision and as good accuracy as one can get. Since the value from RDTSC can be subject to drifting between CPUs, we implement safeguards for this to make sure we never return a lower value than the previous values. This adds some overhead to nanoTime() but guards us against possible bugs in the OS. For users who are willing to trust the OS and need the fastest possible calls to System.nanoTime(), we add a flag to disable this safeguard: -XX:+AssumeMonotonicOSTimers. This change also adds support for AssumeMonotonicOSTimers to the solaris code (see JDK-6864866) and removes the use of Atmoic::load() for a 64-bit value which was necessary on 32-bit platforms (which we don?t support any longer). This change has been proposed earlier at: http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-May/009496.html webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ bug: https://bugs.openjdk.java.net/browse/JDK-8040140 Thanks, /Staffan From serguei.spitsyn at oracle.com Mon Apr 14 18:38:55 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Mon, 14 Apr 2014 11:38:55 -0700 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: Message-ID: <534C2B3F.3020806@oracle.com> * * *src/os/bsd/vm/os_bsd.cpp* In the comments at 1032-1043: 1. Would it be better to consistently name vars as obsv/prev, not obs/prv ? I had no problem to understand comments however my mind tries to associate 'obs' with 'obsolete'. 2. The linkhttp://blogs.sun.com/dave/entry/cas_and_cache_trivia_invalidate is resolved to https://blogs.oracle.com/ which is not very useful. || Thanks, Serguei On 4/14/14 7:55 AM, Staffan Larsen wrote: > The current implementation of System.nanoTime() on OS X uses gettimeofday() which has only microsecond precision and no guarantees on being monotonic. > > The proposal is to use the system call mach_absolute_time() instead of gettimeofday() and to add safeguard to guarantee that the time is monotonic (similar to what we already have on solaris). > > mach_absolute_time() is essentially a direct call to RDTSC, but with conversion factor to offset for any system sleeps and frequency changes. The call returns something that can be converted to nanoseconds using information from mach_timebase_info(). Calls to mach_absolute_time() do not enter the kernel and are very fast. The resulting time has nanosecond precision and as good accuracy as one can get. > > Since the value from RDTSC can be subject to drifting between CPUs, we implement safeguards for this to make sure we never return a lower value than the previous values. This adds some overhead to nanoTime() but guards us against possible bugs in the OS. For users who are willing to trust the OS and need the fastest possible calls to System.nanoTime(), we add a flag to disable this safeguard: -XX:+AssumeMonotonicOSTimers. > > This change also adds support for AssumeMonotonicOSTimers to the solaris code (see JDK-6864866) and removes the use of Atmoic::load() for a 64-bit value which was necessary on 32-bit platforms (which we don?t support any longer). > > This change has been proposed earlier at: http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-May/009496.html > > webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ > bug: https://bugs.openjdk.java.net/browse/JDK-8040140 > > Thanks, > /Staffan -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.spitsyn at oracle.com Mon Apr 14 18:45:15 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Mon, 14 Apr 2014 11:45:15 -0700 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534C2B3F.3020806@oracle.com> References: <534C2B3F.3020806@oracle.com> Message-ID: <534C2CBB.9010202@oracle.com> Sorry, forgot to tell that the fix is good. :) Thanks, Serguei On 4/14/14 11:38 AM, serguei.spitsyn at oracle.com wrote: > > *src/os/bsd/vm/os_bsd.cpp* > > In the comments at 1032-1043: > > 1. Would it be better to consistently name vars as obsv/prev, not obs/prv ? > I had no problem to understand comments however my mind tries to associate 'obs' with 'obsolete'. > > 2. The linkhttp://blogs.sun.com/dave/entry/cas_and_cache_trivia_invalidate > is resolved tohttps://blogs.oracle.com/ which is not very useful. > > || > Thanks, > Serguei > > > On 4/14/14 7:55 AM, Staffan Larsen wrote: >> The current implementation of System.nanoTime() on OS X uses gettimeofday() which has only microsecond precision and no guarantees on being monotonic. >> >> The proposal is to use the system call mach_absolute_time() instead of gettimeofday() and to add safeguard to guarantee that the time is monotonic (similar to what we already have on solaris). >> >> mach_absolute_time() is essentially a direct call to RDTSC, but with conversion factor to offset for any system sleeps and frequency changes. The call returns something that can be converted to nanoseconds using information from mach_timebase_info(). Calls to mach_absolute_time() do not enter the kernel and are very fast. The resulting time has nanosecond precision and as good accuracy as one can get. >> >> Since the value from RDTSC can be subject to drifting between CPUs, we implement safeguards for this to make sure we never return a lower value than the previous values. This adds some overhead to nanoTime() but guards us against possible bugs in the OS. For users who are willing to trust the OS and need the fastest possible calls to System.nanoTime(), we add a flag to disable this safeguard: -XX:+AssumeMonotonicOSTimers. >> >> This change also adds support for AssumeMonotonicOSTimers to the solaris code (see JDK-6864866) and removes the use of Atmoic::load() for a 64-bit value which was necessary on 32-bit platforms (which we don?t support any longer). >> >> This change has been proposed earlier at:http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-May/009496.html >> >> webrev:http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >> bug:https://bugs.openjdk.java.net/browse/JDK-8040140 >> >> Thanks, >> /Staffan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksey.shipilev at oracle.com Mon Apr 14 19:08:46 2014 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 14 Apr 2014 23:08:46 +0400 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: Message-ID: <534C323E.2040809@oracle.com> On 04/14/2014 06:55 PM, Staffan Larsen wrote: > mach_absolute_time() is essentially a direct call to RDTSC, but with > conversion factor to offset for any system sleeps and frequency > changes. The call returns something that can be converted to > nanoseconds using information from mach_timebase_info(). Calls to > mach_absolute_time() do not enter the kernel and are very fast. The > resulting time has nanosecond precision and as good accuracy as one > can get. Some numbers would be good on the public list :) I know the numbers already, but others on this list don't. > Since the value from RDTSC can be subject to drifting between CPUs, > we implement safeguards for this to make sure we never return a lower > value than the previous values. This adds some overhead to nanoTime() > but guards us against possible bugs in the OS. For users who are > willing to trust the OS and need the fastest possible calls to > System.nanoTime(), we add a flag to disable this safeguard: > -XX:+AssumeMonotonicOSTimers. I now wonder if this safeguard can produce a stream of exactly the same timestamps if local clock is lagging behind. But considering the alternative of answering the retrograde time, and the observation the current Mac OS X mach_absolute_time() *appears* monotonic, having this safeguard seems OK. > webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ > bug: https://bugs.openjdk.java.net/browse/JDK-8040140 This looks good to me. And, since this question will inevitably pop up, do we plan to bring it into 8uX? I think many Mac users will be happy about that. Thanks, -Aleksey. From jon.masamitsu at oracle.com Mon Apr 14 22:58:28 2014 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Mon, 14 Apr 2014 15:58:28 -0700 Subject: -XX:MetaspaceSize is correct? In-Reply-To: <53468C96.6080107@gmail.com> References: <5345498F.20904@gmail.com> <5345C0F0.7020606@oracle.com> <53468C96.6080107@gmail.com> Message-ID: <534C6814.4050202@oracle.com> Yasumasa, It's hard to describe what this parameter is in a single sentence. "high-water-mark" doesn't mean much unless you know about how it is used in the GC. Although "initial" is not right in the description, "minimum" might be closer to a good description. I'm really not sure. Jon On 04/10/2014 05:20 AM, Yasumasa Suenaga wrote: > I uploaded webrev: > http://cr.openjdk.java.net/~ysuenaga/JDK-8039867/webrev.00/ > > Please review and sponsoring! > > > Yasumasa > > > On 04/10/2014 12:37 PM, Yasumasa Suenaga wrote: >> Hi Jon, >> Thank you for replying. >> >> I filed this issue as JDK-8039867: Incorrect description: >> -XX:MetaspaceSize . >> >> I attached a patch to this entry. >> I will upload webrev later. >> >> >> Thanks, >> >> Yasumasa >> >> >> >> 2014-04-10 6:51 GMT+09:00, Jon Masamitsu : >>> On 04/09/2014 06:22 AM, Yasumasa Suenaga wrote: >>>> Hi all, >>>> >>>> I checked initial metaspace size through jcmd PerfCounter.print . >>>> However, it seems to be incorrect: >>>> >>>> - Java command: >>>> java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep >>>> >>>> - Output from -XX:+PrintFlagsFinal: >>>> uintx MetaspaceSize = >>>> 21807104 {pd product} >>>> >>>> - Result of "PerfCounter.print" >>>> sun.gc.metaspace.capacity=4194304 >>>> sun.gc.metaspace.maxCapacity=8388608 >>>> sun.gc.metaspace.minCapacity=0 >>>> >>>> >>>> I checked metaspace.cpp, initial size of metaspace is detected by >>>> InitialBootClassLoaderMetaspaceSize. >>>> However, description of MetaspaceSize in globals.hpp is >>>> "Initial size of Metaspaces (in bytes)" . >>>> >>>> Is description of MetaspaceSize is correct? >>> Description is not correct. >>> >>>> And this behavior is correct? >>> Behavior is correct. >>> >>>> I have two plan for this mismatch: >>>> >>>> A) Change description of MetaspaceSize >>>> MetaspaceSize is used to HWM in metaspace.cpp . >>>> So we should change description for this behavior. >>>> ------------ >>>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>>> @@ -3160,7 +3156,7 @@ >>>> "non-daemon thread (in >>>> bytes)") \ >>>> \ >>>> product_pd(uintx, >>>> MetaspaceSize, \ >>>> - "Initial size of Metaspaces (in >>>> bytes)") \ >>>> + "Initial HWM of Metaspaces (in >>>> bytes)") \ >>> Explain what HWM is if you're going to use it. >>> >>>> \ >>>> product(uintx, MaxMetaspaceSize, >>>> max_uintx, \ >>>> "Maximum size of Metaspaces (in >>>> bytes)") \ >>>> ------------ >>>> >>>> B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize >>>> In currently, InitialBootClassLoaderMetaspaceSize is used to >>>> initialize >>>> metaspace. >>>> InitialBootClassLoaderMetaspaceSize is only to use for it. >>>> Thus we should remove this option and use MetaspaceSize to >>>> initialize >>>> metaspace. >>> InitialBootClassLoaderMetaspaceSize is an optimization. It allows >>> approximately >>> enough space for the system classes without repeated allocations of >>> Metaspaces. >>> Not everyone agrees with this optimization but I would like it kept. >>> >>>> ------------ >>>> diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp >>>> --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 >>>> +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 >>>> @@ -3172,7 +3172,7 @@ >>>> #endif >>>> >>>> // Initialize these before initializing the VirtualSpaceList >>>> - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / >>>> BytesPerWord; >>>> + _first_chunk_word_size = MetaspaceSize / BytesPerWord; >>>> _first_chunk_word_size = >>>> align_word_size_up(_first_chunk_word_size); >>>> // Make the first class chunk bigger than a medium chunk so it's >>>> not put >>>> // on the medium chunk list. The next chunk will be small and >>>> progress >>>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>>> @@ -2333,10 +2333,6 @@ >>>> develop(bool, TraceClassLoaderData, >>>> false, \ >>>> "Trace class loader loader_data >>>> lifetime") \ >>>> \ >>>> - product(uintx, >>>> InitialBootClassLoaderMetaspaceSize, \ >>>> - NOT_LP64(2200*K) >>>> LP64_ONLY(4*M), \ >>>> - "Initial size of the boot class loader data >>>> metaspace") \ >>>> - \ >>>> product(bool, TraceGen0Time, >>>> false, \ >>>> "Trace accumulated time for Gen 0 >>>> collection") \ >>>> \ >>>> ------------ >>>> >>>> I prefer "B" . >>>> Because, I guess many users think MetaspaceSize decides initial >>>> metaspace size. >>>> >>>> If my idea is correct, I will file this to JBS and upload patch to >>>> webrev. >>> Please only correct the description of MetaspaceSize. >>> >>> Jon >>> >>>> >>>> Thanks, >>>> >>>> Yasumasa >>>> >>> > From mikael.vidstedt at oracle.com Tue Apr 15 00:45:21 2014 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Mon, 14 Apr 2014 17:45:21 -0700 Subject: 8u Trivial RFR: 8039891: Remove ppcsflt builds from JPRT In-Reply-To: <534B636C.2020309@oracle.com> References: <534B636C.2020309@oracle.com> Message-ID: <534C8121.5040203@oracle.com> Looks good! Cheers, Mikael On 2014-04-13 21:26, David Holmes wrote: > This is the 8u version. It is different to the 9 version as the > jprt.properties file differs from release to release. > > http://cr.openjdk.java.net/~dholmes/8039891/webrev.8u/ > > Pushing to jdk8u/hs-dev/hotspot > > Thanks, > David From christian.tornqvist at oracle.com Tue Apr 15 02:41:58 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Mon, 14 Apr 2014 22:41:58 -0400 Subject: RFR(M): [TESTBUG] runtime/threads/CancellableThreadTest fails with OOM on windows-i586 Message-ID: <002301cf5854$46132270$d2396750$@oracle.com> Hi everyone, This is a port (and fix) of CancellableThreadTest from one of our internal harnesses to jtreg in OpenJDK. The original test suffered from issues with spawning too many threads on 32bit Windows, when running with WoW64 we have 2 stacks for each thread and usually ran out of process space. I cleaned the test up a bit but the functionality of the test should be the same, also limited the number of threads to 256 (128 pairs) down from 2048 (1024 pairs). Webrev can be found at: http://cr.openjdk.java.net/~ctornqvi/webrev/8035173/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8035173 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuenag at gmail.com Tue Apr 15 03:48:40 2014 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Tue, 15 Apr 2014 12:48:40 +0900 Subject: -XX:MetaspaceSize is correct? In-Reply-To: <534C6814.4050202@oracle.com> References: <5345498F.20904@gmail.com> <5345C0F0.7020606@oracle.com> <53468C96.6080107@gmail.com> <534C6814.4050202@oracle.com> Message-ID: Jon, I agree with you. MetaspaceSize is used as minimum value when JVM shrink capacity in MetaspaceGC::compute_new_size() . So I will change description to "minimum" and upload new webrev. Yasumasa 2014-04-15 7:58 GMT+09:00, Jon Masamitsu : > Yasumasa, > > It's hard to describe what this parameter is in a single > sentence. "high-water-mark" doesn't mean much unless > you know about how it is used in the GC. Although > "initial" is not right in the description, "minimum" might > be closer to a good description. I'm really not sure. > > Jon > > On 04/10/2014 05:20 AM, Yasumasa Suenaga wrote: >> I uploaded webrev: >> http://cr.openjdk.java.net/~ysuenaga/JDK-8039867/webrev.00/ >> >> Please review and sponsoring! >> >> >> Yasumasa >> >> >> On 04/10/2014 12:37 PM, Yasumasa Suenaga wrote: >>> Hi Jon, >>> Thank you for replying. >>> >>> I filed this issue as JDK-8039867: Incorrect description: >>> -XX:MetaspaceSize . >>> >>> I attached a patch to this entry. >>> I will upload webrev later. >>> >>> >>> Thanks, >>> >>> Yasumasa >>> >>> >>> >>> 2014-04-10 6:51 GMT+09:00, Jon Masamitsu : >>>> On 04/09/2014 06:22 AM, Yasumasa Suenaga wrote: >>>>> Hi all, >>>>> >>>>> I checked initial metaspace size through jcmd PerfCounter.print . >>>>> However, it seems to be incorrect: >>>>> >>>>> - Java command: >>>>> java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep >>>>> >>>>> - Output from -XX:+PrintFlagsFinal: >>>>> uintx MetaspaceSize = >>>>> 21807104 {pd product} >>>>> >>>>> - Result of "PerfCounter.print" >>>>> sun.gc.metaspace.capacity=4194304 >>>>> sun.gc.metaspace.maxCapacity=8388608 >>>>> sun.gc.metaspace.minCapacity=0 >>>>> >>>>> >>>>> I checked metaspace.cpp, initial size of metaspace is detected by >>>>> InitialBootClassLoaderMetaspaceSize. >>>>> However, description of MetaspaceSize in globals.hpp is >>>>> "Initial size of Metaspaces (in bytes)" . >>>>> >>>>> Is description of MetaspaceSize is correct? >>>> Description is not correct. >>>> >>>>> And this behavior is correct? >>>> Behavior is correct. >>>> >>>>> I have two plan for this mismatch: >>>>> >>>>> A) Change description of MetaspaceSize >>>>> MetaspaceSize is used to HWM in metaspace.cpp . >>>>> So we should change description for this behavior. >>>>> ------------ >>>>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>>>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>>>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>>>> @@ -3160,7 +3156,7 @@ >>>>> "non-daemon thread (in >>>>> bytes)") \ >>>>> \ >>>>> product_pd(uintx, >>>>> MetaspaceSize, \ >>>>> - "Initial size of Metaspaces (in >>>>> bytes)") \ >>>>> + "Initial HWM of Metaspaces (in >>>>> bytes)") \ >>>> Explain what HWM is if you're going to use it. >>>> >>>>> \ >>>>> product(uintx, MaxMetaspaceSize, >>>>> max_uintx, \ >>>>> "Maximum size of Metaspaces (in >>>>> bytes)") \ >>>>> ------------ >>>>> >>>>> B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize >>>>> In currently, InitialBootClassLoaderMetaspaceSize is used to >>>>> initialize >>>>> metaspace. >>>>> InitialBootClassLoaderMetaspaceSize is only to use for it. >>>>> Thus we should remove this option and use MetaspaceSize to >>>>> initialize >>>>> metaspace. >>>> InitialBootClassLoaderMetaspaceSize is an optimization. It allows >>>> approximately >>>> enough space for the system classes without repeated allocations of >>>> Metaspaces. >>>> Not everyone agrees with this optimization but I would like it kept. >>>> >>>>> ------------ >>>>> diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp >>>>> --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 >>>>> +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 >>>>> @@ -3172,7 +3172,7 @@ >>>>> #endif >>>>> >>>>> // Initialize these before initializing the VirtualSpaceList >>>>> - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / >>>>> BytesPerWord; >>>>> + _first_chunk_word_size = MetaspaceSize / BytesPerWord; >>>>> _first_chunk_word_size = >>>>> align_word_size_up(_first_chunk_word_size); >>>>> // Make the first class chunk bigger than a medium chunk so it's >>>>> not put >>>>> // on the medium chunk list. The next chunk will be small and >>>>> progress >>>>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>>>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>>>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>>>> @@ -2333,10 +2333,6 @@ >>>>> develop(bool, TraceClassLoaderData, >>>>> false, \ >>>>> "Trace class loader loader_data >>>>> lifetime") \ >>>>> \ >>>>> - product(uintx, >>>>> InitialBootClassLoaderMetaspaceSize, \ >>>>> - NOT_LP64(2200*K) >>>>> LP64_ONLY(4*M), \ >>>>> - "Initial size of the boot class loader data >>>>> metaspace") \ >>>>> - \ >>>>> product(bool, TraceGen0Time, >>>>> false, \ >>>>> "Trace accumulated time for Gen 0 >>>>> collection") \ >>>>> \ >>>>> ------------ >>>>> >>>>> I prefer "B" . >>>>> Because, I guess many users think MetaspaceSize decides initial >>>>> metaspace size. >>>>> >>>>> If my idea is correct, I will file this to JBS and upload patch to >>>>> webrev. >>>> Please only correct the description of MetaspaceSize. >>>> >>>> Jon >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Yasumasa >>>>> >>>> >> > > From staffan.larsen at oracle.com Tue Apr 15 05:50:22 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 07:50:22 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534C2B3F.3020806@oracle.com> References: <534C2B3F.3020806@oracle.com> Message-ID: <7AD8ACBC-9E7F-454A-BC4B-79A181D9BAB3@oracle.com> Thanks Serguei. The comments were copied from the solaris code, but I agree that they could be cleaned up. /Staffan On 14 apr 2014, at 20:38, serguei.spitsyn at oracle.com wrote: > > src/os/bsd/vm/os_bsd.cpp > > In the comments at 1032-1043: > > 1. Would it be better to consistently name vars as obsv/prev, not obs/prv ? > I had no problem to understand comments however my mind tries to associate 'obs' with 'obsolete'. > > 2. The link http://blogs.sun.com/dave/entry/cas_and_cache_trivia_invalidate > is resolved to https://blogs.oracle.com/ which is not very useful. > > > > Thanks, > Serguei > > > On 4/14/14 7:55 AM, Staffan Larsen wrote: >> The current implementation of System.nanoTime() on OS X uses gettimeofday() which has only microsecond precision and no guarantees on being monotonic. >> >> The proposal is to use the system call mach_absolute_time() instead of gettimeofday() and to add safeguard to guarantee that the time is monotonic (similar to what we already have on solaris). >> >> mach_absolute_time() is essentially a direct call to RDTSC, but with conversion factor to offset for any system sleeps and frequency changes. The call returns something that can be converted to nanoseconds using information from mach_timebase_info(). Calls to mach_absolute_time() do not enter the kernel and are very fast. The resulting time has nanosecond precision and as good accuracy as one can get. >> >> Since the value from RDTSC can be subject to drifting between CPUs, we implement safeguards for this to make sure we never return a lower value than the previous values. This adds some overhead to nanoTime() but guards us against possible bugs in the OS. For users who are willing to trust the OS and need the fastest possible calls to System.nanoTime(), we add a flag to disable this safeguard: -XX:+AssumeMonotonicOSTimers. >> >> This change also adds support for AssumeMonotonicOSTimers to the solaris code (see JDK-6864866) and removes the use of Atmoic::load() for a 64-bit value which was necessary on 32-bit platforms (which we don?t support any longer). >> >> This change has been proposed earlier at: http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-May/009496.html >> >> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >> >> Thanks, >> /Staffan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 15 05:52:18 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 07:52:18 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534C323E.2040809@oracle.com> References: <534C323E.2040809@oracle.com> Message-ID: On 14 apr 2014, at 21:08, Aleksey Shipilev wrote: > On 04/14/2014 06:55 PM, Staffan Larsen wrote: >> mach_absolute_time() is essentially a direct call to RDTSC, but with >> conversion factor to offset for any system sleeps and frequency >> changes. The call returns something that can be converted to >> nanoseconds using information from mach_timebase_info(). Calls to >> mach_absolute_time() do not enter the kernel and are very fast. The >> resulting time has nanosecond precision and as good accuracy as one >> can get. > > Some numbers would be good on the public list :) I know the numbers > already, but others on this list don?t. I posted the numbers in the bug, but forgot to say so here... > >> Since the value from RDTSC can be subject to drifting between CPUs, >> we implement safeguards for this to make sure we never return a lower >> value than the previous values. This adds some overhead to nanoTime() >> but guards us against possible bugs in the OS. For users who are >> willing to trust the OS and need the fastest possible calls to >> System.nanoTime(), we add a flag to disable this safeguard: >> -XX:+AssumeMonotonicOSTimers. > > I now wonder if this safeguard can produce a stream of exactly the same > timestamps if local clock is lagging behind. But considering the > alternative of answering the retrograde time, and the observation the > current Mac OS X mach_absolute_time() *appears* monotonic, having this > safeguard seems OK. > >> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 > > This looks good to me. Thanks. > And, since this question will inevitably pop up, do we plan to bring it > into 8uX? I think many Mac users will be happy about that. I would like to do so, but I would also like to have it sit and bake for a while in 9 before that. I think the 8u20 train has left the station, but perhaps 8u40? /Staffan From staffan.larsen at oracle.com Tue Apr 15 06:00:23 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 08:00:23 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> Message-ID: Here is an updated webrev with changes to the comments in os_bsd.cpp and os_solaris.cpp. - obs -> obsv - fixed URL to blog entry http://cr.openjdk.java.net/~sla/8040140/webrev.01/ /Staffan On 15 apr 2014, at 07:52, Staffan Larsen wrote: > > On 14 apr 2014, at 21:08, Aleksey Shipilev wrote: > >> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>> conversion factor to offset for any system sleeps and frequency >>> changes. The call returns something that can be converted to >>> nanoseconds using information from mach_timebase_info(). Calls to >>> mach_absolute_time() do not enter the kernel and are very fast. The >>> resulting time has nanosecond precision and as good accuracy as one >>> can get. >> >> Some numbers would be good on the public list :) I know the numbers >> already, but others on this list don?t. > > I posted the numbers in the bug, but forgot to say so here... > >> >>> Since the value from RDTSC can be subject to drifting between CPUs, >>> we implement safeguards for this to make sure we never return a lower >>> value than the previous values. This adds some overhead to nanoTime() >>> but guards us against possible bugs in the OS. For users who are >>> willing to trust the OS and need the fastest possible calls to >>> System.nanoTime(), we add a flag to disable this safeguard: >>> -XX:+AssumeMonotonicOSTimers. >> >> I now wonder if this safeguard can produce a stream of exactly the same >> timestamps if local clock is lagging behind. But considering the >> alternative of answering the retrograde time, and the observation the >> current Mac OS X mach_absolute_time() *appears* monotonic, having this >> safeguard seems OK. >> >>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >> >> This looks good to me. > > Thanks. > >> And, since this question will inevitably pop up, do we plan to bring it >> into 8uX? I think many Mac users will be happy about that. > > I would like to do so, but I would also like to have it sit and bake for a while in 9 before that. I think the 8u20 train has left the station, but perhaps 8u40? > > /Staffan -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 15 06:07:24 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 08:07:24 +0200 Subject: RFR(M): [TESTBUG] runtime/threads/CancellableThreadTest fails with OOM on windows-i586 In-Reply-To: <002301cf5854$46132270$d2396750$@oracle.com> References: <002301cf5854$46132270$d2396750$@oracle.com> Message-ID: Looks good! Thanks, /Staffan On 15 apr 2014, at 04:41, Christian Tornqvist wrote: > Hi everyone, > > This is a port (and fix) of CancellableThreadTest from one of our internal harnesses to jtreg in OpenJDK. The original test suffered from issues with spawning too many threads on 32bit Windows, when running with WoW64 we have 2 stacks for each thread and usually ran out of process space. > > I cleaned the test up a bit but the functionality of the test should be the same, also limited the number of threads to 256 (128 pairs) down from 2048 (1024 pairs). > > Webrev can be found at: > http://cr.openjdk.java.net/~ctornqvi/webrev/8035173/webrev.00/ > > Bug: > https://bugs.openjdk.java.net/browse/JDK-8035173 > > Thanks, > Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Tue Apr 15 06:54:54 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Apr 2014 16:54:54 +1000 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534C323E.2040809@oracle.com> References: <534C323E.2040809@oracle.com> Message-ID: <534CD7BE.30203@oracle.com> On 15/04/2014 5:08 AM, Aleksey Shipilev wrote: > On 04/14/2014 06:55 PM, Staffan Larsen wrote: >> mach_absolute_time() is essentially a direct call to RDTSC, but with >> conversion factor to offset for any system sleeps and frequency >> changes. The call returns something that can be converted to >> nanoseconds using information from mach_timebase_info(). Calls to >> mach_absolute_time() do not enter the kernel and are very fast. The >> resulting time has nanosecond precision and as good accuracy as one >> can get. > > Some numbers would be good on the public list :) I know the numbers > already, but others on this list don't. > >> Since the value from RDTSC can be subject to drifting between CPUs, >> we implement safeguards for this to make sure we never return a lower >> value than the previous values. This adds some overhead to nanoTime() >> but guards us against possible bugs in the OS. For users who are >> willing to trust the OS and need the fastest possible calls to >> System.nanoTime(), we add a flag to disable this safeguard: >> -XX:+AssumeMonotonicOSTimers. > > I now wonder if this safeguard can produce a stream of exactly the same > timestamps if local clock is lagging behind. But considering the > alternative of answering the retrograde time, and the observation the > current Mac OS X mach_absolute_time() *appears* monotonic, having this > safeguard seems OK. Yes this can happen. Time "standing still" was deemed better than time going backwards (there have been a number of "bugs" filed when this is observed). Ultimately if the OS clock source is broken there is little the VM can do to make it right. David >> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 > > This looks good to me. > > And, since this question will inevitably pop up, do we plan to bring it > into 8uX? I think many Mac users will be happy about that. > > Thanks, > -Aleksey. > From david.holmes at oracle.com Tue Apr 15 07:14:42 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Apr 2014 17:14:42 +1000 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> Message-ID: <534CDC62.6010906@oracle.com> Hi Staffan, Generally looks okay. os_bsd.cpp still shows the old URL for Dave Dice's article os_solaris.cpp: In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. globals.hpp Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) os.hpp: #ifdef TARGET_OS_FAMILY_bsd # include "jvm_bsd.h" # include + # include #endif I think this include needs to be in a OSX/Apple specific conditional. -- We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic Thanks, David On 15/04/2014 4:00 PM, Staffan Larsen wrote: > Here is an updated webrev with changes to the comments in os_bsd.cpp and > os_solaris.cpp. > - obs -> obsv > - fixed URL to blog entry > > http://cr.openjdk.java.net/~sla/8040140/webrev.01/ > > /Staffan > > On 15 apr 2014, at 07:52, Staffan Larsen > wrote: > >> >> On 14 apr 2014, at 21:08, Aleksey Shipilev >> > wrote: >> >>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>> conversion factor to offset for any system sleeps and frequency >>>> changes. The call returns something that can be converted to >>>> nanoseconds using information from mach_timebase_info(). Calls to >>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>> resulting time has nanosecond precision and as good accuracy as one >>>> can get. >>> >>> Some numbers would be good on the public list :) I know the numbers >>> already, but others on this list don?t. >> >> I posted the numbers in the bug, but forgot to say so here... >> >>> >>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>> we implement safeguards for this to make sure we never return a lower >>>> value than the previous values. This adds some overhead to nanoTime() >>>> but guards us against possible bugs in the OS. For users who are >>>> willing to trust the OS and need the fastest possible calls to >>>> System.nanoTime(), we add a flag to disable this safeguard: >>>> -XX:+AssumeMonotonicOSTimers. >>> >>> I now wonder if this safeguard can produce a stream of exactly the same >>> timestamps if local clock is lagging behind. But considering the >>> alternative of answering the retrograde time, and the observation the >>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>> safeguard seems OK. >>> >>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>> >>> This looks good to me. >> >> Thanks. >> >>> And, since this question will inevitably pop up, do we plan to bring it >>> into 8uX? I think many Mac users will be happy about that. >> >> I would like to do so, but I would also like to have it sit and bake >> for a while in 9 before that. I think the 8u20 train has left the >> station, but perhaps 8u40? >> >> /Staffan > From serguei.spitsyn at oracle.com Tue Apr 15 07:46:45 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Tue, 15 Apr 2014 00:46:45 -0700 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> Message-ID: <534CE3E5.7010402@oracle.com> Somehow the 'obs', 'prv' and the old link are still in new webrev: 1033 // If the CAS failed and the observed value "obs" is >= now then 1034 // we should return "obs". If the CAS failed and now > obs > prv then 1037 // or (c) just return obs. We use (c). No loop is required although in some cases 1041 // We might also condition (c) on the magnitude of the delta between obs and now. 1043 // See http://blogs.sun.com/dave/entry/cas_and_cache_trivia_invalidate But I believe, you really fixed it in the repo. :) Thanks, Serguei On 4/14/14 11:00 PM, Staffan Larsen wrote: > Here is an updated webrev with changes to the comments in os_bsd.cpp > and os_solaris.cpp. > - obs -> obsv > - fixed URL to blog entry > > http://cr.openjdk.java.net/~sla/8040140/webrev.01/ > > > /Staffan > > On 15 apr 2014, at 07:52, Staffan Larsen > wrote: > >> >> On 14 apr 2014, at 21:08, Aleksey Shipilev >> > wrote: >> >>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>> conversion factor to offset for any system sleeps and frequency >>>> changes. The call returns something that can be converted to >>>> nanoseconds using information from mach_timebase_info(). Calls to >>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>> resulting time has nanosecond precision and as good accuracy as one >>>> can get. >>> >>> Some numbers would be good on the public list :) I know the numbers >>> already, but others on this list don?t. >> >> I posted the numbers in the bug, but forgot to say so here... >> >>> >>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>> we implement safeguards for this to make sure we never return a lower >>>> value than the previous values. This adds some overhead to nanoTime() >>>> but guards us against possible bugs in the OS. For users who are >>>> willing to trust the OS and need the fastest possible calls to >>>> System.nanoTime(), we add a flag to disable this safeguard: >>>> -XX:+AssumeMonotonicOSTimers. >>> >>> I now wonder if this safeguard can produce a stream of exactly the same >>> timestamps if local clock is lagging behind. But considering the >>> alternative of answering the retrograde time, and the observation the >>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>> safeguard seems OK. >>> >>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>> >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>> >>> This looks good to me. >> >> Thanks. >> >>> And, since this question will inevitably pop up, do we plan to bring it >>> into 8uX? I think many Mac users will be happy about that. >> >> I would like to do so, but I would also like to have it sit and bake >> for a while in 9 before that. I think the 8u20 train has left the >> station, but perhaps 8u40? >> >> /Staffan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 15 09:20:05 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 11:20:05 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534CDC62.6010906@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> Message-ID: On 15 apr 2014, at 09:14, David Holmes wrote: > Hi Staffan, > > Generally looks okay. > > os_bsd.cpp still shows the old URL for Dave Dice's article I had forgotten to save the file. :-( > os_solaris.cpp: > > In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. > globals.hpp > > Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) I will update the description to: experimental(bool, AssumeMonotonicOSTimers, false, \ "Assume that the OS system timers are monotonic " \ "(Solaris and OS X)") \ > os.hpp: > > #ifdef TARGET_OS_FAMILY_bsd > # include "jvm_bsd.h" > # include > + # include > #endif > > I think this include needs to be in a OSX/Apple specific conditional. Changed it to: #ifdef TARGET_OS_FAMILY_bsd # include "jvm_bsd.h" # include # ifdef __APPLE__ # include # endif Thanks, /Staffan > > -- > > We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic > > Thanks, > David > > On 15/04/2014 4:00 PM, Staffan Larsen wrote: >> Here is an updated webrev with changes to the comments in os_bsd.cpp and >> os_solaris.cpp. >> - obs -> obsv >> - fixed URL to blog entry >> >> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >> >> /Staffan >> >> On 15 apr 2014, at 07:52, Staffan Larsen > > wrote: >> >>> >>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>> > wrote: >>> >>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>> conversion factor to offset for any system sleeps and frequency >>>>> changes. The call returns something that can be converted to >>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>> resulting time has nanosecond precision and as good accuracy as one >>>>> can get. >>>> >>>> Some numbers would be good on the public list :) I know the numbers >>>> already, but others on this list don?t. >>> >>> I posted the numbers in the bug, but forgot to say so here... >>> >>>> >>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>> we implement safeguards for this to make sure we never return a lower >>>>> value than the previous values. This adds some overhead to nanoTime() >>>>> but guards us against possible bugs in the OS. For users who are >>>>> willing to trust the OS and need the fastest possible calls to >>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>> -XX:+AssumeMonotonicOSTimers. >>>> >>>> I now wonder if this safeguard can produce a stream of exactly the same >>>> timestamps if local clock is lagging behind. But considering the >>>> alternative of answering the retrograde time, and the observation the >>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>> safeguard seems OK. >>>> >>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>> >>>> This looks good to me. >>> >>> Thanks. >>> >>>> And, since this question will inevitably pop up, do we plan to bring it >>>> into 8uX? I think many Mac users will be happy about that. >>> >>> I would like to do so, but I would also like to have it sit and bake >>> for a while in 9 before that. I think the 8u20 train has left the >>> station, but perhaps 8u40? >>> >>> /Staffan >> From david.holmes at oracle.com Tue Apr 15 09:38:59 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Apr 2014 19:38:59 +1000 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> Message-ID: <534CFE33.2040106@oracle.com> On 15/04/2014 7:20 PM, Staffan Larsen wrote: > > On 15 apr 2014, at 09:14, David Holmes wrote: > >> Hi Staffan, >> >> Generally looks okay. >> >> os_bsd.cpp still shows the old URL for Dave Dice's article > > I had forgotten to save the file. :-( > >> os_solaris.cpp: >> >> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. > > Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. I'm in favour of removing dead code. :) >> globals.hpp >> >> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) > > I will update the description to: > > experimental(bool, AssumeMonotonicOSTimers, false, \ > "Assume that the OS system timers are monotonic " \ > "(Solaris and OS X)") \ Sounds good. Will you close 6864866 as a duplicate of this one? >> os.hpp: >> >> #ifdef TARGET_OS_FAMILY_bsd >> # include "jvm_bsd.h" >> # include >> + # include >> #endif >> >> I think this include needs to be in a OSX/Apple specific conditional. > > Changed it to: > > #ifdef TARGET_OS_FAMILY_bsd > # include "jvm_bsd.h" > # include > # ifdef __APPLE__ > # include > # endif Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) Thanks, David > > Thanks, > /Staffan > >> >> -- >> >> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >> >> Thanks, >> David >> >> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>> os_solaris.cpp. >>> - obs -> obsv >>> - fixed URL to blog entry >>> >>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>> >>> /Staffan >>> >>> On 15 apr 2014, at 07:52, Staffan Larsen >> > wrote: >>> >>>> >>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>> > wrote: >>>> >>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>> conversion factor to offset for any system sleeps and frequency >>>>>> changes. The call returns something that can be converted to >>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>> can get. >>>>> >>>>> Some numbers would be good on the public list :) I know the numbers >>>>> already, but others on this list don?t. >>>> >>>> I posted the numbers in the bug, but forgot to say so here... >>>> >>>>> >>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>> we implement safeguards for this to make sure we never return a lower >>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>> but guards us against possible bugs in the OS. For users who are >>>>>> willing to trust the OS and need the fastest possible calls to >>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>> -XX:+AssumeMonotonicOSTimers. >>>>> >>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>> timestamps if local clock is lagging behind. But considering the >>>>> alternative of answering the retrograde time, and the observation the >>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>> safeguard seems OK. >>>>> >>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>> >>>>> This looks good to me. >>>> >>>> Thanks. >>>> >>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>> into 8uX? I think many Mac users will be happy about that. >>>> >>>> I would like to do so, but I would also like to have it sit and bake >>>> for a while in 9 before that. I think the 8u20 train has left the >>>> station, but perhaps 8u40? >>>> >>>> /Staffan >>> > From staffan.larsen at oracle.com Tue Apr 15 11:42:09 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 13:42:09 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534CFE33.2040106@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> Message-ID: <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> On 15 apr 2014, at 11:38, David Holmes wrote: > On 15/04/2014 7:20 PM, Staffan Larsen wrote: >> >> On 15 apr 2014, at 09:14, David Holmes wrote: >> >>> Hi Staffan, >>> >>> Generally looks okay. >>> >>> os_bsd.cpp still shows the old URL for Dave Dice's article >> >> I had forgotten to save the file. :-( >> >>> os_solaris.cpp: >>> >>> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. >> >> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. > > I'm in favour of removing dead code. :) Gone! >>> globals.hpp >>> >>> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) >> >> I will update the description to: >> >> experimental(bool, AssumeMonotonicOSTimers, false, \ >> "Assume that the OS system timers are monotonic " \ >> "(Solaris and OS X)") \ > > Sounds good. Will you close 6864866 as a duplicate of this one? I will include 6864866 in the hg commit message closing both with the same fix. > >>> os.hpp: >>> >>> #ifdef TARGET_OS_FAMILY_bsd >>> # include "jvm_bsd.h" >>> # include >>> + # include >>> #endif >>> >>> I think this include needs to be in a OSX/Apple specific conditional. >> >> Changed it to: >> >> #ifdef TARGET_OS_FAMILY_bsd >> # include "jvm_bsd.h" >> # include >> # ifdef __APPLE__ >> # include >> # endif > > Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ Thanks, /Staffan > > Thanks, > David > >> >> Thanks, >> /Staffan >> >>> >>> -- >>> >>> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >>> >>> Thanks, >>> David >>> >>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>>> os_solaris.cpp. >>>> - obs -> obsv >>>> - fixed URL to blog entry >>>> >>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>> >>>> /Staffan >>>> >>>> On 15 apr 2014, at 07:52, Staffan Larsen >>> > wrote: >>>> >>>>> >>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>> > wrote: >>>>> >>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>> changes. The call returns something that can be converted to >>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>> can get. >>>>>> >>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>> already, but others on this list don?t. >>>>> >>>>> I posted the numbers in the bug, but forgot to say so here... >>>>> >>>>>> >>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>> we implement safeguards for this to make sure we never return a lower >>>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>> >>>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>>> timestamps if local clock is lagging behind. But considering the >>>>>> alternative of answering the retrograde time, and the observation the >>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>>> safeguard seems OK. >>>>>> >>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>> >>>>>> This looks good to me. >>>>> >>>>> Thanks. >>>>> >>>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>>> into 8uX? I think many Mac users will be happy about that. >>>>> >>>>> I would like to do so, but I would also like to have it sit and bake >>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>> station, but perhaps 8u40? >>>>> >>>>> /Staffan -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Tue Apr 15 11:57:56 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Apr 2014 21:57:56 +1000 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> Message-ID: <534D1EC4.2090804@oracle.com> Hi Staffan, For the solaris changes ... This comment is not accurate from the original code: 1367 // gethrtime can move backwards if read from one cpu and then a different cpu 1368 // getTimeNanos is guaranteed to not move backward on Solaris 1369 // AssumeMonotonicOSTimers can be used to remove this guarantee. can I suggest // gethrtime should be monotonic but has had bugs in the past. // getTimeNanos must be guaranteed not to move backwards, so we add a // check in case gethrtime is buggy. // AssumeMonotonicOSTimers can be set to remove this additional check. With regard to code deletion this seems to be dead code now as well: 350 const int LOCK_BUSY = 1; 351 const int LOCK_FREE = 0; 352 const int LOCK_INVALID = -1; 354 static volatile int max_hrtime_lock = LOCK_FREE; // Update counter with LSB as lock-in-progress Thanks, David On 15/04/2014 9:42 PM, Staffan Larsen wrote: > > On 15 apr 2014, at 11:38, David Holmes > wrote: > >> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>> >>> On 15 apr 2014, at 09:14, David Holmes >> > wrote: >>> >>>> Hi Staffan, >>>> >>>> Generally looks okay. >>>> >>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>> >>> I had forgotten to save the file. :-( >>> >>>> os_solaris.cpp: >>>> >>>> In the Solaris changes there is a lot of old code with inaccurate >>>> comments, but I suppose cleaning that up (oldgetTimeNanos()) is out >>>> of scope. You only added the check for AssumeMonotonicOSTimers in >>>> the supports_cx8 path, but the other path is now dead code. >>> >>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is >>> defined) on both solaris sparc and solaris x86, it looks like >>> oldgetTimeNanos() is really dead code. I can remove it as part of >>> this change if that?s ok. >> >> I'm in favour of removing dead code. :) > > Gone! > >>>> globals.hpp >>>> >>>> Do we need to document this only affects OSX and Solaris? (Though >>>> implicitly this acts as-if true on Linux and Windows in the common >>>> case.) >>> >>> I will update the description to: >>> >>> experimental(bool, AssumeMonotonicOSTimers, false, >>> \ >>> "Assume that the OS system timers are monotonic " >>> \ >>> "(Solaris and OS X)") >>> \ >> >> Sounds good. Will you close 6864866 as a duplicate of this one? > > I will include 6864866 in the hg commit message closing both with the > same fix. > >> >>>> os.hpp: >>>> >>>> #ifdef TARGET_OS_FAMILY_bsd >>>> # include "jvm_bsd.h" >>>> # include >>>> + # include >>>> #endif >>>> >>>> I think this include needs to be in a OSX/Apple specific conditional. >>> >>> Changed it to: >>> >>> #ifdef TARGET_OS_FAMILY_bsd >>> # include "jvm_bsd.h" >>> # include >>> # ifdef __APPLE__ >>> # include >>> # endif >> >> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) > > Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ > > Thanks, > /Staffan > >> >> Thanks, >> David >> >>> >>> Thanks, >>> /Staffan >>> >>>> >>>> -- >>>> >>>> We should really fix the non-monotonic-clock path in the Linux and >>>> Windows implementations too ... but 32-bit is problematic >>>> >>>> Thanks, >>>> David >>>> >>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>> Here is an updated webrev with changes to the comments in >>>>> os_bsd.cpp and >>>>> os_solaris.cpp. >>>>> - obs -> obsv >>>>> - fixed URL to blog entry >>>>> >>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>> >>>>> /Staffan >>>>> >>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>> >>>>> > wrote: >>>>> >>>>>> >>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>> >>>>>> > wrote: >>>>>> >>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>> changes. The call returns something that can be converted to >>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>> can get. >>>>>>> >>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>> already, but others on this list don?t. >>>>>> >>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>> >>>>>>> >>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>> we implement safeguards for this to make sure we never return a >>>>>>>> lower >>>>>>>> value than the previous values. This adds some overhead to >>>>>>>> nanoTime() >>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>> >>>>>>> I now wonder if this safeguard can produce a stream of exactly >>>>>>> the same >>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having >>>>>>> this >>>>>>> safeguard seems OK. >>>>>>> >>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>> >>>>>>> This looks good to me. >>>>>> >>>>>> Thanks. >>>>>> >>>>>>> And, since this question will inevitably pop up, do we plan to >>>>>>> bring it >>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>> >>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>> station, but perhaps 8u40? >>>>>> >>>>>> /Staffan > From karen.kinnear at oracle.com Tue Apr 15 12:00:04 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Tue, 15 Apr 2014 08:00:04 -0400 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> Message-ID: <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> Staffan, Have you heard back from the Solaris folks yet on how to tell that we are on a virtual machine, and where they tell us gethhrtime can move backward? Is there any thought that in cases where we know there is a problem we might not want to follow a script's flag recommendation? I have been in too many situations in which scripts for starting java applications are inherited on systems that are not appropriate, by folks who didn't write them and don't know the history of the flag settings. I am concerned about subtle unexpected behaviors here. Since I haven't had time (yet - sorry) to walk through all the callers of getTimeNanos - could you possibly let me know if there is a java call that ultimately uses this and if so, the impact on java code of time moving backward? Same for callers in the vm please? I believe Ramki fixed at least one of the garbage collectors that had problems if time moved backward. Are the vm internal callers ok if time moves backwards? Or I can do that research when I get the time - and I can get back to you on that tomorrow - sorry, another day of back-to-back meetings. thanks, Karen On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: > > On 15 apr 2014, at 11:38, David Holmes wrote: > >> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>> >>> On 15 apr 2014, at 09:14, David Holmes wrote: >>> >>>> Hi Staffan, >>>> >>>> Generally looks okay. >>>> >>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>> >>> I had forgotten to save the file. :-( >>> >>>> os_solaris.cpp: >>>> >>>> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. >>> >>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. >> >> I'm in favour of removing dead code. :) > > Gone! > >>>> globals.hpp >>>> >>>> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) >>> >>> I will update the description to: >>> >>> experimental(bool, AssumeMonotonicOSTimers, false, \ >>> "Assume that the OS system timers are monotonic " \ >>> "(Solaris and OS X)") \ >> >> Sounds good. Will you close 6864866 as a duplicate of this one? > > I will include 6864866 in the hg commit message closing both with the same fix. > >> >>>> os.hpp: >>>> >>>> #ifdef TARGET_OS_FAMILY_bsd >>>> # include "jvm_bsd.h" >>>> # include >>>> + # include >>>> #endif >>>> >>>> I think this include needs to be in a OSX/Apple specific conditional. >>> >>> Changed it to: >>> >>> #ifdef TARGET_OS_FAMILY_bsd >>> # include "jvm_bsd.h" >>> # include >>> # ifdef __APPLE__ >>> # include >>> # endif >> >> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) > > Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ > > Thanks, > /Staffan > >> >> Thanks, >> David >> >>> >>> Thanks, >>> /Staffan >>> >>>> >>>> -- >>>> >>>> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >>>> >>>> Thanks, >>>> David >>>> >>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>>>> os_solaris.cpp. >>>>> - obs -> obsv >>>>> - fixed URL to blog entry >>>>> >>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>> >>>>> /Staffan >>>>> >>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>> > wrote: >>>>> >>>>>> >>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>> > wrote: >>>>>> >>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>> changes. The call returns something that can be converted to >>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>> can get. >>>>>>> >>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>> already, but others on this list don?t. >>>>>> >>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>> >>>>>>> >>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>> we implement safeguards for this to make sure we never return a lower >>>>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>> >>>>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>>>> safeguard seems OK. >>>>>>> >>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>> >>>>>>> This looks good to me. >>>>>> >>>>>> Thanks. >>>>>> >>>>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>> >>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>> station, but perhaps 8u40? >>>>>> >>>>>> /Staffan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 15 12:21:57 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 14:21:57 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <534D1EC4.2090804@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <534D1EC4.2090804@oracle.com> Message-ID: On 15 apr 2014, at 13:57, David Holmes wrote: > Hi Staffan, > > For the solaris changes ... > > This comment is not accurate from the original code: > > 1367 // gethrtime can move backwards if read from one cpu and then a different cpu > 1368 // getTimeNanos is guaranteed to not move backward on Solaris > 1369 // AssumeMonotonicOSTimers can be used to remove this guarantee. > > can I suggest > > // gethrtime should be monotonic but has had bugs in the past. > // getTimeNanos must be guaranteed not to move backwards, so we add a > // check in case gethrtime is buggy. > // AssumeMonotonicOSTimers can be set to remove this additional check. Fixed. > With regard to code deletion this seems to be dead code now as well: > > 350 const int LOCK_BUSY = 1; > 351 const int LOCK_FREE = 0; > 352 const int LOCK_INVALID = -1; > > 354 static volatile int max_hrtime_lock = LOCK_FREE; // Update counter with LSB as lock-in-progress Fixed. New version: http://cr.openjdk.java.net/~sla/8040140/webrev.03/ /Staffan > > Thanks, > David > > > On 15/04/2014 9:42 PM, Staffan Larsen wrote: >> >> On 15 apr 2014, at 11:38, David Holmes > > wrote: >> >>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>> >>>> On 15 apr 2014, at 09:14, David Holmes >>> > wrote: >>>> >>>>> Hi Staffan, >>>>> >>>>> Generally looks okay. >>>>> >>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>> >>>> I had forgotten to save the file. :-( >>>> >>>>> os_solaris.cpp: >>>>> >>>>> In the Solaris changes there is a lot of old code with inaccurate >>>>> comments, but I suppose cleaning that up (oldgetTimeNanos()) is out >>>>> of scope. You only added the check for AssumeMonotonicOSTimers in >>>>> the supports_cx8 path, but the other path is now dead code. >>>> >>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is >>>> defined) on both solaris sparc and solaris x86, it looks like >>>> oldgetTimeNanos() is really dead code. I can remove it as part of >>>> this change if that?s ok. >>> >>> I'm in favour of removing dead code. :) >> >> Gone! >> >>>>> globals.hpp >>>>> >>>>> Do we need to document this only affects OSX and Solaris? (Though >>>>> implicitly this acts as-if true on Linux and Windows in the common >>>>> case.) >>>> >>>> I will update the description to: >>>> >>>> experimental(bool, AssumeMonotonicOSTimers, false, >>>> \ >>>> "Assume that the OS system timers are monotonic " >>>> \ >>>> "(Solaris and OS X)") >>>> \ >>> >>> Sounds good. Will you close 6864866 as a duplicate of this one? >> >> I will include 6864866 in the hg commit message closing both with the >> same fix. >> >>> >>>>> os.hpp: >>>>> >>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>> # include "jvm_bsd.h" >>>>> # include >>>>> + # include >>>>> #endif >>>>> >>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>> >>>> Changed it to: >>>> >>>> #ifdef TARGET_OS_FAMILY_bsd >>>> # include "jvm_bsd.h" >>>> # include >>>> # ifdef __APPLE__ >>>> # include >>>> # endif >>> >>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >> >> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >> >> Thanks, >> /Staffan >> >>> >>> Thanks, >>> David >>> >>>> >>>> Thanks, >>>> /Staffan >>>> >>>>> >>>>> -- >>>>> >>>>> We should really fix the non-monotonic-clock path in the Linux and >>>>> Windows implementations too ... but 32-bit is problematic >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>> Here is an updated webrev with changes to the comments in >>>>>> os_bsd.cpp and >>>>>> os_solaris.cpp. >>>>>> - obs -> obsv >>>>>> - fixed URL to blog entry >>>>>> >>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>> >>>>>> /Staffan >>>>>> >>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>> >>>>>> > wrote: >>>>>> >>>>>>> >>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>> >>>>>>> > wrote: >>>>>>> >>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>> can get. >>>>>>>> >>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>> already, but others on this list don?t. >>>>>>> >>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>> >>>>>>>> >>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>> we implement safeguards for this to make sure we never return a >>>>>>>>> lower >>>>>>>>> value than the previous values. This adds some overhead to >>>>>>>>> nanoTime() >>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>> >>>>>>>> I now wonder if this safeguard can produce a stream of exactly >>>>>>>> the same >>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having >>>>>>>> this >>>>>>>> safeguard seems OK. >>>>>>>> >>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>> >>>>>>>> This looks good to me. >>>>>>> >>>>>>> Thanks. >>>>>>> >>>>>>>> And, since this question will inevitably pop up, do we plan to >>>>>>>> bring it >>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>> >>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>> station, but perhaps 8u40? >>>>>>> >>>>>>> /Staffan >> From david.holmes at oracle.com Tue Apr 15 12:22:24 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Apr 2014 22:22:24 +1000 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> Message-ID: <534D2480.8070108@oracle.com> Hi Karen, The primary use of getTimeNanos() is the Java System.nanoTime() call. It is used for timestamping and tracking elapsed time. Time going backwards can cause hangs, inconsistent output etc. Some places in the VM also switched to using getTimeNanos for a monotonic clock source where they were incorrectly using the non-monotonic javaTimeMillis. But we're more wary of things not actually being monotonic these days - once bitten ... But note that the monotonicity check can also cause hangs, or at least delays, due to time standing still. We've had a number of bugs filed on that in the past. So things can go wrong either way. We guard against a buggy OS where we can, but I think we need to be able to tell the VM there is no need. I don't believe the VM can reliably detect known good or known bad situations - nor would we want to have to maintain such knowledge in my opinion. David ----- On 15/04/2014 10:00 PM, Karen Kinnear wrote: > Staffan, > > Have you heard back from the Solaris folks yet on how to tell that we > are on a virtual machine, and > where they tell us gethhrtime can move backward? > > Is there any thought that in cases where we know there is a problem we > might not want to > follow a script's flag recommendation? > > I have been in too many situations in which scripts for starting java > applications are inherited on > systems that are not appropriate, by folks who didn't write them and > don't know the history > of the flag settings. > > I am concerned about subtle unexpected behaviors here. > > Since I haven't had time (yet - sorry) to walk through all the callers > of getTimeNanos - could > you possibly let me know if there is a java call that ultimately uses > this and if so, the impact > on java code of time moving backward? > > Same for callers in the vm please? I believe Ramki fixed at least one of > the garbage collectors > that had problems if time moved backward. Are the vm internal callers ok > if time moves backwards? > > Or I can do that research when I get the time - and I can get back to > you on that tomorrow - sorry, > another day of back-to-back meetings. > > thanks, > Karen > > On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: > >> >> On 15 apr 2014, at 11:38, David Holmes > > wrote: >> >>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>> >>>> On 15 apr 2014, at 09:14, David Holmes >>> > wrote: >>>> >>>>> Hi Staffan, >>>>> >>>>> Generally looks okay. >>>>> >>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>> >>>> I had forgotten to save the file. :-( >>>> >>>>> os_solaris.cpp: >>>>> >>>>> In the Solaris changes there is a lot of old code with inaccurate >>>>> comments, but I suppose cleaning that up (oldgetTimeNanos()) is out >>>>> of scope. You only added the check for AssumeMonotonicOSTimers in >>>>> the supports_cx8 path, but the other path is now dead code. >>>> >>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is >>>> defined) on both solaris sparc and solaris x86, it looks like >>>> oldgetTimeNanos() is really dead code. I can remove it as part of >>>> this change if that?s ok. >>> >>> I'm in favour of removing dead code. :) >> >> Gone! >> >>>>> globals.hpp >>>>> >>>>> Do we need to document this only affects OSX and Solaris? (Though >>>>> implicitly this acts as-if true on Linux and Windows in the common >>>>> case.) >>>> >>>> I will update the description to: >>>> >>>> experimental(bool, AssumeMonotonicOSTimers, false, >>>> \ >>>> "Assume that the OS system timers are monotonic " >>>> \ >>>> "(Solaris and OS X)") >>>> \ >>> >>> Sounds good. Will you close 6864866 as a duplicate of this one? >> >> I will include 6864866 in the hg commit message closing both with the >> same fix. >> >>> >>>>> os.hpp: >>>>> >>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>> # include "jvm_bsd.h" >>>>> # include >>>>> + # include >>>>> #endif >>>>> >>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>> >>>> Changed it to: >>>> >>>> #ifdef TARGET_OS_FAMILY_bsd >>>> # include "jvm_bsd.h" >>>> # include >>>> # ifdef __APPLE__ >>>> # include >>>> # endif >>> >>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >> >> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >> >> Thanks, >> /Staffan >> >>> >>> Thanks, >>> David >>> >>>> >>>> Thanks, >>>> /Staffan >>>> >>>>> >>>>> -- >>>>> >>>>> We should really fix the non-monotonic-clock path in the Linux and >>>>> Windows implementations too ... but 32-bit is problematic >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>> Here is an updated webrev with changes to the comments in >>>>>> os_bsd.cpp and >>>>>> os_solaris.cpp. >>>>>> - obs -> obsv >>>>>> - fixed URL to blog entry >>>>>> >>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>> >>>>>> /Staffan >>>>>> >>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>> >>>>>> > wrote: >>>>>> >>>>>>> >>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>> >>>>>>> > wrote: >>>>>>> >>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but >>>>>>>>> with >>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>> can get. >>>>>>>> >>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>> already, but others on this list don?t. >>>>>>> >>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>> >>>>>>>> >>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>> we implement safeguards for this to make sure we never return a >>>>>>>>> lower >>>>>>>>> value than the previous values. This adds some overhead to >>>>>>>>> nanoTime() >>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>> >>>>>>>> I now wonder if this safeguard can produce a stream of exactly >>>>>>>> the same >>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>> alternative of answering the retrograde time, and the >>>>>>>> observation the >>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, >>>>>>>> having this >>>>>>>> safeguard seems OK. >>>>>>>> >>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>> >>>>>>>> This looks good to me. >>>>>>> >>>>>>> Thanks. >>>>>>> >>>>>>>> And, since this question will inevitably pop up, do we plan to >>>>>>>> bring it >>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>> >>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>> station, but perhaps 8u40? >>>>>>> >>>>>>> /Staffan >> > From staffan.larsen at oracle.com Tue Apr 15 12:27:34 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 15 Apr 2014 14:27:34 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> Message-ID: On 15 apr 2014, at 14:00, Karen Kinnear wrote: > Staffan, > > Have you heard back from the Solaris folks yet on how to tell that we are on a virtual machine, and > where they tell us gethhrtime can move backward? I have not. It would be interesting to know this. > > Is there any thought that in cases where we know there is a problem we might not want to > follow a script's flag recommendation? The default with my change is to guard against time moving backwards. If you want the ?scary? behavior you have to say -XX:+UnlockExperimentalFeatures -XX:+AssumeMonotonicOSTimers?. > > I have been in too many situations in which scripts for starting java applications are inherited on > systems that are not appropriate, by folks who didn't write them and don't know the history > of the flag settings. > > I am concerned about subtle unexpected behaviors here. > > Since I haven't had time (yet - sorry) to walk through all the callers of getTimeNanos - could > you possibly let me know if there is a java call that ultimately uses this and if so, the impact > on java code of time moving backward? Well.. the most obvious case is System.nanoTime(). It must not move backwards. But with the current code (before my change) it can do so on OS X (!). > > Same for callers in the vm please? I believe Ramki fixed at least one of the garbage collectors > that had problems if time moved backward. Are the vm internal callers ok if time moves backwards? Again, There should be no moving backwards unless you run with experimental features. Thanks, /Staffan > > Or I can do that research when I get the time - and I can get back to you on that tomorrow - sorry, > another day of back-to-back meetings. > > thanks, > Karen > > On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: > >> >> On 15 apr 2014, at 11:38, David Holmes wrote: >> >>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>> >>>> On 15 apr 2014, at 09:14, David Holmes wrote: >>>> >>>>> Hi Staffan, >>>>> >>>>> Generally looks okay. >>>>> >>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>> >>>> I had forgotten to save the file. :-( >>>> >>>>> os_solaris.cpp: >>>>> >>>>> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. >>>> >>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. >>> >>> I'm in favour of removing dead code. :) >> >> Gone! >> >>>>> globals.hpp >>>>> >>>>> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) >>>> >>>> I will update the description to: >>>> >>>> experimental(bool, AssumeMonotonicOSTimers, false, \ >>>> "Assume that the OS system timers are monotonic " \ >>>> "(Solaris and OS X)") \ >>> >>> Sounds good. Will you close 6864866 as a duplicate of this one? >> >> I will include 6864866 in the hg commit message closing both with the same fix. >> >>> >>>>> os.hpp: >>>>> >>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>> # include "jvm_bsd.h" >>>>> # include >>>>> + # include >>>>> #endif >>>>> >>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>> >>>> Changed it to: >>>> >>>> #ifdef TARGET_OS_FAMILY_bsd >>>> # include "jvm_bsd.h" >>>> # include >>>> # ifdef __APPLE__ >>>> # include >>>> # endif >>> >>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >> >> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >> >> Thanks, >> /Staffan >> >>> >>> Thanks, >>> David >>> >>>> >>>> Thanks, >>>> /Staffan >>>> >>>>> >>>>> -- >>>>> >>>>> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>>>>> os_solaris.cpp. >>>>>> - obs -> obsv >>>>>> - fixed URL to blog entry >>>>>> >>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>> >>>>>> /Staffan >>>>>> >>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>> > wrote: >>>>>> >>>>>>> >>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>> > wrote: >>>>>>> >>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>> can get. >>>>>>>> >>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>> already, but others on this list don?t. >>>>>>> >>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>> >>>>>>>> >>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>> we implement safeguards for this to make sure we never return a lower >>>>>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>> >>>>>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>>>>> safeguard seems OK. >>>>>>>> >>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>> >>>>>>>> This looks good to me. >>>>>>> >>>>>>> Thanks. >>>>>>> >>>>>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>> >>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>> station, but perhaps 8u40? >>>>>>> >>>>>>> /Staffan >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuenag at gmail.com Tue Apr 15 13:38:17 2014 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Tue, 15 Apr 2014 22:38:17 +0900 Subject: -XX:MetaspaceSize is correct? In-Reply-To: References: <5345498F.20904@gmail.com> <5345C0F0.7020606@oracle.com> <53468C96.6080107@gmail.com> <534C6814.4050202@oracle.com> Message-ID: <534D3649.9090506@gmail.com> I uploaded new webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8039867/webrev.01/ Please review and sponsoring. Yasumasa On 04/15/2014 12:48 PM, Yasumasa Suenaga wrote: > Jon, > > I agree with you. > > MetaspaceSize is used as minimum value when JVM shrink capacity in > MetaspaceGC::compute_new_size() . > So I will change description to "minimum" and upload new webrev. > > > Yasumasa > > 2014-04-15 7:58 GMT+09:00, Jon Masamitsu : >> Yasumasa, >> >> It's hard to describe what this parameter is in a single >> sentence. "high-water-mark" doesn't mean much unless >> you know about how it is used in the GC. Although >> "initial" is not right in the description, "minimum" might >> be closer to a good description. I'm really not sure. >> >> Jon >> >> On 04/10/2014 05:20 AM, Yasumasa Suenaga wrote: >>> I uploaded webrev: >>> http://cr.openjdk.java.net/~ysuenaga/JDK-8039867/webrev.00/ >>> >>> Please review and sponsoring! >>> >>> >>> Yasumasa >>> >>> >>> On 04/10/2014 12:37 PM, Yasumasa Suenaga wrote: >>>> Hi Jon, >>>> Thank you for replying. >>>> >>>> I filed this issue as JDK-8039867: Incorrect description: >>>> -XX:MetaspaceSize . >>>> >>>> I attached a patch to this entry. >>>> I will upload webrev later. >>>> >>>> >>>> Thanks, >>>> >>>> Yasumasa >>>> >>>> >>>> >>>> 2014-04-10 6:51 GMT+09:00, Jon Masamitsu : >>>>> On 04/09/2014 06:22 AM, Yasumasa Suenaga wrote: >>>>>> Hi all, >>>>>> >>>>>> I checked initial metaspace size through jcmd PerfCounter.print . >>>>>> However, it seems to be incorrect: >>>>>> >>>>>> - Java command: >>>>>> java -XX:-UseCompressedClassPointers -XX:+PrintFlagsFinal LongSleep >>>>>> >>>>>> - Output from -XX:+PrintFlagsFinal: >>>>>> uintx MetaspaceSize = >>>>>> 21807104 {pd product} >>>>>> >>>>>> - Result of "PerfCounter.print" >>>>>> sun.gc.metaspace.capacity=4194304 >>>>>> sun.gc.metaspace.maxCapacity=8388608 >>>>>> sun.gc.metaspace.minCapacity=0 >>>>>> >>>>>> >>>>>> I checked metaspace.cpp, initial size of metaspace is detected by >>>>>> InitialBootClassLoaderMetaspaceSize. >>>>>> However, description of MetaspaceSize in globals.hpp is >>>>>> "Initial size of Metaspaces (in bytes)" . >>>>>> >>>>>> Is description of MetaspaceSize is correct? >>>>> Description is not correct. >>>>> >>>>>> And this behavior is correct? >>>>> Behavior is correct. >>>>> >>>>>> I have two plan for this mismatch: >>>>>> >>>>>> A) Change description of MetaspaceSize >>>>>> MetaspaceSize is used to HWM in metaspace.cpp . >>>>>> So we should change description for this behavior. >>>>>> ------------ >>>>>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>>>>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>>>>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>>>>> @@ -3160,7 +3156,7 @@ >>>>>> "non-daemon thread (in >>>>>> bytes)") \ >>>>>> \ >>>>>> product_pd(uintx, >>>>>> MetaspaceSize, \ >>>>>> - "Initial size of Metaspaces (in >>>>>> bytes)") \ >>>>>> + "Initial HWM of Metaspaces (in >>>>>> bytes)") \ >>>>> Explain what HWM is if you're going to use it. >>>>> >>>>>> \ >>>>>> product(uintx, MaxMetaspaceSize, >>>>>> max_uintx, \ >>>>>> "Maximum size of Metaspaces (in >>>>>> bytes)") \ >>>>>> ------------ >>>>>> >>>>>> B) Remove InitialBootClassLoaderMetaspaceSize and use MetaspaceSize >>>>>> In currently, InitialBootClassLoaderMetaspaceSize is used to >>>>>> initialize >>>>>> metaspace. >>>>>> InitialBootClassLoaderMetaspaceSize is only to use for it. >>>>>> Thus we should remove this option and use MetaspaceSize to >>>>>> initialize >>>>>> metaspace. >>>>> InitialBootClassLoaderMetaspaceSize is an optimization. It allows >>>>> approximately >>>>> enough space for the system classes without repeated allocations of >>>>> Metaspaces. >>>>> Not everyone agrees with this optimization but I would like it kept. >>>>> >>>>>> ------------ >>>>>> diff -r 48ce2e6e1add src/share/vm/memory/metaspace.cpp >>>>>> --- a/src/share/vm/memory/metaspace.cpp Fri Apr 04 10:04:44 2014 -0700 >>>>>> +++ b/src/share/vm/memory/metaspace.cpp Wed Apr 09 22:05:18 2014 +0900 >>>>>> @@ -3172,7 +3172,7 @@ >>>>>> #endif >>>>>> >>>>>> // Initialize these before initializing the VirtualSpaceList >>>>>> - _first_chunk_word_size = InitialBootClassLoaderMetaspaceSize / >>>>>> BytesPerWord; >>>>>> + _first_chunk_word_size = MetaspaceSize / BytesPerWord; >>>>>> _first_chunk_word_size = >>>>>> align_word_size_up(_first_chunk_word_size); >>>>>> // Make the first class chunk bigger than a medium chunk so it's >>>>>> not put >>>>>> // on the medium chunk list. The next chunk will be small and >>>>>> progress >>>>>> diff -r 48ce2e6e1add src/share/vm/runtime/globals.hpp >>>>>> --- a/src/share/vm/runtime/globals.hpp Fri Apr 04 10:04:44 2014 -0700 >>>>>> +++ b/src/share/vm/runtime/globals.hpp Wed Apr 09 22:05:18 2014 +0900 >>>>>> @@ -2333,10 +2333,6 @@ >>>>>> develop(bool, TraceClassLoaderData, >>>>>> false, \ >>>>>> "Trace class loader loader_data >>>>>> lifetime") \ >>>>>> \ >>>>>> - product(uintx, >>>>>> InitialBootClassLoaderMetaspaceSize, \ >>>>>> - NOT_LP64(2200*K) >>>>>> LP64_ONLY(4*M), \ >>>>>> - "Initial size of the boot class loader data >>>>>> metaspace") \ >>>>>> - \ >>>>>> product(bool, TraceGen0Time, >>>>>> false, \ >>>>>> "Trace accumulated time for Gen 0 >>>>>> collection") \ >>>>>> \ >>>>>> ------------ >>>>>> >>>>>> I prefer "B" . >>>>>> Because, I guess many users think MetaspaceSize decides initial >>>>>> metaspace size. >>>>>> >>>>>> If my idea is correct, I will file this to JBS and upload patch to >>>>>> webrev. >>>>> Please only correct the description of MetaspaceSize. >>>>> >>>>> Jon >>>>> >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Yasumasa >>>>>> >>>>> >>> >> >> From tim.bell at oracle.com Tue Apr 15 15:45:14 2014 From: tim.bell at oracle.com (Tim Bell) Date: Tue, 15 Apr 2014 15:45:14 +0000 Subject: 8u Trivial RFR: 8039891: Remove ppcsflt builds from JPRT In-Reply-To: <534B636C.2020309@oracle.com> References: <534B636C.2020309@oracle.com> Message-ID: <534D540A.3060803@oracle.com> On 04/14/14 04:26, David Holmes wrote: > This is the 8u version. It is different to the 9 version as the > jprt.properties file differs from release to release. > > http://cr.openjdk.java.net/~dholmes/8039891/webrev.8u/ > > Pushing to jdk8u/hs-dev/hotspot Sorry for the late reply, but for the record: Looks good to me from a JPRT point of view. Tim From david.simms at oracle.com Tue Apr 15 15:57:07 2014 From: david.simms at oracle.com (David Simms) Date: Tue, 15 Apr 2014 17:57:07 +0200 Subject: RFR(M): [TESTBUG] runtime/threads/CancellableThreadTest fails with OOM on windows-i586 In-Reply-To: <002301cf5854$46132270$d2396750$@oracle.com> References: <002301cf5854$46132270$d2396750$@oracle.com> Message-ID: <534D56D3.40005@oracle.com> Looks good ! On 15/04/2014 4:41 a.m., Christian Tornqvist wrote: > > Hi everyone, > > This is a port (and fix) of CancellableThreadTest from one of our > internal harnesses to jtreg in OpenJDK. The original test suffered > from issues with spawning too many threads on 32bit Windows, when > running with WoW64 we have 2 stacks for each thread and usually ran > out of process space. > > I cleaned the test up a bit but the functionality of the test should > be the same, also limited the number of threads to 256 (128 pairs) > down from 2048 (1024 pairs). > > Webrev can be found at: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8035173/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8035173 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.spitsyn at oracle.com Tue Apr 15 18:41:39 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Tue, 15 Apr 2014 11:41:39 -0700 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <534D1EC4.2090804@oracle.com> Message-ID: <534D7D63.8050106@oracle.com> It looks good. Thanks, Serguei On 4/15/14 5:21 AM, Staffan Larsen wrote: > On 15 apr 2014, at 13:57, David Holmes wrote: > >> Hi Staffan, >> >> For the solaris changes ... >> >> This comment is not accurate from the original code: >> >> 1367 // gethrtime can move backwards if read from one cpu and then a different cpu >> 1368 // getTimeNanos is guaranteed to not move backward on Solaris >> 1369 // AssumeMonotonicOSTimers can be used to remove this guarantee. >> >> can I suggest >> >> // gethrtime should be monotonic but has had bugs in the past. >> // getTimeNanos must be guaranteed not to move backwards, so we add a >> // check in case gethrtime is buggy. >> // AssumeMonotonicOSTimers can be set to remove this additional check. > Fixed. > >> With regard to code deletion this seems to be dead code now as well: >> >> 350 const int LOCK_BUSY = 1; >> 351 const int LOCK_FREE = 0; >> 352 const int LOCK_INVALID = -1; >> >> 354 static volatile int max_hrtime_lock = LOCK_FREE; // Update counter with LSB as lock-in-progress > Fixed. > > New version: http://cr.openjdk.java.net/~sla/8040140/webrev.03/ > > /Staffan > >> Thanks, >> David >> >> >> On 15/04/2014 9:42 PM, Staffan Larsen wrote: >>> On 15 apr 2014, at 11:38, David Holmes >> > wrote: >>> >>>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>>> On 15 apr 2014, at 09:14, David Holmes >>>> > wrote: >>>>> >>>>>> Hi Staffan, >>>>>> >>>>>> Generally looks okay. >>>>>> >>>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>>> I had forgotten to save the file. :-( >>>>> >>>>>> os_solaris.cpp: >>>>>> >>>>>> In the Solaris changes there is a lot of old code with inaccurate >>>>>> comments, but I suppose cleaning that up (oldgetTimeNanos()) is out >>>>>> of scope. You only added the check for AssumeMonotonicOSTimers in >>>>>> the supports_cx8 path, but the other path is now dead code. >>>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is >>>>> defined) on both solaris sparc and solaris x86, it looks like >>>>> oldgetTimeNanos() is really dead code. I can remove it as part of >>>>> this change if that?s ok. >>>> I'm in favour of removing dead code. :) >>> Gone! >>> >>>>>> globals.hpp >>>>>> >>>>>> Do we need to document this only affects OSX and Solaris? (Though >>>>>> implicitly this acts as-if true on Linux and Windows in the common >>>>>> case.) >>>>> I will update the description to: >>>>> >>>>> experimental(bool, AssumeMonotonicOSTimers, false, >>>>> \ >>>>> "Assume that the OS system timers are monotonic " >>>>> \ >>>>> "(Solaris and OS X)") >>>>> \ >>>> Sounds good. Will you close 6864866 as a duplicate of this one? >>> I will include 6864866 in the hg commit message closing both with the >>> same fix. >>> >>>>>> os.hpp: >>>>>> >>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>> # include "jvm_bsd.h" >>>>>> # include >>>>>> + # include >>>>>> #endif >>>>>> >>>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>>> Changed it to: >>>>> >>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>> # include "jvm_bsd.h" >>>>> # include >>>>> # ifdef __APPLE__ >>>>> # include >>>>> # endif >>>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >>> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >>> >>> Thanks, >>> /Staffan >>> >>>> Thanks, >>>> David >>>> >>>>> Thanks, >>>>> /Staffan >>>>> >>>>>> -- >>>>>> >>>>>> We should really fix the non-monotonic-clock path in the Linux and >>>>>> Windows implementations too ... but 32-bit is problematic >>>>>> >>>>>> Thanks, >>>>>> David >>>>>> >>>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>>> Here is an updated webrev with changes to the comments in >>>>>>> os_bsd.cpp and >>>>>>> os_solaris.cpp. >>>>>>> - obs -> obsv >>>>>>> - fixed URL to blog entry >>>>>>> >>>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>>> >>>>>>> /Staffan >>>>>>> >>>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>> >>>>>>> > wrote: >>>>>>> >>>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>>> >>>>>>>> > wrote: >>>>>>>> >>>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>>> can get. >>>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>>> already, but others on this list don?t. >>>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>>> >>>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>>> we implement safeguards for this to make sure we never return a >>>>>>>>>> lower >>>>>>>>>> value than the previous values. This adds some overhead to >>>>>>>>>> nanoTime() >>>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>>> I now wonder if this safeguard can produce a stream of exactly >>>>>>>>> the same >>>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having >>>>>>>>> this >>>>>>>>> safeguard seems OK. >>>>>>>>> >>>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>>> This looks good to me. >>>>>>>> Thanks. >>>>>>>> >>>>>>>>> And, since this question will inevitably pop up, do we plan to >>>>>>>>> bring it >>>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>>> station, but perhaps 8u40? >>>>>>>> >>>>>>>> /Staffan From christian.tornqvist at oracle.com Tue Apr 15 21:25:55 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Tue, 15 Apr 2014 17:25:55 -0400 Subject: RFR 8u20 Backport of 8016644 and 8034781 Message-ID: <03a301cf58f1$495a6fe0$dc0f4fa0$@oracle.com> Hi everyone, Requesting a quick review of backport to 8u20 for: 8016644 - Improve UnsupportedClassVersionError message https://bugs.openjdk.java.net/browse/JDK-8016644 http://cr.openjdk.java.net/~ctornqvi/webrev/8016644/webrev.01/ and 8034781 - [TESTBUG] runtime/ClassFileUnsupportedClassFileVersion.java unable to find or load main class https://bugs.openjdk.java.net/browse/JDK-8034781 http://cr.openjdk.java.net/~ctornqvi/webrev/8034781/webrev.00/ both patches applied cleanly. Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Tue Apr 15 21:28:16 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Tue, 15 Apr 2014 17:28:16 -0400 Subject: RFR 8u20 Backport of 8016644 and 8034781 In-Reply-To: <03a301cf58f1$495a6fe0$dc0f4fa0$@oracle.com> References: <03a301cf58f1$495a6fe0$dc0f4fa0$@oracle.com> Message-ID: <534DA470.1040002@oracle.com> Looks good. Coleen On 4/15/14, 5:25 PM, Christian Tornqvist wrote: > > Hi everyone, > > Requesting a quick review of backport to 8u20 for: > > 8016644 - Improve UnsupportedClassVersionError message > > https://bugs.openjdk.java.net/browse/JDK-8016644 > > http://cr.openjdk.java.net/~ctornqvi/webrev/8016644/webrev.01/ > > > and > > 8034781 - [TESTBUG] runtime/ClassFileUnsupportedClassFileVersion.java > unable to find or load main class > > https://bugs.openjdk.java.net/browse/JDK-8034781 > > http://cr.openjdk.java.net/~ctornqvi/webrev/8034781/webrev.00/ > > > both patches applied cleanly. > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Tue Apr 15 21:32:31 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Tue, 15 Apr 2014 17:32:31 -0400 Subject: RFR 8u20 Backport of 8016644 and 8034781 In-Reply-To: <03a301cf58f1$495a6fe0$dc0f4fa0$@oracle.com> References: <03a301cf58f1$495a6fe0$dc0f4fa0$@oracle.com> Message-ID: <534DA56F.1020409@oracle.com> Hi Christian, looks good! Lois On 4/15/2014 5:25 PM, Christian Tornqvist wrote: > > Hi everyone, > > Requesting a quick review of backport to 8u20 for: > > 8016644 - Improve UnsupportedClassVersionError message > > https://bugs.openjdk.java.net/browse/JDK-8016644 > > http://cr.openjdk.java.net/~ctornqvi/webrev/8016644/webrev.01/ > > > and > > 8034781 - [TESTBUG] runtime/ClassFileUnsupportedClassFileVersion.java > unable to find or load main class > > https://bugs.openjdk.java.net/browse/JDK-8034781 > > http://cr.openjdk.java.net/~ctornqvi/webrev/8034781/webrev.00/ > > > both patches applied cleanly. > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Tue Apr 15 21:39:23 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Tue, 15 Apr 2014 17:39:23 -0400 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 Message-ID: <534DA70B.70303@oracle.com> Please review backports of these bug fixes in JDK9. Nightly testing has been running this code for a few nights now. 8035735: Metaspace::contains become extremely slow in some cases Summary: Call is_metadata instead which does less work for the call in debugInfo.hpp which is called for all compiled code stack frames. Reviewed-by: jmasa, dcubed https://bugs.openjdk.java.net/browse/JDK-8035735 http://cr.openjdk.java.net/~coleenp/8035735/ (changeset applied cleanly) 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool) Summary: Keep class in CLD::_klasses list and mirror created for CDS classes if OOM during restore_shareable_info(). This keeps pointers consistent for CMS. Reviewed-by: ehelin, stefank, jmasa, iklam http://cr.openjdk.java.net/~coleenp/8028497_4/ https://bugs.openjdk.java.net/browse/JDK-8028497 (changeset had one difference because of name change from this_oop to this_k). 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) failed: Bad size calculated" Summary: Dtrace monitoring uses size before mirror size is set. Reviewed-by: kamg, hseigel http://cr.openjdk.java.net/~coleenp/8039904/ https://bugs.openjdk.java.net/browse/JDK-8039904 (changeset applied cleanly) Thanks, Coleen From marcus.larsson at oracle.com Wed Apr 16 10:04:26 2014 From: marcus.larsson at oracle.com (Marcus Larsson) Date: Wed, 16 Apr 2014 12:04:26 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <533D5F54.4060202@oracle.com> References: <533D5F54.4060202@oracle.com> Message-ID: <534E55AA.1070607@oracle.com> Hi again, I need another round of review for this fix. Found a problem with the patch and had to update it, also added an internal VM test for it. Built and tested on all platforms with JPRT. Updated webrev at: http://cr.openjdk.java.net/~dsimms/6664815/ Thanks, Marcus On 04/03/2014 03:17 PM, Marcus Larsson wrote: > Hello, > > I would like reviews for the following bugfix removing a redundant > memcpy. > Built on all platforms and tested with JCK. > > Webrev: > http://cr.openjdk.java.net/~dsimms/6664815/ > > Bug: > https://bugs.openjdk.java.net/browse/JDK-6664815 > > Regards, > Marcus From lev.priima at oracle.com Wed Apr 16 11:58:46 2014 From: lev.priima at oracle.com (Lev Priima) Date: Wed, 16 Apr 2014 15:58:46 +0400 Subject: [9] RFR (XS): 8039260: c.o.j.t.ProcessTools::createJavaProcessBuilder(boolean, String... ) must also take test.java.opts In-Reply-To: <5347D5F8.4060800@oracle.com> References: <5347D5F8.4060800@oracle.com> Message-ID: <534E7076.5050604@oracle.com> adding other aliases explicitly Lev On 04/11/2014 03:46 PM, Lev Priima wrote: > Hi all, > > Please review small patch: > > http://cr.openjdk.java.net/~iignatyev/lpriima/8039260/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8039260 > 6 lines changed: 0 ins; 3 del; 3 mod; > > Problem: > method c.o.j.t.ProcessTools::createJavaProcessBuilder(boolean > addTestVmOptions, String... command) starts "java" launcher without > passing to it "test.java.opts" received from jtreg harness. > > Fix: > Add both "test.vm.opts" and "test.java.opts" to newly created java > process by new parameter name "addTestVmAndJavaOptions" > > Testing: jprt default set + all hotspot regression tests > From dmitry.samersoff at oracle.com Wed Apr 16 12:56:56 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Wed, 16 Apr 2014 16:56:56 +0400 Subject: RFR(XS): JDK-6904403 assert(f == k->has_finalizer(),"inconsistent has_finalizer") with debug VM Message-ID: <534E7E18.3030308@oracle.com> Hi Everybody, Please review small changes. http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.01/ This fix tells to JVM to don't assert if the class was redefined. Please notice, these changes doesn't make redefined finalyzers working. It's a large project which is out of scope of this changes. -Dmitry -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From lois.foltan at oracle.com Wed Apr 16 15:46:58 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 16 Apr 2014 11:46:58 -0400 Subject: [8u20] RFR Backport of JDK-8037806: constraint on multianewarray instruction is not checked since class version 50 Message-ID: <534EA5F2.2020201@oracle.com> Please approve the backport of JDK-8037806 to jdk8u. The changeset applied cleanly. The bug: https://bugs.openjdk.java.net/browse/JDK-8038076 The webrev: http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076_8u/ The jdk9 changeset: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/8196842abf5c Thanks, Lois From george.triantafillou at oracle.com Wed Apr 16 15:53:19 2014 From: george.triantafillou at oracle.com (George Triantafillou) Date: Wed, 16 Apr 2014 11:53:19 -0400 Subject: [8u20] RFR Backport of JDK-8037806: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <534EA5F2.2020201@oracle.com> References: <534EA5F2.2020201@oracle.com> Message-ID: <534EA76F.9030904@oracle.com> Lois, Looks good. -George On 4/16/2014 11:46 AM, Lois Foltan wrote: > Please approve the backport of JDK-8037806 to jdk8u. The changeset > applied cleanly. > > The bug: > https://bugs.openjdk.java.net/browse/JDK-8038076 > > The webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076_8u/ > > The jdk9 changeset: > http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/8196842abf5c > > Thanks, > Lois From coleen.phillimore at oracle.com Wed Apr 16 15:53:35 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 16 Apr 2014 11:53:35 -0400 Subject: [8u20] RFR Backport of JDK-8037806: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <534EA5F2.2020201@oracle.com> References: <534EA5F2.2020201@oracle.com> Message-ID: <534EA77F.1000706@oracle.com> Looks good. Coleen On 4/16/14, 11:46 AM, Lois Foltan wrote: > Please approve the backport of JDK-8037806 to jdk8u. The changeset > applied cleanly. > > The bug: > https://bugs.openjdk.java.net/browse/JDK-8038076 > > The webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076_8u/ > > The jdk9 changeset: > http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/8196842abf5c > > Thanks, > Lois From daniel.daugherty at oracle.com Wed Apr 16 16:35:31 2014 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Wed, 16 Apr 2014 10:35:31 -0600 Subject: [8u20] RFR Backport of JDK-8037806: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <534EA5F2.2020201@oracle.com> References: <534EA5F2.2020201@oracle.com> Message-ID: <534EB153.6050008@oracle.com> The right bug ID for this is: 8038076. Please make sure that bug ID is used for the commit instead of 8037806. Dan On 4/16/14 9:46 AM, Lois Foltan wrote: > Please approve the backport of JDK-8037806 to jdk8u. The changeset > applied cleanly. > > The bug: > https://bugs.openjdk.java.net/browse/JDK-8038076 > > The webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076_8u/ > > The jdk9 changeset: > http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/8196842abf5c > > Thanks, > Lois From lois.foltan at oracle.com Wed Apr 16 16:37:20 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 16 Apr 2014 12:37:20 -0400 Subject: [8u20] RFR Backport of JDK-8037806: constraint on multianewarray instruction is not checked since class version 50 In-Reply-To: <534EB153.6050008@oracle.com> References: <534EA5F2.2020201@oracle.com> <534EB153.6050008@oracle.com> Message-ID: <534EB1C0.90304@oracle.com> On 4/16/2014 12:35 PM, Daniel D. Daugherty wrote: > The right bug ID for this is: 8038076. Please make sure > that bug ID is used for the commit instead of 8037806. Thanks Dan. You are correct, I realized this after I had sent the RFR. Lois > > Dan > > > On 4/16/14 9:46 AM, Lois Foltan wrote: >> Please approve the backport of JDK-8037806 to jdk8u. The changeset >> applied cleanly. >> >> The bug: >> https://bugs.openjdk.java.net/browse/JDK-8038076 >> >> The webrev: >> http://cr.openjdk.java.net/~lfoltan/bug_jdk8038076_8u/ >> >> The jdk9 changeset: >> http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/8196842abf5c >> >> Thanks, >> Lois > From lois.foltan at oracle.com Wed Apr 16 17:31:15 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 16 Apr 2014 13:31:15 -0400 Subject: [8u20] RFR Backport of JDK-8033150: invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults Message-ID: <534EBE63.6090505@oracle.com> Please approve the backport of JDK-8033150 to jdk8u. The changeset applied cleanly. The bug: https://bugs.openjdk.java.net/browse/JDK-8033150 The webrev: http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150_8u/ The jdk9 changeset: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/e04d3232b9c9 Thanks, Lois From harold.seigel at oracle.com Wed Apr 16 17:49:45 2014 From: harold.seigel at oracle.com (harold seigel) Date: Wed, 16 Apr 2014 13:49:45 -0400 Subject: RFR(XS): JDK-8040018 Remove bad assert in ClassFileParser.cpp Message-ID: <534EC2B9.5090204@oracle.com> Hi, Please review this small change to fix bug JDK-8040018 for JDK-9. The fix removes the assert because it can be triggered by a class file containing an incorrect attribute_length value for the BoostrapMethods attribute, not just by a JVM inconsistency. Removing the assert lets the following guarantee_property() call catch the problem and throw a java.lang.ClassFormatError exception. The fix was tested with JPRT, JCK lang, JCK vm, hotspot jtreg, and nsk quick tests. The new test was tested on Linux and Windows. Open webrev at: http://cr.openjdk.java.net/~hseigel/bug_8040018/ Bug: https://bugs.openjdk.java.net/browse/JDK-8040018 Thanks! Harold From vladimir.kozlov at oracle.com Wed Apr 16 18:01:01 2014 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Wed, 16 Apr 2014 11:01:01 -0700 Subject: [9] RFR (XS): 8039260: c.o.j.t.ProcessTools::createJavaProcessBuilder(boolean, String... ) must also take test.java.opts In-Reply-To: <534E7076.5050604@oracle.com> References: <5347D5F8.4060800@oracle.com> <534E7076.5050604@oracle.com> Message-ID: <534EC55D.6080604@oracle.com> Looks good to me. Thanks, Vladimir On 4/16/14 4:58 AM, Lev Priima wrote: > adding other aliases explicitly > > Lev > > On 04/11/2014 03:46 PM, Lev Priima wrote: >> Hi all, >> >> Please review small patch: >> >> http://cr.openjdk.java.net/~iignatyev/lpriima/8039260/webrev.00/ >> https://bugs.openjdk.java.net/browse/JDK-8039260 >> 6 lines changed: 0 ins; 3 del; 3 mod; >> >> Problem: >> method c.o.j.t.ProcessTools::createJavaProcessBuilder(boolean >> addTestVmOptions, String... command) starts "java" launcher without >> passing to it "test.java.opts" received from jtreg harness. >> >> Fix: >> Add both "test.vm.opts" and "test.java.opts" to newly created java >> process by new parameter name "addTestVmAndJavaOptions" >> >> Testing: jprt default set + all hotspot regression tests >> > From coleen.phillimore at oracle.com Wed Apr 16 18:25:56 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 16 Apr 2014 14:25:56 -0400 Subject: [8u20] RFR Backport of JDK-8033150: invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults In-Reply-To: <534EBE63.6090505@oracle.com> References: <534EBE63.6090505@oracle.com> Message-ID: <534ECB34.8030004@oracle.com> Looks good too. Now if only someone would review mine... Thanks, Coleen On 4/16/14, 1:31 PM, Lois Foltan wrote: > Please approve the backport of JDK-8033150 to jdk8u. The changeset > applied cleanly. > > The bug: > https://bugs.openjdk.java.net/browse/JDK-8033150 > > The webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033150_8u/ > > The jdk9 changeset: > http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/e04d3232b9c9 > > Thanks, > Lois From christian.tornqvist at oracle.com Wed Apr 16 19:13:02 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Wed, 16 Apr 2014 15:13:02 -0400 Subject: RFR (XXS): JDK-6959423 - [TESTBUG] runtime/6925573/SortMethodsTest.java times out Message-ID: <005f01cf59a7$e3e01e00$aba05a00$@oracle.com> Hi everyone, Small fix for issue where this test timed out on slow machines, fixed by decreasing the maximum number of methods. I also decreased the ratio a bit in the hope of having it catch the original issue more reliably. I tested this on a fairly slow Solaris SPARC machine and on my Windows x64 laptop with jdk7-b90 and jdk9-b06, with the changes it reproduced 10/10 times on both machines with jdk7 and passed 10/10 times with jdk9. Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/6959423/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-6959423 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Wed Apr 16 20:12:26 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 16 Apr 2014 16:12:26 -0400 Subject: RFR (XXS): JDK-6959423 - [TESTBUG] runtime/6925573/SortMethodsTest.java times out In-Reply-To: <005f01cf59a7$e3e01e00$aba05a00$@oracle.com> References: <005f01cf59a7$e3e01e00$aba05a00$@oracle.com> Message-ID: <534EE42A.7070108@oracle.com> Looks good. Coleen On 4/16/14, 3:13 PM, Christian Tornqvist wrote: > > Hi everyone, > > Small fix for issue where this test timed out on slow machines, fixed > by decreasing the maximum number of methods. I also decreased the > ratio a bit in the hope of having it catch the original issue more > reliably. > > I tested this on a fairly slow Solaris SPARC machine and on my Windows > x64 laptop with jdk7-b90 and jdk9-b06, with the changes it reproduced > 10/10 times on both machines with jdk7 and passed 10/10 times with jdk9. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/6959423/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-6959423 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.daugherty at oracle.com Wed Apr 16 20:32:05 2014 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Wed, 16 Apr 2014 14:32:05 -0600 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534DA70B.70303@oracle.com> References: <534DA70B.70303@oracle.com> Message-ID: <534EE8C5.5000808@oracle.com> Usually when you request a backport review you supply webrevs relative to the backport target repo. All of the webrevs here appear to the JDK9 webrevs so there's not really any way that a reviewer can verify that your backport is correct. > http://cr.openjdk.java.net/~coleenp/8035735/ src/share/vm/code/debugInfo.hpp src/share/vm/oops/metadata.hpp No comments; I expect this to be a clean backport. > http://cr.openjdk.java.net/~coleenp/8028497_4/ src/share/vm/classfile/classFileParser.cpp src/share/vm/classfile/javaClasses.cpp src/share/vm/classfile/javaClasses.hpp src/share/vm/classfile/systemDictionary.cpp src/share/vm/classfile/systemDictionary.hpp src/share/vm/gc_interface/collectedHeap.cpp src/share/vm/gc_interface/collectedHeap.hpp src/share/vm/oops/constantPool.cpp src/share/vm/oops/instanceKlass.cpp src/share/vm/oops/instanceKlass.hpp src/share/vm/oops/instanceMirrorKlass.cpp src/share/vm/oops/klass.cpp src/share/vm/oops/method.cpp src/share/vm/oops/method.hpp This might be a candidate for a clean backport, but I don't know this code well enough to make that call without a JDK8u relative webrev. > http://cr.openjdk.java.net/~coleenp/8039904/ src/share/vm/gc_interface/collectedHeap.hpp src/share/vm/gc_interface/collectedHeap.inline.hpp src/share/vm/runtime/sharedRuntime.cpp src/share/vm/runtime/sharedRuntime.hpp No comments; I expect this to be a clean backport. Dan On 4/15/14 3:39 PM, Coleen Phillimore wrote: > > Please review backports of these bug fixes in JDK9. Nightly testing > has been running this code for a few nights now. > > 8035735: Metaspace::contains become extremely slow in some cases > Summary: Call is_metadata instead which does less work for the call in > debugInfo.hpp which is called for all compiled code stack frames. > Reviewed-by: jmasa, dcubed > > https://bugs.openjdk.java.net/browse/JDK-8035735 > http://cr.openjdk.java.net/~coleenp/8035735/ > > (changeset applied cleanly) > > 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, > KlassClosure*, bool) > Summary: Keep class in CLD::_klasses list and mirror created for CDS > classes if OOM during restore_shareable_info(). This keeps pointers > consistent for CMS. > Reviewed-by: ehelin, stefank, jmasa, iklam > > http://cr.openjdk.java.net/~coleenp/8028497_4/ > https://bugs.openjdk.java.net/browse/JDK-8028497 > > (changeset had one difference because of name change from this_oop to > this_k). > > 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > 0) > failed: Bad size calculated" > Summary: Dtrace monitoring uses size before mirror size is set. > Reviewed-by: kamg, hseigel > > http://cr.openjdk.java.net/~coleenp/8039904/ > https://bugs.openjdk.java.net/browse/JDK-8039904 > > (changeset applied cleanly) > > Thanks, > Coleen > > > > From coleen.phillimore at oracle.com Wed Apr 16 20:45:23 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 16 Apr 2014 16:45:23 -0400 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534EE8C5.5000808@oracle.com> References: <534DA70B.70303@oracle.com> <534EE8C5.5000808@oracle.com> Message-ID: <534EEBE3.6000502@oracle.com> Dan, 8028497 wasn't a clean backport. instanceKlass.cpp/hpp needed manual edit so I had to patch it. Then I already committed all three to three changesets and tested so I didn't know how to generate a jdk8u relative webrev for each. Do you know how to do this without me rolling back anything? I'm sure there's some magic hg command to do it, I just don't know how. Thanks for the review, Coleen On 4/16/14, 4:32 PM, Daniel D. Daugherty wrote: > Usually when you request a backport review you supply webrevs > relative to the backport target repo. All of the webrevs here > appear to the JDK9 webrevs so there's not really any way that > a reviewer can verify that your backport is correct. > > > http://cr.openjdk.java.net/~coleenp/8035735/ > > src/share/vm/code/debugInfo.hpp > src/share/vm/oops/metadata.hpp > No comments; I expect this to be a clean backport. > > > http://cr.openjdk.java.net/~coleenp/8028497_4/ > > src/share/vm/classfile/classFileParser.cpp > src/share/vm/classfile/javaClasses.cpp > src/share/vm/classfile/javaClasses.hpp > src/share/vm/classfile/systemDictionary.cpp > src/share/vm/classfile/systemDictionary.hpp > src/share/vm/gc_interface/collectedHeap.cpp > src/share/vm/gc_interface/collectedHeap.hpp > src/share/vm/oops/constantPool.cpp > src/share/vm/oops/instanceKlass.cpp > src/share/vm/oops/instanceKlass.hpp > src/share/vm/oops/instanceMirrorKlass.cpp > src/share/vm/oops/klass.cpp > src/share/vm/oops/method.cpp > src/share/vm/oops/method.hpp > This might be a candidate for a clean backport, but I > don't know this code well enough to make that call > without a JDK8u relative webrev. > > > http://cr.openjdk.java.net/~coleenp/8039904/ > > src/share/vm/gc_interface/collectedHeap.hpp > src/share/vm/gc_interface/collectedHeap.inline.hpp > src/share/vm/runtime/sharedRuntime.cpp > src/share/vm/runtime/sharedRuntime.hpp > No comments; I expect this to be a clean backport. > > > Dan > > > On 4/15/14 3:39 PM, Coleen Phillimore wrote: >> >> Please review backports of these bug fixes in JDK9. Nightly testing >> has been running this code for a few nights now. >> >> 8035735: Metaspace::contains become extremely slow in some cases >> Summary: Call is_metadata instead which does less work for the call >> in debugInfo.hpp which is called for all compiled code stack frames. >> Reviewed-by: jmasa, dcubed >> >> https://bugs.openjdk.java.net/browse/JDK-8035735 >> http://cr.openjdk.java.net/~coleenp/8035735/ >> >> (changeset applied cleanly) >> >> 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, >> KlassClosure*, bool) >> Summary: Keep class in CLD::_klasses list and mirror created for CDS >> classes if OOM during restore_shareable_info(). This keeps pointers >> consistent for CMS. >> Reviewed-by: ehelin, stefank, jmasa, iklam >> >> http://cr.openjdk.java.net/~coleenp/8028497_4/ >> https://bugs.openjdk.java.net/browse/JDK-8028497 >> >> (changeset had one difference because of name change from this_oop to >> this_k). >> >> 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > >> 0) failed: Bad size calculated" >> Summary: Dtrace monitoring uses size before mirror size is set. >> Reviewed-by: kamg, hseigel >> >> http://cr.openjdk.java.net/~coleenp/8039904/ >> https://bugs.openjdk.java.net/browse/JDK-8039904 >> >> (changeset applied cleanly) >> >> Thanks, >> Coleen >> >> >> >> > From lois.foltan at oracle.com Wed Apr 16 21:10:27 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 16 Apr 2014 17:10:27 -0400 Subject: RFR (XXS): JDK-6959423 - [TESTBUG] runtime/6925573/SortMethodsTest.java times out In-Reply-To: <005f01cf59a7$e3e01e00$aba05a00$@oracle.com> References: <005f01cf59a7$e3e01e00$aba05a00$@oracle.com> Message-ID: <534EF1C3.2050108@oracle.com> Looks good, minor comment that the copyright needs to be updated. Lois On 4/16/2014 3:13 PM, Christian Tornqvist wrote: > > Hi everyone, > > Small fix for issue where this test timed out on slow machines, fixed > by decreasing the maximum number of methods. I also decreased the > ratio a bit in the hope of having it catch the original issue more > reliably. > > I tested this on a fairly slow Solaris SPARC machine and on my Windows > x64 laptop with jdk7-b90 and jdk9-b06, with the changes it reproduced > 10/10 times on both machines with jdk7 and passed 10/10 times with jdk9. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/6959423/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-6959423 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.tornqvist at oracle.com Wed Apr 16 22:00:38 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Wed, 16 Apr 2014 18:00:38 -0400 Subject: RFR (XXS): JDK-6959423 - [TESTBUG] runtime/6925573/SortMethodsTest.java times out In-Reply-To: <534EF1C3.2050108@oracle.com> References: <005f01cf59a7$e3e01e00$aba05a00$@oracle.com> <534EF1C3.2050108@oracle.com> Message-ID: <00bd01cf59bf$4dde3eb0$e99abc10$@oracle.com> Thanks for the reviews, I'll update the copyright year before pushing the change. Thanks, Christian From: Lois Foltan [mailto:lois.foltan at oracle.com] Sent: Wednesday, April 16, 2014 5:10 PM To: Christian Tornqvist Cc: 'hotspot-runtime-dev' Subject: Re: RFR (XXS): JDK-6959423 - [TESTBUG] runtime/6925573/SortMethodsTest.java times out Looks good, minor comment that the copyright needs to be updated. Lois On 4/16/2014 3:13 PM, Christian Tornqvist wrote: Hi everyone, Small fix for issue where this test timed out on slow machines, fixed by decreasing the maximum number of methods. I also decreased the ratio a bit in the hope of having it catch the original issue more reliably. I tested this on a fairly slow Solaris SPARC machine and on my Windows x64 laptop with jdk7-b90 and jdk9-b06, with the changes it reproduced 10/10 times on both machines with jdk7 and passed 10/10 times with jdk9. Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/6959423/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-6959423 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.daugherty at oracle.com Wed Apr 16 22:36:15 2014 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Wed, 16 Apr 2014 16:36:15 -0600 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534EE8C5.5000808@oracle.com> References: <534DA70B.70303@oracle.com> <534EE8C5.5000808@oracle.com> Message-ID: <534F05DF.5010105@oracle.com> At this point, I've compared Coleen's exported JDK8u changesets with the patch files from the JDK9-hs-rt versions. On 4/16/14 2:32 PM, Daniel D. Daugherty wrote: > Usually when you request a backport review you supply webrevs > relative to the backport target repo. All of the webrevs here > appear to the JDK9 webrevs so there's not really any way that > a reviewer can verify that your backport is correct. > > > http://cr.openjdk.java.net/~coleenp/8035735/ > > src/share/vm/code/debugInfo.hpp > src/share/vm/oops/metadata.hpp > No comments; I expect this to be a clean backport. The patch that Coleen imported for JDK8u includes changes made after the JDK9 webrev was generated (during the code review cycle). So the JDK8u version matches the JDK9 version. Thumbs up! > > http://cr.openjdk.java.net/~coleenp/8028497_4/ > > src/share/vm/classfile/classFileParser.cpp > src/share/vm/classfile/javaClasses.cpp > src/share/vm/classfile/javaClasses.hpp > src/share/vm/classfile/systemDictionary.cpp > src/share/vm/classfile/systemDictionary.hpp > src/share/vm/gc_interface/collectedHeap.cpp > src/share/vm/gc_interface/collectedHeap.hpp > src/share/vm/oops/constantPool.cpp > src/share/vm/oops/instanceKlass.cpp > src/share/vm/oops/instanceKlass.hpp > src/share/vm/oops/instanceMirrorKlass.cpp > src/share/vm/oops/klass.cpp > src/share/vm/oops/method.cpp > src/share/vm/oops/method.hpp > This might be a candidate for a clean backport, but I > don't know this code well enough to make that call > without a JDK8u relative webrev. The patch that Coleen imported for JDK8u is different than the JDK9 webrev version; as Coleen mentioned below there are name changes from 'this_k' -> 'this_oop'. Thumbs up! > > > http://cr.openjdk.java.net/~coleenp/8039904/ > > src/share/vm/gc_interface/collectedHeap.hpp > src/share/vm/gc_interface/collectedHeap.inline.hpp > src/share/vm/runtime/sharedRuntime.cpp > src/share/vm/runtime/sharedRuntime.hpp > No comments; I expect this to be a clean backport. The patch that Coleen imported for JDK8u matches the JDK9 webrev version (modulo copyrights and line numbers). Thumbs up! Dan > > > Dan > > > On 4/15/14 3:39 PM, Coleen Phillimore wrote: >> >> Please review backports of these bug fixes in JDK9. Nightly testing >> has been running this code for a few nights now. >> >> 8035735: Metaspace::contains become extremely slow in some cases >> Summary: Call is_metadata instead which does less work for the call >> in debugInfo.hpp which is called for all compiled code stack frames. >> Reviewed-by: jmasa, dcubed >> >> https://bugs.openjdk.java.net/browse/JDK-8035735 >> http://cr.openjdk.java.net/~coleenp/8035735/ >> >> (changeset applied cleanly) >> >> 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, >> KlassClosure*, bool) >> Summary: Keep class in CLD::_klasses list and mirror created for CDS >> classes if OOM during restore_shareable_info(). This keeps pointers >> consistent for CMS. >> Reviewed-by: ehelin, stefank, jmasa, iklam >> >> http://cr.openjdk.java.net/~coleenp/8028497_4/ >> https://bugs.openjdk.java.net/browse/JDK-8028497 >> >> (changeset had one difference because of name change from this_oop to >> this_k). >> >> 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > >> 0) failed: Bad size calculated" >> Summary: Dtrace monitoring uses size before mirror size is set. >> Reviewed-by: kamg, hseigel >> >> http://cr.openjdk.java.net/~coleenp/8039904/ >> https://bugs.openjdk.java.net/browse/JDK-8039904 >> >> (changeset applied cleanly) >> >> Thanks, >> Coleen >> >> >> >> > > > From coleen.phillimore at oracle.com Wed Apr 16 22:40:51 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 16 Apr 2014 18:40:51 -0400 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534F05DF.5010105@oracle.com> References: <534DA70B.70303@oracle.com> <534EE8C5.5000808@oracle.com> <534F05DF.5010105@oracle.com> Message-ID: <534F06F3.7090308@oracle.com> Thanks Dan for the code review and for creating webrevs for the patches. They are here: open webrev at http://cr.openjdk.java.net/~coleenp/8035735_8u20/0-for-jdk8u-hs open webrev at http://cr.openjdk.java.net/~coleenp/8028497_8u20/0-for-jdk8u-hs open webrev at http://cr.openjdk.java.net/~coleenp/8039904_8u20/0-for-jdk8u-hs Coleen On 4/16/14, 6:36 PM, Daniel D. Daugherty wrote: > At this point, I've compared Coleen's exported JDK8u changesets > with the patch files from the JDK9-hs-rt versions. > > > On 4/16/14 2:32 PM, Daniel D. Daugherty wrote: >> Usually when you request a backport review you supply webrevs >> relative to the backport target repo. All of the webrevs here >> appear to the JDK9 webrevs so there's not really any way that >> a reviewer can verify that your backport is correct. >> >> > http://cr.openjdk.java.net/~coleenp/8035735/ >> >> src/share/vm/code/debugInfo.hpp >> src/share/vm/oops/metadata.hpp >> No comments; I expect this to be a clean backport. > > The patch that Coleen imported for JDK8u includes changes made > after the JDK9 webrev was generated (during the code review cycle). > So the JDK8u version matches the JDK9 version. Thumbs up! > > >> > http://cr.openjdk.java.net/~coleenp/8028497_4/ >> >> src/share/vm/classfile/classFileParser.cpp >> src/share/vm/classfile/javaClasses.cpp >> src/share/vm/classfile/javaClasses.hpp >> src/share/vm/classfile/systemDictionary.cpp >> src/share/vm/classfile/systemDictionary.hpp >> src/share/vm/gc_interface/collectedHeap.cpp >> src/share/vm/gc_interface/collectedHeap.hpp >> src/share/vm/oops/constantPool.cpp >> src/share/vm/oops/instanceKlass.cpp >> src/share/vm/oops/instanceKlass.hpp >> src/share/vm/oops/instanceMirrorKlass.cpp >> src/share/vm/oops/klass.cpp >> src/share/vm/oops/method.cpp >> src/share/vm/oops/method.hpp >> This might be a candidate for a clean backport, but I >> don't know this code well enough to make that call >> without a JDK8u relative webrev. > > The patch that Coleen imported for JDK8u is different > than the JDK9 webrev version; as Coleen mentioned below > there are name changes from 'this_k' -> 'this_oop'. > Thumbs up! > > >> >> > http://cr.openjdk.java.net/~coleenp/8039904/ >> >> src/share/vm/gc_interface/collectedHeap.hpp >> src/share/vm/gc_interface/collectedHeap.inline.hpp >> src/share/vm/runtime/sharedRuntime.cpp >> src/share/vm/runtime/sharedRuntime.hpp >> No comments; I expect this to be a clean backport. > > The patch that Coleen imported for JDK8u matches the > JDK9 webrev version (modulo copyrights and line numbers). > Thumbs up! > > Dan > > >> >> >> Dan >> >> >> On 4/15/14 3:39 PM, Coleen Phillimore wrote: >>> >>> Please review backports of these bug fixes in JDK9. Nightly testing >>> has been running this code for a few nights now. >>> >>> 8035735: Metaspace::contains become extremely slow in some cases >>> Summary: Call is_metadata instead which does less work for the call >>> in debugInfo.hpp which is called for all compiled code stack frames. >>> Reviewed-by: jmasa, dcubed >>> >>> https://bugs.openjdk.java.net/browse/JDK-8035735 >>> http://cr.openjdk.java.net/~coleenp/8035735/ >>> >>> (changeset applied cleanly) >>> >>> 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, >>> KlassClosure*, bool) >>> Summary: Keep class in CLD::_klasses list and mirror created for CDS >>> classes if OOM during restore_shareable_info(). This keeps pointers >>> consistent for CMS. >>> Reviewed-by: ehelin, stefank, jmasa, iklam >>> >>> http://cr.openjdk.java.net/~coleenp/8028497_4/ >>> https://bugs.openjdk.java.net/browse/JDK-8028497 >>> >>> (changeset had one difference because of name change from this_oop >>> to this_k). >>> >>> 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > >>> 0) failed: Bad size calculated" >>> Summary: Dtrace monitoring uses size before mirror size is set. >>> Reviewed-by: kamg, hseigel >>> >>> http://cr.openjdk.java.net/~coleenp/8039904/ >>> https://bugs.openjdk.java.net/browse/JDK-8039904 >>> >>> (changeset applied cleanly) >>> >>> Thanks, >>> Coleen >>> >>> >>> >>> >> >> >> > From lois.foltan at oracle.com Wed Apr 16 22:50:11 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 16 Apr 2014 18:50:11 -0400 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534F06F3.7090308@oracle.com> References: <534DA70B.70303@oracle.com> <534EE8C5.5000808@oracle.com> <534F05DF.5010105@oracle.com> <534F06F3.7090308@oracle.com> Message-ID: <534F0923.3010305@oracle.com> Hi Coleen, I had started to look at this earlier, thanks for the updated webrevs. I think all 3 webrevs look fine. Lois On 4/16/2014 6:40 PM, Coleen Phillimore wrote: > > Thanks Dan for the code review and for creating webrevs for the > patches. They are here: > > open webrev at > http://cr.openjdk.java.net/~coleenp/8035735_8u20/0-for-jdk8u-hs > open webrev at > http://cr.openjdk.java.net/~coleenp/8028497_8u20/0-for-jdk8u-hs > open webrev at > http://cr.openjdk.java.net/~coleenp/8039904_8u20/0-for-jdk8u-hs > > Coleen > > On 4/16/14, 6:36 PM, Daniel D. Daugherty wrote: >> At this point, I've compared Coleen's exported JDK8u changesets >> with the patch files from the JDK9-hs-rt versions. >> >> >> On 4/16/14 2:32 PM, Daniel D. Daugherty wrote: >>> Usually when you request a backport review you supply webrevs >>> relative to the backport target repo. All of the webrevs here >>> appear to the JDK9 webrevs so there's not really any way that >>> a reviewer can verify that your backport is correct. >>> >>> > http://cr.openjdk.java.net/~coleenp/8035735/ >>> >>> src/share/vm/code/debugInfo.hpp >>> src/share/vm/oops/metadata.hpp >>> No comments; I expect this to be a clean backport. >> >> The patch that Coleen imported for JDK8u includes changes made >> after the JDK9 webrev was generated (during the code review cycle). >> So the JDK8u version matches the JDK9 version. Thumbs up! >> >> >>> > http://cr.openjdk.java.net/~coleenp/8028497_4/ >>> >>> src/share/vm/classfile/classFileParser.cpp >>> src/share/vm/classfile/javaClasses.cpp >>> src/share/vm/classfile/javaClasses.hpp >>> src/share/vm/classfile/systemDictionary.cpp >>> src/share/vm/classfile/systemDictionary.hpp >>> src/share/vm/gc_interface/collectedHeap.cpp >>> src/share/vm/gc_interface/collectedHeap.hpp >>> src/share/vm/oops/constantPool.cpp >>> src/share/vm/oops/instanceKlass.cpp >>> src/share/vm/oops/instanceKlass.hpp >>> src/share/vm/oops/instanceMirrorKlass.cpp >>> src/share/vm/oops/klass.cpp >>> src/share/vm/oops/method.cpp >>> src/share/vm/oops/method.hpp >>> This might be a candidate for a clean backport, but I >>> don't know this code well enough to make that call >>> without a JDK8u relative webrev. >> >> The patch that Coleen imported for JDK8u is different >> than the JDK9 webrev version; as Coleen mentioned below >> there are name changes from 'this_k' -> 'this_oop'. >> Thumbs up! >> >> >>> >>> > http://cr.openjdk.java.net/~coleenp/8039904/ >>> >>> src/share/vm/gc_interface/collectedHeap.hpp >>> src/share/vm/gc_interface/collectedHeap.inline.hpp >>> src/share/vm/runtime/sharedRuntime.cpp >>> src/share/vm/runtime/sharedRuntime.hpp >>> No comments; I expect this to be a clean backport. >> >> The patch that Coleen imported for JDK8u matches the >> JDK9 webrev version (modulo copyrights and line numbers). >> Thumbs up! >> >> Dan >> >> >>> >>> >>> Dan >>> >>> >>> On 4/15/14 3:39 PM, Coleen Phillimore wrote: >>>> >>>> Please review backports of these bug fixes in JDK9. Nightly >>>> testing has been running this code for a few nights now. >>>> >>>> 8035735: Metaspace::contains become extremely slow in some cases >>>> Summary: Call is_metadata instead which does less work for the call >>>> in debugInfo.hpp which is called for all compiled code stack frames. >>>> Reviewed-by: jmasa, dcubed >>>> >>>> https://bugs.openjdk.java.net/browse/JDK-8035735 >>>> http://cr.openjdk.java.net/~coleenp/8035735/ >>>> >>>> (changeset applied cleanly) >>>> >>>> 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, >>>> KlassClosure*, bool) >>>> Summary: Keep class in CLD::_klasses list and mirror created for >>>> CDS classes if OOM during restore_shareable_info(). This keeps >>>> pointers consistent for CMS. >>>> Reviewed-by: ehelin, stefank, jmasa, iklam >>>> >>>> http://cr.openjdk.java.net/~coleenp/8028497_4/ >>>> https://bugs.openjdk.java.net/browse/JDK-8028497 >>>> >>>> (changeset had one difference because of name change from this_oop >>>> to this_k). >>>> >>>> 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > >>>> 0) failed: Bad size calculated" >>>> Summary: Dtrace monitoring uses size before mirror size is set. >>>> Reviewed-by: kamg, hseigel >>>> >>>> http://cr.openjdk.java.net/~coleenp/8039904/ >>>> https://bugs.openjdk.java.net/browse/JDK-8039904 >>>> >>>> (changeset applied cleanly) >>>> >>>> Thanks, >>>> Coleen >>>> >>>> >>>> >>>> >>> >>> >>> >> > From coleen.phillimore at oracle.com Wed Apr 16 22:56:04 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 16 Apr 2014 18:56:04 -0400 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534F0923.3010305@oracle.com> References: <534DA70B.70303@oracle.com> <534EE8C5.5000808@oracle.com> <534F05DF.5010105@oracle.com> <534F06F3.7090308@oracle.com> <534F0923.3010305@oracle.com> Message-ID: <534F0A84.5050004@oracle.com> Thank you Lois! Coleen On 4/16/14, 6:50 PM, Lois Foltan wrote: > Hi Coleen, > > I had started to look at this earlier, thanks for the updated > webrevs. I think all 3 webrevs look fine. > > Lois > > On 4/16/2014 6:40 PM, Coleen Phillimore wrote: >> >> Thanks Dan for the code review and for creating webrevs for the >> patches. They are here: >> >> open webrev at >> http://cr.openjdk.java.net/~coleenp/8035735_8u20/0-for-jdk8u-hs >> open webrev at >> http://cr.openjdk.java.net/~coleenp/8028497_8u20/0-for-jdk8u-hs >> open webrev at >> http://cr.openjdk.java.net/~coleenp/8039904_8u20/0-for-jdk8u-hs >> >> Coleen >> >> On 4/16/14, 6:36 PM, Daniel D. Daugherty wrote: >>> At this point, I've compared Coleen's exported JDK8u changesets >>> with the patch files from the JDK9-hs-rt versions. >>> >>> >>> On 4/16/14 2:32 PM, Daniel D. Daugherty wrote: >>>> Usually when you request a backport review you supply webrevs >>>> relative to the backport target repo. All of the webrevs here >>>> appear to the JDK9 webrevs so there's not really any way that >>>> a reviewer can verify that your backport is correct. >>>> >>>> > http://cr.openjdk.java.net/~coleenp/8035735/ >>>> >>>> src/share/vm/code/debugInfo.hpp >>>> src/share/vm/oops/metadata.hpp >>>> No comments; I expect this to be a clean backport. >>> >>> The patch that Coleen imported for JDK8u includes changes made >>> after the JDK9 webrev was generated (during the code review cycle). >>> So the JDK8u version matches the JDK9 version. Thumbs up! >>> >>> >>>> > http://cr.openjdk.java.net/~coleenp/8028497_4/ >>>> >>>> src/share/vm/classfile/classFileParser.cpp >>>> src/share/vm/classfile/javaClasses.cpp >>>> src/share/vm/classfile/javaClasses.hpp >>>> src/share/vm/classfile/systemDictionary.cpp >>>> src/share/vm/classfile/systemDictionary.hpp >>>> src/share/vm/gc_interface/collectedHeap.cpp >>>> src/share/vm/gc_interface/collectedHeap.hpp >>>> src/share/vm/oops/constantPool.cpp >>>> src/share/vm/oops/instanceKlass.cpp >>>> src/share/vm/oops/instanceKlass.hpp >>>> src/share/vm/oops/instanceMirrorKlass.cpp >>>> src/share/vm/oops/klass.cpp >>>> src/share/vm/oops/method.cpp >>>> src/share/vm/oops/method.hpp >>>> This might be a candidate for a clean backport, but I >>>> don't know this code well enough to make that call >>>> without a JDK8u relative webrev. >>> >>> The patch that Coleen imported for JDK8u is different >>> than the JDK9 webrev version; as Coleen mentioned below >>> there are name changes from 'this_k' -> 'this_oop'. >>> Thumbs up! >>> >>> >>>> >>>> > http://cr.openjdk.java.net/~coleenp/8039904/ >>>> >>>> src/share/vm/gc_interface/collectedHeap.hpp >>>> src/share/vm/gc_interface/collectedHeap.inline.hpp >>>> src/share/vm/runtime/sharedRuntime.cpp >>>> src/share/vm/runtime/sharedRuntime.hpp >>>> No comments; I expect this to be a clean backport. >>> >>> The patch that Coleen imported for JDK8u matches the >>> JDK9 webrev version (modulo copyrights and line numbers). >>> Thumbs up! >>> >>> Dan >>> >>> >>>> >>>> >>>> Dan >>>> >>>> >>>> On 4/15/14 3:39 PM, Coleen Phillimore wrote: >>>>> >>>>> Please review backports of these bug fixes in JDK9. Nightly >>>>> testing has been running this code for a few nights now. >>>>> >>>>> 8035735: Metaspace::contains become extremely slow in some cases >>>>> Summary: Call is_metadata instead which does less work for the >>>>> call in debugInfo.hpp which is called for all compiled code stack >>>>> frames. >>>>> Reviewed-by: jmasa, dcubed >>>>> >>>>> https://bugs.openjdk.java.net/browse/JDK-8035735 >>>>> http://cr.openjdk.java.net/~coleenp/8035735/ >>>>> >>>>> (changeset applied cleanly) >>>>> >>>>> 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, >>>>> KlassClosure*, bool) >>>>> Summary: Keep class in CLD::_klasses list and mirror created for >>>>> CDS classes if OOM during restore_shareable_info(). This keeps >>>>> pointers consistent for CMS. >>>>> Reviewed-by: ehelin, stefank, jmasa, iklam >>>>> >>>>> http://cr.openjdk.java.net/~coleenp/8028497_4/ >>>>> https://bugs.openjdk.java.net/browse/JDK-8028497 >>>>> >>>>> (changeset had one difference because of name change from this_oop >>>>> to this_k). >>>>> >>>>> 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s >>>>> > 0) failed: Bad size calculated" >>>>> Summary: Dtrace monitoring uses size before mirror size is set. >>>>> Reviewed-by: kamg, hseigel >>>>> >>>>> http://cr.openjdk.java.net/~coleenp/8039904/ >>>>> https://bugs.openjdk.java.net/browse/JDK-8039904 >>>>> >>>>> (changeset applied cleanly) >>>>> >>>>> Thanks, >>>>> Coleen >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >> > From serguei.spitsyn at oracle.com Wed Apr 16 22:56:16 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Wed, 16 Apr 2014 15:56:16 -0700 Subject: RFR(XS): JDK-6904403 assert(f == k->has_finalizer(), "inconsistent has_finalizer") with debug VM In-Reply-To: <534E7E18.3030308@oracle.com> References: <534E7E18.3030308@oracle.com> Message-ID: <534F0A90.30806@oracle.com> Hi Dmitry, I agree with the approach in general, but think this fix is not fully correct: #ifdef ASSERT bool f = false; Method* m = k->lookup_method(vmSymbols::finalize_method_name(), vmSymbols::void_method_signature()); if (m != NULL && !m->is_empty_method()) { + // Spec doesn't prevent agent from redefinition of empty finalyzer. + // despite the fact that it's generally bad idea and redefined finalyzer + // will not work as expected we shouldn't abort vm in this case + if (!k->has_been_redefined()) { f = true; } + } assert(f == k->has_finalizer(), "inconsistent has_finalizer"); #endif The issue is that if the class originally had a non-empty finalizer then after a redefinition the 'f' will get value 'false' which should cause this assert to unreasonably fire again. The fix you may want is to skip the assert if a class redefinition took place: #ifdef ASSERT bool f = false; Method* m = k->lookup_method(vmSymbols::finalize_method_name(), vmSymbols::void_method_signature()); if (m != NULL && !m->is_empty_method()) { f = true; } // Spec doesn't prevent agent from redefinition of empty finalizer. // Despite the fact that it's generally bad idea and redefined finalizer // will not work as expected we shouldn't abort vm in this case if (!k->has_been_redefined()) { assert(f == k->has_finalizer(), "inconsistent has_finalizer"); } #endif Also, please, note a couple of minor scratches in new comment: - finalyzer => finalizer - despite => Despite Thanks, Serguei On 4/16/14 5:56 AM, Dmitry Samersoff wrote: > Hi Everybody, > > Please review small changes. > > http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.01/ > > This fix tells to JVM to don't assert if the class was redefined. > > Please notice, these changes doesn't make redefined finalyzers working. > It's a large project which is out of scope of this changes. > > -Dmitry > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.spitsyn at oracle.com Wed Apr 16 23:22:04 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Wed, 16 Apr 2014 16:22:04 -0700 Subject: [8u20] RFR Backports of 8035735, 8028497 and 8039904 In-Reply-To: <534F06F3.7090308@oracle.com> References: <534DA70B.70303@oracle.com> <534EE8C5.5000808@oracle.com> <534F05DF.5010105@oracle.com> <534F06F3.7090308@oracle.com> Message-ID: <534F109C.2020200@oracle.com> Coleen, I've reviewed the 8035735_8u20 and 8039904_8u20 and both backports look good. Thanks, Serguei On 4/16/14 3:40 PM, Coleen Phillimore wrote: > > Thanks Dan for the code review and for creating webrevs for the > patches. They are here: > > open webrev at > http://cr.openjdk.java.net/~coleenp/8035735_8u20/0-for-jdk8u-hs > open webrev at > http://cr.openjdk.java.net/~coleenp/8028497_8u20/0-for-jdk8u-hs > open webrev at > http://cr.openjdk.java.net/~coleenp/8039904_8u20/0-for-jdk8u-hs > > Coleen > > On 4/16/14, 6:36 PM, Daniel D. Daugherty wrote: >> At this point, I've compared Coleen's exported JDK8u changesets >> with the patch files from the JDK9-hs-rt versions. >> >> >> On 4/16/14 2:32 PM, Daniel D. Daugherty wrote: >>> Usually when you request a backport review you supply webrevs >>> relative to the backport target repo. All of the webrevs here >>> appear to the JDK9 webrevs so there's not really any way that >>> a reviewer can verify that your backport is correct. >>> >>> > http://cr.openjdk.java.net/~coleenp/8035735/ >>> >>> src/share/vm/code/debugInfo.hpp >>> src/share/vm/oops/metadata.hpp >>> No comments; I expect this to be a clean backport. >> >> The patch that Coleen imported for JDK8u includes changes made >> after the JDK9 webrev was generated (during the code review cycle). >> So the JDK8u version matches the JDK9 version. Thumbs up! >> >> >>> > http://cr.openjdk.java.net/~coleenp/8028497_4/ >>> >>> src/share/vm/classfile/classFileParser.cpp >>> src/share/vm/classfile/javaClasses.cpp >>> src/share/vm/classfile/javaClasses.hpp >>> src/share/vm/classfile/systemDictionary.cpp >>> src/share/vm/classfile/systemDictionary.hpp >>> src/share/vm/gc_interface/collectedHeap.cpp >>> src/share/vm/gc_interface/collectedHeap.hpp >>> src/share/vm/oops/constantPool.cpp >>> src/share/vm/oops/instanceKlass.cpp >>> src/share/vm/oops/instanceKlass.hpp >>> src/share/vm/oops/instanceMirrorKlass.cpp >>> src/share/vm/oops/klass.cpp >>> src/share/vm/oops/method.cpp >>> src/share/vm/oops/method.hpp >>> This might be a candidate for a clean backport, but I >>> don't know this code well enough to make that call >>> without a JDK8u relative webrev. >> >> The patch that Coleen imported for JDK8u is different >> than the JDK9 webrev version; as Coleen mentioned below >> there are name changes from 'this_k' -> 'this_oop'. >> Thumbs up! >> >> >>> >>> > http://cr.openjdk.java.net/~coleenp/8039904/ >>> >>> src/share/vm/gc_interface/collectedHeap.hpp >>> src/share/vm/gc_interface/collectedHeap.inline.hpp >>> src/share/vm/runtime/sharedRuntime.cpp >>> src/share/vm/runtime/sharedRuntime.hpp >>> No comments; I expect this to be a clean backport. >> >> The patch that Coleen imported for JDK8u matches the >> JDK9 webrev version (modulo copyrights and line numbers). >> Thumbs up! >> >> Dan >> >> >>> >>> >>> Dan >>> >>> >>> On 4/15/14 3:39 PM, Coleen Phillimore wrote: >>>> >>>> Please review backports of these bug fixes in JDK9. Nightly >>>> testing has been running this code for a few nights now. >>>> >>>> 8035735: Metaspace::contains become extremely slow in some cases >>>> Summary: Call is_metadata instead which does less work for the call >>>> in debugInfo.hpp which is called for all compiled code stack frames. >>>> Reviewed-by: jmasa, dcubed >>>> >>>> https://bugs.openjdk.java.net/browse/JDK-8035735 >>>> http://cr.openjdk.java.net/~coleenp/8035735/ >>>> >>>> (changeset applied cleanly) >>>> >>>> 8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, >>>> KlassClosure*, bool) >>>> Summary: Keep class in CLD::_klasses list and mirror created for >>>> CDS classes if OOM during restore_shareable_info(). This keeps >>>> pointers consistent for CMS. >>>> Reviewed-by: ehelin, stefank, jmasa, iklam >>>> >>>> http://cr.openjdk.java.net/~coleenp/8028497_4/ >>>> https://bugs.openjdk.java.net/browse/JDK-8028497 >>>> >>>> (changeset had one difference because of name change from this_oop >>>> to this_k). >>>> >>>> 8039904: dtrace/hotspot/Monitors/Monitors001 fails with "assert(s > >>>> 0) failed: Bad size calculated" >>>> Summary: Dtrace monitoring uses size before mirror size is set. >>>> Reviewed-by: kamg, hseigel >>>> >>>> http://cr.openjdk.java.net/~coleenp/8039904/ >>>> https://bugs.openjdk.java.net/browse/JDK-8039904 >>>> >>>> (changeset applied cleanly) >>>> >>>> Thanks, >>>> Coleen >>>> >>>> >>>> >>>> >>> >>> >>> >> > From lois.foltan at oracle.com Wed Apr 16 23:46:31 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Wed, 16 Apr 2014 19:46:31 -0400 Subject: RFR(XS): JDK-8040018 Remove bad assert in ClassFileParser.cpp In-Reply-To: <534EC2B9.5090204@oracle.com> References: <534EC2B9.5090204@oracle.com> Message-ID: <534F1657.4040808@oracle.com> Hi Harold, Overall I think the change to classFileParser.cpp looks good. My only comments are about the test case, ClassFileParserBug.java. I personally find the readability of the .jcod file cumbersome. I have attached a ASM file, TestBadBootstrapMethodsAttr.java, in case you would prefer a straight java file. It needs to be cleaned up before it can be checked into the test system, but it does demonstrate the issue. Also, is it possible to have the test case live in test/runtime/verifier instead of a new directory? If you feel that the .jcod file and test.jar file better exercise this class format issue, then by all means you have my review to go forward. Thanks, Lois On 4/16/2014 1:49 PM, harold seigel wrote: > Hi, > > Please review this small change to fix bug JDK-8040018 for JDK-9. The > fix removes the assert because it can be triggered by a class file > containing an incorrect attribute_length value for the BoostrapMethods > attribute, not just by a JVM inconsistency. Removing the assert lets > the following guarantee_property() call catch the problem and throw a > java.lang.ClassFormatError exception. > > The fix was tested with JPRT, JCK lang, JCK vm, hotspot jtreg, and nsk > quick tests. The new test was tested on Linux and Windows. > > Open webrev at: http://cr.openjdk.java.net/~hseigel/bug_8040018/ > > Bug: https://bugs.openjdk.java.net/browse/JDK-8040018 > > Thanks! Harold -------------- next part -------------- import java.util.*; import jdk.internal.org.objectweb.asm.*; public class TestBadBootstrapMethodsAttr implements Opcodes { static final String classLambdaMathName = "LambdaMath"; public static void main(String[] args) throws Exception { ClassLoader cl = new ClassLoader() { public Class loadClass(String name) throws ClassNotFoundException { if (findLoadedClass(name) != null) { return findLoadedClass(name); } if (classLambdaMathName.equals(name)) { try { byte[] classFile = dump(); return defineClass(classLambdaMathName, classFile, 0, classFile.length); } catch (Exception e) { } } return super.loadClass(name); } }; cl.loadClass(classLambdaMathName).getDeclaredMethod("main_test").invoke(null); } public static byte[] dump () throws Exception { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES); FieldVisitor fv; MethodVisitor mv; AnnotationVisitor av0; cw.visit(52, ACC_PUBLIC + ACC_SUPER, "LambdaMath", null, "java/lang/Object", null); cw.visitInnerClass("java/lang/invoke/MethodHandles$Lookup", "java/lang/invoke/MethodHandles", "Lookup", ACC_PUBLIC + ACC_FINAL + ACC_STATIC); { mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false); mv.visitInsn(RETURN); mv.visitMaxs(1, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main_test", "()V", null, null); mv.visitCode(); mv.visitIntInsn(BIPUSH, 7); mv.visitTypeInsn(ANEWARRAY, "java/lang/Integer"); mv.visitInsn(DUP); mv.visitInsn(ICONST_0); mv.visitInsn(ICONST_1); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitInsn(DUP); mv.visitInsn(ICONST_1); mv.visitInsn(ICONST_2); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitInsn(DUP); mv.visitInsn(ICONST_2); mv.visitInsn(ICONST_3); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitInsn(DUP); mv.visitInsn(ICONST_3); mv.visitInsn(ICONST_4); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitInsn(DUP); mv.visitInsn(ICONST_4); mv.visitInsn(ICONST_5); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitInsn(DUP); mv.visitInsn(ICONST_5); mv.visitIntInsn(BIPUSH, 6); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitInsn(DUP); mv.visitIntInsn(BIPUSH, 6); mv.visitIntInsn(BIPUSH, 7); mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); mv.visitInsn(AASTORE); mv.visitMethodInsn(INVOKESTATIC, "java/util/Arrays", "asList", "([Ljava/lang/Object;)Ljava/util/List;", false); mv.visitVarInsn(ASTORE, 1); mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn("Print all numbers:"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mv.visitVarInsn(ALOAD, 1); mv.visitInvokeDynamicInsn("test", "()Ljava/util/function/Predicate;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[]{Type.getType("(Ljava/lang/Object;)Z"), new Handle(Opcodes.H_INVOKESTATIC, "LambdaMath", "lambda$main$0", "(Ljava/lang/Integer;)Z"), Type.getType("(Ljava/lang/Integer;)Z")}); mv.visitMethodInsn(INVOKESTATIC, "LambdaMath", "evaluate", "(Ljava/util/List;Ljava/util/function/Predicate;)V", false); mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn("Print no numbers:"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mv.visitVarInsn(ALOAD, 1); mv.visitInvokeDynamicInsn("test", "()Ljava/util/function/Predicate;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[]{Type.getType("(Ljava/lang/Object;)Z"), new Handle(Opcodes.H_INVOKESTATIC, "LambdaMath", "lambda$main$1", "(Ljava/lang/Integer;)Z"), Type.getType("(Ljava/lang/Integer;)Z")}); mv.visitMethodInsn(INVOKESTATIC, "LambdaMath", "evaluate", "(Ljava/util/List;Ljava/util/function/Predicate;)V", false); mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn("Print even numbers:"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mv.visitVarInsn(ALOAD, 1); mv.visitInvokeDynamicInsn("test", "()Ljava/util/function/Predicate;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[]{Type.getType("(Ljava/lang/Object;)Z"), new Handle(Opcodes.H_INVOKESTATIC, "LambdaMath", "lambda$main$2", "(Ljava/lang/Integer;)Z"), Type.getType("(Ljava/lang/Integer;)Z")}); mv.visitMethodInsn(INVOKESTATIC, "LambdaMath", "evaluate", "(Ljava/util/List;Ljava/util/function/Predicate;)V", false); mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn("Print odd numbers:"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mv.visitVarInsn(ALOAD, 1); mv.visitInvokeDynamicInsn("test", "()Ljava/util/function/Predicate;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[]{Type.getType("(Ljava/lang/Object;)Z"), new Handle(Opcodes.H_INVOKESTATIC, "LambdaMath", "lambda$main$3", "(Ljava/lang/Integer;)Z"), Type.getType("(Ljava/lang/Integer;)Z")}); mv.visitMethodInsn(INVOKESTATIC, "LambdaMath", "evaluate", "(Ljava/util/List;Ljava/util/function/Predicate;)V", false); mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn("Print numbers greater than 5:"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mv.visitVarInsn(ALOAD, 1); mv.visitInvokeDynamicInsn("test", "()Ljava/util/function/Predicate;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[]{Type.getType("(Ljava/lang/Object;)Z")}); mv.visitMethodInsn(INVOKESTATIC, "LambdaMath", "evaluate", "(Ljava/util/List;Ljava/util/function/Predicate;)V", false); mv.visitInsn(RETURN); mv.visitMaxs(4, 2); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "evaluate", "(Ljava/util/List;Ljava/util/function/Predicate;)V", "(Ljava/util/List;Ljava/util/function/Predicate;)V", null); mv.visitCode(); Label l0 = new Label(); Label l1 = new Label(); Label l2 = new Label(); mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable"); mv.visitLabel(l0); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKEINTERFACE, "java/util/List", "iterator", "()Ljava/util/Iterator;", true); mv.visitVarInsn(ASTORE, 2); Label l3 = new Label(); mv.visitLabel(l3); mv.visitFrame(Opcodes.F_APPEND,1, new Object[] {"java/util/Iterator"}, 0, null); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true); mv.visitJumpInsn(IFEQ, l1); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true); mv.visitInsn(MONITORENTER); mv.visitInsn(NOP); mv.visitInsn(ICONST_M1); mv.visitVarInsn(ISTORE, 3); mv.visitVarInsn(ALOAD, 1); //mv.visitVarInsn(ILOAD, 3); mv.visitMethodInsn(INVOKEINTERFACE, "java/util/function/Predicate", "test", "(Ljava/lang/Object;)Z", true); Label l4 = new Label(); mv.visitJumpInsn(IFEQ, l4); mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitTypeInsn(NEW, "java/lang/StringFuilder"); mv.visitInsn(DUP); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringFuilder", "", "()V", false); mv.visitVarInsn(ALOAD, 3); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringFuilder", "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;", false); mv.visitLdcInsn(" "); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringFuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringFuilder", "toString", "()Ljava/lang/String;", false); mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mv.visitLabel(l4); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitJumpInsn(GOTO, l3); mv.visitLabel(l1); mv.visitFrame(Opcodes.F_CHOP,1, null, 0, null); Label l5 = new Label(); mv.visitJumpInsn(GOTO, l5); mv.visitLabel(l2); mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"}); mv.visitVarInsn(ASTORE, 2); mv.visitLabel(l5); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitInsn(RETURN); mv.visitMaxs(3, 4); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "lambda$main$4", "(Ljava/lang/Integer;)Z", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false); mv.visitInsn(ICONST_5); Label l0 = new Label(); mv.visitJumpInsn(IF_ICMPLE, l0); mv.visitInsn(ICONST_1); Label l1 = new Label(); mv.visitJumpInsn(GOTO, l1); mv.visitLabel(l0); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitInsn(ICONST_0); mv.visitLabel(l1); mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {Opcodes.INTEGER}); mv.visitInsn(IRETURN); mv.visitMaxs(2, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "lambda$main$3", "(Ljava/lang/Integer;)Z", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false); mv.visitInsn(ICONST_2); mv.visitInsn(IREM); mv.visitInsn(ICONST_1); Label l0 = new Label(); mv.visitJumpInsn(IF_ICMPNE, l0); mv.visitInsn(ICONST_1); Label l1 = new Label(); mv.visitJumpInsn(GOTO, l1); mv.visitLabel(l0); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitInsn(ICONST_0); mv.visitLabel(l1); mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {Opcodes.INTEGER}); mv.visitInsn(IRETURN); mv.visitMaxs(2, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "lambda$main$2", "(Ljava/lang/Integer;)Z", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false); mv.visitInsn(ICONST_2); mv.visitInsn(IREM); Label l0 = new Label(); mv.visitJumpInsn(IFNE, l0); mv.visitInsn(ICONST_1); Label l1 = new Label(); mv.visitJumpInsn(GOTO, l1); mv.visitLabel(l0); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitInsn(ICONST_0); mv.visitLabel(l1); mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {Opcodes.INTEGER}); mv.visitInsn(IRETURN); mv.visitMaxs(2, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "lambda$main$1", "(Ljava/lang/Integer;)Z", null, null); mv.visitCode(); mv.visitInsn(ICONST_0); mv.visitInsn(IRETURN); mv.visitMaxs(1, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "lambda$main$0", "(Ljava/lang/Integer;)Z", null, null); mv.visitCode(); mv.visitInsn(ICONST_1); mv.visitInsn(IRETURN); mv.visitMaxs(1, 1); mv.visitEnd(); } cw.visitEnd(); return cw.toByteArray(); } } From dmitry.samersoff at oracle.com Thu Apr 17 06:58:07 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Thu, 17 Apr 2014 10:58:07 +0400 Subject: RFR(XS): JDK-6904403 assert(f == k->has_finalizer(), "inconsistent has_finalizer") with debug VM In-Reply-To: <534F0A90.30806@oracle.com> References: <534E7E18.3030308@oracle.com> <534F0A90.30806@oracle.com> Message-ID: <534F7B7F.3060907@oracle.com> Serguei, I tried to be less invasive and keep catching some kind of finalyzer related problems. But you are right - it's better to disable assert entirely if class has been redefined. I'll update the webrev. -Dmitry On 2014-04-17 02:56, serguei.spitsyn at oracle.com wrote: > Hi Dmitry, > > I agree with the approach in general, but think this fix is not fully > correct: > > #ifdef ASSERT > bool f = false; > Method* m = k->lookup_method(vmSymbols::finalize_method_name(), > vmSymbols::void_method_signature()); > if (m != NULL && !m->is_empty_method()) { > + // Spec doesn't prevent agent from redefinition of empty finalyzer. > + // despite the fact that it's generally bad idea and redefined finalyzer > + // will not work as expected we shouldn't abort vm in this case > + if (!k->has_been_redefined()) { > f = true; > } > + } > assert(f == k->has_finalizer(), "inconsistent has_finalizer"); > #endif > > > The issue is that if the class originally had a non-empty finalizer then > after a redefinition > the 'f' will get value 'false' which should cause this assert to > unreasonably fire again. > > The fix you may want is to skip the assert if a class redefinition took > place: > > #ifdef ASSERT > bool f = false; > Method* m = k->lookup_method(vmSymbols::finalize_method_name(), > vmSymbols::void_method_signature()); > if (m != NULL && !m->is_empty_method()) { > f = true; > } > // Spec doesn't prevent agent from redefinition of empty finalizer. > // Despite the fact that it's generally bad idea and redefined finalizer > // will not work as expected we shouldn't abort vm in this case > if (!k->has_been_redefined()) { > assert(f == k->has_finalizer(), "inconsistent has_finalizer"); > } > #endif > > Also, please, note a couple of minor scratches in new comment: > - finalyzer => finalizer > - despite => Despite > > Thanks, > Serguei > > > On 4/16/14 5:56 AM, Dmitry Samersoff wrote: >> Hi Everybody, >> >> Please review small changes. >> >> http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.01/ >> >> This fix tells to JVM to don't assert if the class was redefined. >> >> Please notice, these changes doesn't make redefined finalyzers working. >> It's a large project which is out of scope of this changes. >> >> -Dmitry >> > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From dmitry.samersoff at oracle.com Thu Apr 17 12:56:12 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Thu, 17 Apr 2014 16:56:12 +0400 Subject: RFR(XS): JDK-6904403 assert(f == k->has_finalizer(), "inconsistent has_finalizer") with debug VM In-Reply-To: <534F0A90.30806@oracle.com> References: <534E7E18.3030308@oracle.com> <534F0A90.30806@oracle.com> Message-ID: <534FCF6C.20807@oracle.com> Serguei, Updated webrev: http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.02/ On 2014-04-17 02:56, serguei.spitsyn at oracle.com wrote: > Hi Dmitry, > > I agree with the approach in general, but think this fix is not fully > correct: > > #ifdef ASSERT > bool f = false; > Method* m = k->lookup_method(vmSymbols::finalize_method_name(), > vmSymbols::void_method_signature()); > if (m != NULL && !m->is_empty_method()) { > + // Spec doesn't prevent agent from redefinition of empty finalyzer. > + // despite the fact that it's generally bad idea and redefined finalyzer > + // will not work as expected we shouldn't abort vm in this case > + if (!k->has_been_redefined()) { > f = true; > } > + } > assert(f == k->has_finalizer(), "inconsistent has_finalizer"); > #endif > > > The issue is that if the class originally had a non-empty finalizer then > after a redefinition > the 'f' will get value 'false' which should cause this assert to > unreasonably fire again. > > The fix you may want is to skip the assert if a class redefinition took > place: > > #ifdef ASSERT > bool f = false; > Method* m = k->lookup_method(vmSymbols::finalize_method_name(), > vmSymbols::void_method_signature()); > if (m != NULL && !m->is_empty_method()) { > f = true; > } > // Spec doesn't prevent agent from redefinition of empty finalizer. > // Despite the fact that it's generally bad idea and redefined finalizer > // will not work as expected we shouldn't abort vm in this case > if (!k->has_been_redefined()) { > assert(f == k->has_finalizer(), "inconsistent has_finalizer"); > } > #endif > > Also, please, note a couple of minor scratches in new comment: > - finalyzer => finalizer > - despite => Despite > > Thanks, > Serguei > > > On 4/16/14 5:56 AM, Dmitry Samersoff wrote: >> Hi Everybody, >> >> Please review small changes. >> >> http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.01/ >> >> This fix tells to JVM to don't assert if the class was redefined. >> >> Please notice, these changes doesn't make redefined finalyzers working. >> It's a large project which is out of scope of this changes. >> >> -Dmitry >> > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From serguei.spitsyn at oracle.com Thu Apr 17 14:48:14 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Thu, 17 Apr 2014 07:48:14 -0700 Subject: RFR(XS): JDK-6904403 assert(f == k->has_finalizer(), "inconsistent has_finalizer") with debug VM In-Reply-To: <534FCF6C.20807@oracle.com> References: <534E7E18.3030308@oracle.com> <534F0A90.30806@oracle.com> <534FCF6C.20807@oracle.com> Message-ID: <534FE9AE.5050802@oracle.com> Looks good. Thanks, Serguei On 4/17/14 5:56 AM, Dmitry Samersoff wrote: > Serguei, > > Updated webrev: > > http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.02/ > > > On 2014-04-17 02:56, serguei.spitsyn at oracle.com wrote: >> Hi Dmitry, >> >> I agree with the approach in general, but think this fix is not fully >> correct: >> >> #ifdef ASSERT >> bool f = false; >> Method* m = k->lookup_method(vmSymbols::finalize_method_name(), >> vmSymbols::void_method_signature()); >> if (m != NULL && !m->is_empty_method()) { >> + // Spec doesn't prevent agent from redefinition of empty finalyzer. >> + // despite the fact that it's generally bad idea and redefined finalyzer >> + // will not work as expected we shouldn't abort vm in this case >> + if (!k->has_been_redefined()) { >> f = true; >> } >> + } >> assert(f == k->has_finalizer(), "inconsistent has_finalizer"); >> #endif >> >> >> The issue is that if the class originally had a non-empty finalizer then >> after a redefinition >> the 'f' will get value 'false' which should cause this assert to >> unreasonably fire again. >> >> The fix you may want is to skip the assert if a class redefinition took >> place: >> >> #ifdef ASSERT >> bool f = false; >> Method* m = k->lookup_method(vmSymbols::finalize_method_name(), >> vmSymbols::void_method_signature()); >> if (m != NULL && !m->is_empty_method()) { >> f = true; >> } >> // Spec doesn't prevent agent from redefinition of empty finalizer. >> // Despite the fact that it's generally bad idea and redefined finalizer >> // will not work as expected we shouldn't abort vm in this case >> if (!k->has_been_redefined()) { >> assert(f == k->has_finalizer(), "inconsistent has_finalizer"); >> } >> #endif >> >> Also, please, note a couple of minor scratches in new comment: >> - finalyzer => finalizer >> - despite => Despite >> >> Thanks, >> Serguei >> >> >> On 4/16/14 5:56 AM, Dmitry Samersoff wrote: >>> Hi Everybody, >>> >>> Please review small changes. >>> >>> http://cr.openjdk.java.net/~dsamersoff/JDK-6904403/webrev.01/ >>> >>> This fix tells to JVM to don't assert if the class was redefined. >>> >>> Please notice, these changes doesn't make redefined finalyzers working. >>> It's a large project which is out of scope of this changes. >>> >>> -Dmitry >>> > From christian.tornqvist at oracle.com Thu Apr 17 21:00:53 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Thu, 17 Apr 2014 17:00:53 -0400 Subject: RFR(XXS): JDK-8040887 - [TESTBUG] Remove test/runtime/6925573/SortMethodsTest.java Message-ID: <02a301cf5a80$1ef489d0$5cdd9d70$@oracle.com> Hi everyone, After a failed attempt to fix the timeout issues with this test I've come to realize that it'll never be reliable in an environment where tests are running concurrently. This test is more of a micro benchmark than a regression test, so we've decided to remove this test. Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/8040887/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8040887 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Thu Apr 17 21:34:27 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Thu, 17 Apr 2014 17:34:27 -0400 Subject: RFR(XS): JDK-8040018 Remove bad assert in ClassFileParser.cpp In-Reply-To: <534F1657.4040808@oracle.com> References: <534EC2B9.5090204@oracle.com> <534F1657.4040808@oracle.com> Message-ID: <535048E3.5040506@oracle.com> Hi Harold, Just a follow up. After looking at this more today, I actually think my ASM test case isn't working as intended. I think you are better off going with the original .jcod/test.jar file for testing. As I mentioned below, the code change looks good. Lois On 4/16/2014 7:46 PM, Lois Foltan wrote: > Hi Harold, > > Overall I think the change to classFileParser.cpp looks good. My only > comments are about the test case, ClassFileParserBug.java. I > personally find the readability of the .jcod file cumbersome. I have > attached a ASM file, TestBadBootstrapMethodsAttr.java, in case you > would prefer a straight java file. It needs to be cleaned up before > it can be checked into the test system, but it does demonstrate the > issue. Also, is it possible to have the test case live in > test/runtime/verifier instead of a new directory? > > If you feel that the .jcod file and test.jar file better exercise this > class format issue, then by all means you have my review to go forward. > > Thanks, > Lois > > > On 4/16/2014 1:49 PM, harold seigel wrote: >> Hi, >> >> Please review this small change to fix bug JDK-8040018 for JDK-9. The >> fix removes the assert because it can be triggered by a class file >> containing an incorrect attribute_length value for the >> BoostrapMethods attribute, not just by a JVM inconsistency. Removing >> the assert lets the following guarantee_property() call catch the >> problem and throw a java.lang.ClassFormatError exception. >> >> The fix was tested with JPRT, JCK lang, JCK vm, hotspot jtreg, and >> nsk quick tests. The new test was tested on Linux and Windows. >> >> Open webrev at: http://cr.openjdk.java.net/~hseigel/bug_8040018/ >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8040018 >> >> Thanks! Harold > From coleen.phillimore at oracle.com Thu Apr 17 21:58:54 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Thu, 17 Apr 2014 17:58:54 -0400 Subject: RFR(XXS): JDK-8040887 - [TESTBUG] Remove test/runtime/6925573/SortMethodsTest.java In-Reply-To: <02a301cf5a80$1ef489d0$5cdd9d70$@oracle.com> References: <02a301cf5a80$1ef489d0$5cdd9d70$@oracle.com> Message-ID: <53504E9E.1040800@oracle.com> Looks good. Yes I agree. Coleen On 4/17/14, 5:00 PM, Christian Tornqvist wrote: > > Hi everyone, > > After a failed attempt to fix the timeout issues with this test I've > come to realize that it'll never be reliable in an environment where > tests are running concurrently. This test is more of a micro benchmark > than a regression test, so we've decided to remove this test. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8040887/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8040887 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ron.durbin at oracle.com Thu Apr 17 22:02:38 2014 From: ron.durbin at oracle.com (Ron Durbin) Date: Thu, 17 Apr 2014 15:02:38 -0700 (PDT) Subject: RFR(XXS): JDK-8040887 - [TESTBUG] Remove test/runtime/6925573/SortMethodsTest.java In-Reply-To: <53504E9E.1040800@oracle.com> References: <02a301cf5a80$1ef489d0$5cdd9d70$@oracle.com> <53504E9E.1040800@oracle.com> Message-ID: <2f547171-ed6a-4a65-a4bb-a653a00f4d60@default> looks good From: Coleen Phillimore Sent: Thursday, April 17, 2014 3:59 PM To: hotspot-runtime-dev at openjdk.java.net Subject: Re: RFR(XXS): JDK-8040887 - [TESTBUG] Remove test/runtime/6925573/SortMethodsTest.java Looks good. Yes I agree. Coleen On 4/17/14, 5:00 PM, Christian Tornqvist wrote: Hi everyone, After a failed attempt to fix the timeout issues with this test I've come to realize that it'll never be reliable in an environment where tests are running concurrently. This test is more of a micro benchmark than a regression test, so we've decided to remove this test. Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Ectornqvi/webrev/8040887/webrev.00/"http://cr.openjdk.java.net/~ctornqvi/webrev/8040887/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8040887 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.seigel at oracle.com Fri Apr 18 12:16:26 2014 From: harold.seigel at oracle.com (harold seigel) Date: Fri, 18 Apr 2014 08:16:26 -0400 Subject: RFR(XS): JDK-8040018 Remove bad assert in ClassFileParser.cpp In-Reply-To: <535048E3.5040506@oracle.com> References: <534EC2B9.5090204@oracle.com> <534F1657.4040808@oracle.com> <535048E3.5040506@oracle.com> Message-ID: <5351179A.20206@oracle.com> Hi Lois, Thanks for investigating your test and for your review. Harold On 4/17/2014 5:34 PM, Lois Foltan wrote: > Hi Harold, > > Just a follow up. After looking at this more today, I actually think > my ASM test case isn't working as intended. I think you are better > off going with the original .jcod/test.jar file for testing. As I > mentioned below, the code change looks good. > > Lois > > On 4/16/2014 7:46 PM, Lois Foltan wrote: >> Hi Harold, >> >> Overall I think the change to classFileParser.cpp looks good. My only >> comments are about the test case, ClassFileParserBug.java. I >> personally find the readability of the .jcod file cumbersome. I have >> attached a ASM file, TestBadBootstrapMethodsAttr.java, in case you >> would prefer a straight java file. It needs to be cleaned up before >> it can be checked into the test system, but it does demonstrate the >> issue. Also, is it possible to have the test case live in >> test/runtime/verifier instead of a new directory? >> >> If you feel that the .jcod file and test.jar file better exercise >> this class format issue, then by all means you have my review to go >> forward. >> >> Thanks, >> Lois >> >> >> On 4/16/2014 1:49 PM, harold seigel wrote: >>> Hi, >>> >>> Please review this small change to fix bug JDK-8040018 for JDK-9. >>> The fix removes the assert because it can be triggered by a class >>> file containing an incorrect attribute_length value for the >>> BoostrapMethods attribute, not just by a JVM inconsistency. Removing >>> the assert lets the following guarantee_property() call catch the >>> problem and throw a java.lang.ClassFormatError exception. >>> >>> The fix was tested with JPRT, JCK lang, JCK vm, hotspot jtreg, and >>> nsk quick tests. The new test was tested on Linux and Windows. >>> >>> Open webrev at: http://cr.openjdk.java.net/~hseigel/bug_8040018/ >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8040018 >>> >>> Thanks! Harold >> > From coleen.phillimore at oracle.com Fri Apr 18 12:30:47 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 18 Apr 2014 08:30:47 -0400 Subject: RFR(XS): JDK-8040018 Remove bad assert in ClassFileParser.cpp In-Reply-To: <534EC2B9.5090204@oracle.com> References: <534EC2B9.5090204@oracle.com> Message-ID: <53511AF7.5050206@oracle.com> Looks good, Harold. Coleen On 4/16/14, 1:49 PM, harold seigel wrote: > Hi, > > Please review this small change to fix bug JDK-8040018 for JDK-9. The > fix removes the assert because it can be triggered by a class file > containing an incorrect attribute_length value for the BoostrapMethods > attribute, not just by a JVM inconsistency. Removing the assert lets > the following guarantee_property() call catch the problem and throw a > java.lang.ClassFormatError exception. > > The fix was tested with JPRT, JCK lang, JCK vm, hotspot jtreg, and nsk > quick tests. The new test was tested on Linux and Windows. > > Open webrev at: http://cr.openjdk.java.net/~hseigel/bug_8040018/ > > Bug: https://bugs.openjdk.java.net/browse/JDK-8040018 > > Thanks! Harold From harold.seigel at oracle.com Fri Apr 18 12:40:44 2014 From: harold.seigel at oracle.com (harold seigel) Date: Fri, 18 Apr 2014 08:40:44 -0400 Subject: RFR(XS): JDK-8040018 Remove bad assert in ClassFileParser.cpp In-Reply-To: <53511AF7.5050206@oracle.com> References: <534EC2B9.5090204@oracle.com> <53511AF7.5050206@oracle.com> Message-ID: <53511D4C.8020606@oracle.com> Thank you Coleen! Harold On 4/18/2014 8:30 AM, Coleen Phillimore wrote: > > Looks good, Harold. > Coleen > > On 4/16/14, 1:49 PM, harold seigel wrote: >> Hi, >> >> Please review this small change to fix bug JDK-8040018 for JDK-9. The >> fix removes the assert because it can be triggered by a class file >> containing an incorrect attribute_length value for the >> BoostrapMethods attribute, not just by a JVM inconsistency. Removing >> the assert lets the following guarantee_property() call catch the >> problem and throw a java.lang.ClassFormatError exception. >> >> The fix was tested with JPRT, JCK lang, JCK vm, hotspot jtreg, and >> nsk quick tests. The new test was tested on Linux and Windows. >> >> Open webrev at: http://cr.openjdk.java.net/~hseigel/bug_8040018/ >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8040018 >> >> Thanks! Harold > From karen.kinnear at oracle.com Fri Apr 18 14:43:51 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Fri, 18 Apr 2014 10:43:51 -0400 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> Message-ID: Staffan, thank you for your patience. I am happy with the fix to Mac OS X in terms of adding the new code and the guarantee about time not moving backward. The cleanup in the Solaris code also looks good. What I would request please is to split this back into two parts - I would like further discussion of the flag in a separate thread, to allow the OS X changes to go back right away. And for the comment in the Solaris code - the one thing we do know is that Solaris does not actually guarantee that time will not go backward. They currently have issues running on virtual machines unless bound to a specific cpu, and in the past had issues with non-invariant TSC, which tells us that they do not have logic with specific guarantees handling changes across cores. So if there is a way to phrase this - it is not about Solaris having had bugs in the past, it is about Solaris not actually guaranteeing time not moving backward so we have to do it. thank you, Karen On Apr 15, 2014, at 8:27 AM, Staffan Larsen wrote: > > On 15 apr 2014, at 14:00, Karen Kinnear wrote: > >> Staffan, >> >> Have you heard back from the Solaris folks yet on how to tell that we are on a virtual machine, and >> where they tell us gethhrtime can move backward? > > I have not. It would be interesting to know this. > >> >> Is there any thought that in cases where we know there is a problem we might not want to >> follow a script's flag recommendation? > > The default with my change is to guard against time moving backwards. If you want the ?scary? behavior you have to say -XX:+UnlockExperimentalFeatures -XX:+AssumeMonotonicOSTimers?. > >> >> I have been in too many situations in which scripts for starting java applications are inherited on >> systems that are not appropriate, by folks who didn't write them and don't know the history >> of the flag settings. >> >> I am concerned about subtle unexpected behaviors here. >> >> Since I haven't had time (yet - sorry) to walk through all the callers of getTimeNanos - could >> you possibly let me know if there is a java call that ultimately uses this and if so, the impact >> on java code of time moving backward? > > Well.. the most obvious case is System.nanoTime(). It must not move backwards. But with the current code (before my change) it can do so on OS X (!). > >> >> Same for callers in the vm please? I believe Ramki fixed at least one of the garbage collectors >> that had problems if time moved backward. Are the vm internal callers ok if time moves backwards? > > Again, There should be no moving backwards unless you run with experimental features. > > Thanks, > /Staffan > >> >> Or I can do that research when I get the time - and I can get back to you on that tomorrow - sorry, >> another day of back-to-back meetings. >> >> thanks, >> Karen >> >> On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: >> >>> >>> On 15 apr 2014, at 11:38, David Holmes wrote: >>> >>>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>>> >>>>> On 15 apr 2014, at 09:14, David Holmes wrote: >>>>> >>>>>> Hi Staffan, >>>>>> >>>>>> Generally looks okay. >>>>>> >>>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>>> >>>>> I had forgotten to save the file. :-( >>>>> >>>>>> os_solaris.cpp: >>>>>> >>>>>> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. >>>>> >>>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. >>>> >>>> I'm in favour of removing dead code. :) >>> >>> Gone! >>> >>>>>> globals.hpp >>>>>> >>>>>> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) >>>>> >>>>> I will update the description to: >>>>> >>>>> experimental(bool, AssumeMonotonicOSTimers, false, \ >>>>> "Assume that the OS system timers are monotonic " \ >>>>> "(Solaris and OS X)") \ >>>> >>>> Sounds good. Will you close 6864866 as a duplicate of this one? >>> >>> I will include 6864866 in the hg commit message closing both with the same fix. >>> >>>> >>>>>> os.hpp: >>>>>> >>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>> # include "jvm_bsd.h" >>>>>> # include >>>>>> + # include >>>>>> #endif >>>>>> >>>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>>> >>>>> Changed it to: >>>>> >>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>> # include "jvm_bsd.h" >>>>> # include >>>>> # ifdef __APPLE__ >>>>> # include >>>>> # endif >>>> >>>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >>> >>> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >>> >>> Thanks, >>> /Staffan >>> >>>> >>>> Thanks, >>>> David >>>> >>>>> >>>>> Thanks, >>>>> /Staffan >>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >>>>>> >>>>>> Thanks, >>>>>> David >>>>>> >>>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>>>>>> os_solaris.cpp. >>>>>>> - obs -> obsv >>>>>>> - fixed URL to blog entry >>>>>>> >>>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>>> >>>>>>> /Staffan >>>>>>> >>>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>> > wrote: >>>>>>> >>>>>>>> >>>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>>> > wrote: >>>>>>>> >>>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>>> can get. >>>>>>>>> >>>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>>> already, but others on this list don?t. >>>>>>>> >>>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>>> >>>>>>>>> >>>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>>> we implement safeguards for this to make sure we never return a lower >>>>>>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>>> >>>>>>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>>>>>> safeguard seems OK. >>>>>>>>> >>>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>>> >>>>>>>>> This looks good to me. >>>>>>>> >>>>>>>> Thanks. >>>>>>>> >>>>>>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>>> >>>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>>> station, but perhaps 8u40? >>>>>>>> >>>>>>>> /Staffan >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lois.foltan at oracle.com Fri Apr 18 17:43:47 2014 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 18 Apr 2014 13:43:47 -0400 Subject: RFR (XS) JDK-8033584: Remove java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java from exclude list Message-ID: <53516453.9080706@oracle.com> Please review the following change to remove a test from ProblemList.txt. Webrev: http://cr.openjdk.java.net/~lfoltan/bug_jdk8033584/ Bug: Remove java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java from exclude list https://bugs.openjdk.java.net/browse/JDK-8033584 Summary: The issue causing TestPrivateInterfaceMethodReflect.java to fail was fixed by the JVM Runtime team for JDK 8, for details see JDK-8029415 . Thank you, Lois -------------- next part -------------- An HTML attachment was scrubbed... URL: From mandy.chung at oracle.com Fri Apr 18 17:49:50 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 18 Apr 2014 10:49:50 -0700 Subject: RFR (XS) JDK-8033584: Remove java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java from exclude list In-Reply-To: <53516453.9080706@oracle.com> References: <53516453.9080706@oracle.com> Message-ID: <535165BE.9060102@oracle.com> On 4/18/2014 10:43 AM, Lois Foltan wrote: > > Please review the following change to remove a test from ProblemList.txt. > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033584/ > > Bug: Remove > java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java > from exclude list > https://bugs.openjdk.java.net/browse/JDK-8033584 > Looks good. Mandy From george.triantafillou at oracle.com Fri Apr 18 18:18:46 2014 From: george.triantafillou at oracle.com (George Triantafillou) Date: Fri, 18 Apr 2014 14:18:46 -0400 Subject: RFR (XS) JDK-8033584: Remove java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java from exclude list In-Reply-To: <53516453.9080706@oracle.com> References: <53516453.9080706@oracle.com> Message-ID: <53516C86.3060909@oracle.com> Lois, Looks good. -George On 4/18/2014 1:43 PM, Lois Foltan wrote: > > Please review the following change to remove a test from ProblemList.txt. > > Webrev: > http://cr.openjdk.java.net/~lfoltan/bug_jdk8033584/ > > Bug: Remove > java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java > from exclude list > https://bugs.openjdk.java.net/browse/JDK-8033584 > > Summary: > The issue causing TestPrivateInterfaceMethodReflect.java to fail was > fixed by the JVM Runtime team for JDK 8, for details see JDK-8029415 > . > > Thank you, > Lois -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 22 08:06:52 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 22 Apr 2014 10:06:52 +0200 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> Message-ID: <5E4FF5E1-F4D9-41D9-9689-7DF398C1C06D@oracle.com> I have removed the AssumeMonotonicOSTime flag from this change set and updated the comments in the solaris code. Newest webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.04/ Thanks, /Staffan On 18 apr 2014, at 16:43, Karen Kinnear wrote: > Staffan, > > thank you for your patience. > > I am happy with the fix to Mac OS X in terms of adding the new code and the guarantee about > time not moving backward. > > The cleanup in the Solaris code also looks good. > > What I would request please is to split this back into two parts - I would like further discussion of the flag > in a separate thread, to allow the OS X changes to go back right away. > > And for the comment in the Solaris code - the one thing we do know is that Solaris does not actually > guarantee that time will not go backward. They currently have issues running on virtual machines unless > bound to a specific cpu, and in the past had issues with non-invariant TSC, which tells us that they do not have > logic with specific guarantees handling changes across cores. So if there is a way to phrase this - it is not > about Solaris having had bugs in the past, it is about Solaris not actually guaranteeing time not moving > backward so we have to do it. > > thank you, > Karen > > On Apr 15, 2014, at 8:27 AM, Staffan Larsen wrote: > >> >> On 15 apr 2014, at 14:00, Karen Kinnear wrote: >> >>> Staffan, >>> >>> Have you heard back from the Solaris folks yet on how to tell that we are on a virtual machine, and >>> where they tell us gethhrtime can move backward? >> >> I have not. It would be interesting to know this. >> >>> >>> Is there any thought that in cases where we know there is a problem we might not want to >>> follow a script's flag recommendation? >> >> The default with my change is to guard against time moving backwards. If you want the ?scary? behavior you have to say -XX:+UnlockExperimentalFeatures -XX:+AssumeMonotonicOSTimers?. >> >>> >>> I have been in too many situations in which scripts for starting java applications are inherited on >>> systems that are not appropriate, by folks who didn't write them and don't know the history >>> of the flag settings. >>> >>> I am concerned about subtle unexpected behaviors here. >>> >>> Since I haven't had time (yet - sorry) to walk through all the callers of getTimeNanos - could >>> you possibly let me know if there is a java call that ultimately uses this and if so, the impact >>> on java code of time moving backward? >> >> Well.. the most obvious case is System.nanoTime(). It must not move backwards. But with the current code (before my change) it can do so on OS X (!). >> >>> >>> Same for callers in the vm please? I believe Ramki fixed at least one of the garbage collectors >>> that had problems if time moved backward. Are the vm internal callers ok if time moves backwards? >> >> Again, There should be no moving backwards unless you run with experimental features. >> >> Thanks, >> /Staffan >> >>> >>> Or I can do that research when I get the time - and I can get back to you on that tomorrow - sorry, >>> another day of back-to-back meetings. >>> >>> thanks, >>> Karen >>> >>> On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: >>> >>>> >>>> On 15 apr 2014, at 11:38, David Holmes wrote: >>>> >>>>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>>>> >>>>>> On 15 apr 2014, at 09:14, David Holmes wrote: >>>>>> >>>>>>> Hi Staffan, >>>>>>> >>>>>>> Generally looks okay. >>>>>>> >>>>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>>>> >>>>>> I had forgotten to save the file. :-( >>>>>> >>>>>>> os_solaris.cpp: >>>>>>> >>>>>>> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. >>>>>> >>>>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. >>>>> >>>>> I'm in favour of removing dead code. :) >>>> >>>> Gone! >>>> >>>>>>> globals.hpp >>>>>>> >>>>>>> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) >>>>>> >>>>>> I will update the description to: >>>>>> >>>>>> experimental(bool, AssumeMonotonicOSTimers, false, \ >>>>>> "Assume that the OS system timers are monotonic " \ >>>>>> "(Solaris and OS X)") \ >>>>> >>>>> Sounds good. Will you close 6864866 as a duplicate of this one? >>>> >>>> I will include 6864866 in the hg commit message closing both with the same fix. >>>> >>>>> >>>>>>> os.hpp: >>>>>>> >>>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>>> # include "jvm_bsd.h" >>>>>>> # include >>>>>>> + # include >>>>>>> #endif >>>>>>> >>>>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>>>> >>>>>> Changed it to: >>>>>> >>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>> # include "jvm_bsd.h" >>>>>> # include >>>>>> # ifdef __APPLE__ >>>>>> # include >>>>>> # endif >>>>> >>>>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >>>> >>>> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >>>> >>>> Thanks, >>>> /Staffan >>>> >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>>> >>>>>> Thanks, >>>>>> /Staffan >>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >>>>>>> >>>>>>> Thanks, >>>>>>> David >>>>>>> >>>>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>>>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>>>>>>> os_solaris.cpp. >>>>>>>> - obs -> obsv >>>>>>>> - fixed URL to blog entry >>>>>>>> >>>>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>>>> >>>>>>>> /Staffan >>>>>>>> >>>>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>>> > wrote: >>>>>>>> >>>>>>>>> >>>>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>>>> can get. >>>>>>>>>> >>>>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>>>> already, but others on this list don?t. >>>>>>>>> >>>>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>>>> we implement safeguards for this to make sure we never return a lower >>>>>>>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>>>> >>>>>>>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>>>>>>> safeguard seems OK. >>>>>>>>>> >>>>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>>>> >>>>>>>>>> This looks good to me. >>>>>>>>> >>>>>>>>> Thanks. >>>>>>>>> >>>>>>>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>>>> >>>>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>>>> station, but perhaps 8u40? >>>>>>>>> >>>>>>>>> /Staffan >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 22 08:19:25 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 22 Apr 2014 10:19:25 +0200 Subject: RFR: 6864866: add a flag to use result of gethrtime() directly in os::getTimeNanos() Message-ID: This is a follow-up to the review thread for JDK-8040140: "System.nanoTime() is slow and non-monotonic on OS X?. It was proposed in that thread to split out the addition of an experimental flag to remove the safety checks to a different review. On Solaris and OS X we take extra precautions to make sure that System.nanoTime() does not move backwards since we are not confident that the OS level calls provide this guarantee in all circumstances. The extra code we run does take time and can interfere with timing measurements. Thus the addition of an experimental flag to circumvent the extra code. This flag is intended for people who know what they are doing and have some degree of trust in their OS/hardware combination that we cannot provide in the general case. The flag does allow someone to create an unstable system where time can move backwards and cause all kinds of havoc, which is why the flag is not enabled by default. review: http://cr.openjdk.java.net/~sla/6864866/webrev.00/ bug: https://bugs.openjdk.java.net/browse/JDK-6864866 Thanks, /Staffan From david.simms at oracle.com Tue Apr 22 08:23:02 2014 From: david.simms at oracle.com (David Simms) Date: Tue, 22 Apr 2014 10:23:02 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <534E55AA.1070607@oracle.com> References: <533D5F54.4060202@oracle.com> <534E55AA.1070607@oracle.com> Message-ID: <535626E6.8020500@oracle.com> Looks good (not a R**eviewer). On 04/16/2014 12:04 PM, Marcus Larsson wrote: > Hi again, > > I need another round of review for this fix. > Found a problem with the patch and had to update it, also added an > internal VM test for it. > Built and tested on all platforms with JPRT. > > Updated webrev at: http://cr.openjdk.java.net/~dsimms/6664815/ > > Thanks, > Marcus > > On 04/03/2014 03:17 PM, Marcus Larsson wrote: >> Hello, >> >> I would like reviews for the following bugfix removing a redundant >> memcpy. >> Built on all platforms and tested with JCK. >> >> Webrev: >> http://cr.openjdk.java.net/~dsimms/6664815/ >> >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-6664815 >> >> Regards, >> Marcus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.spitsyn at oracle.com Tue Apr 22 09:22:54 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Tue, 22 Apr 2014 02:22:54 -0700 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <5E4FF5E1-F4D9-41D9-9689-7DF398C1C06D@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> <5E4FF5E1-F4D9-41D9-9689-7DF398C1C06D@oracle.com> Message-ID: <535634EE.8020204@oracle.com> Looks good. Thanks, Serguei On 4/22/14 1:06 AM, Staffan Larsen wrote: > I have removed the AssumeMonotonicOSTime flag from this change set and > updated the comments in the solaris code. > > Newest webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.04/ > > > Thanks, > /Staffan > > > On 18 apr 2014, at 16:43, Karen Kinnear > wrote: > >> Staffan, >> >> thank you for your patience. >> >> I am happy with the fix to Mac OS X in terms of adding the new code >> and the guarantee about >> time not moving backward. >> >> The cleanup in the Solaris code also looks good. >> >> What I would request please is to split this back into two parts - I >> would like further discussion of the flag >> in a separate thread, to allow the OS X changes to go back right away. >> >> And for the comment in the Solaris code - the one thing we do know is >> that Solaris does not actually >> guarantee that time will not go backward. They currently have issues >> running on virtual machines unless >> bound to a specific cpu, and in the past had issues with >> non-invariant TSC, which tells us that they do not have >> logic with specific guarantees handling changes across cores. So if >> there is a way to phrase this - it is not >> about Solaris having had bugs in the past, it is about Solaris not >> actually guaranteeing time not moving >> backward so we have to do it. >> >> thank you, >> Karen >> >> On Apr 15, 2014, at 8:27 AM, Staffan Larsen wrote: >> >>> >>> On 15 apr 2014, at 14:00, Karen Kinnear >> > wrote: >>> >>>> Staffan, >>>> >>>> Have you heard back from the Solaris folks yet on how to tell that >>>> we are on a virtual machine, and >>>> where they tell us gethhrtime can move backward? >>> >>> I have not. It would be interesting to know this. >>> >>>> >>>> Is there any thought that in cases where we know there is a problem >>>> we might not want to >>>> follow a script's flag recommendation? >>> >>> The default with my change is to guard against time moving >>> backwards. If you want the ?scary? behavior you have to say >>> -XX:+UnlockExperimentalFeatures -XX:+AssumeMonotonicOSTimers?. >>> >>>> >>>> I have been in too many situations in which scripts for starting >>>> java applications are inherited on >>>> systems that are not appropriate, by folks who didn't write them >>>> and don't know the history >>>> of the flag settings. >>>> >>>> I am concerned about subtle unexpected behaviors here. >>>> >>>> Since I haven't had time (yet - sorry) to walk through all the >>>> callers of getTimeNanos - could >>>> you possibly let me know if there is a java call that ultimately >>>> uses this and if so, the impact >>>> on java code of time moving backward? >>> >>> Well.. the most obvious case is System.nanoTime(). It must not move >>> backwards. But with the current code (before my change) it can do so >>> on OS X (!). >>> >>>> >>>> Same for callers in the vm please? I believe Ramki fixed at least >>>> one of the garbage collectors >>>> that had problems if time moved backward. Are the vm internal >>>> callers ok if time moves backwards? >>> >>> Again, There should be no moving backwards unless you run with >>> experimental features. >>> >>> Thanks, >>> /Staffan >>> >>>> >>>> Or I can do that research when I get the time - and I can get back >>>> to you on that tomorrow - sorry, >>>> another day of back-to-back meetings. >>>> >>>> thanks, >>>> Karen >>>> >>>> On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: >>>> >>>>> >>>>> On 15 apr 2014, at 11:38, David Holmes >>>> > wrote: >>>>> >>>>>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>>>>> >>>>>>> On 15 apr 2014, at 09:14, David Holmes >>>>>> > wrote: >>>>>>> >>>>>>>> Hi Staffan, >>>>>>>> >>>>>>>> Generally looks okay. >>>>>>>> >>>>>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>>>>> >>>>>>> I had forgotten to save the file. :-( >>>>>>> >>>>>>>> os_solaris.cpp: >>>>>>>> >>>>>>>> In the Solaris changes there is a lot of old code with >>>>>>>> inaccurate comments, but I suppose cleaning that up >>>>>>>> (oldgetTimeNanos()) is out of scope. You only added the check >>>>>>>> for AssumeMonotonicOSTimers in the supports_cx8 path, but the >>>>>>>> other path is now dead code. >>>>>>> >>>>>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 >>>>>>> is defined) on both solaris sparc and solaris x86, it looks like >>>>>>> oldgetTimeNanos() is really dead code. I can remove it as part >>>>>>> of this change if that?s ok. >>>>>> >>>>>> I'm in favour of removing dead code. :) >>>>> >>>>> Gone! >>>>> >>>>>>>> globals.hpp >>>>>>>> >>>>>>>> Do we need to document this only affects OSX and Solaris? >>>>>>>> (Though implicitly this acts as-if true on Linux and Windows in >>>>>>>> the common case.) >>>>>>> >>>>>>> I will update the description to: >>>>>>> >>>>>>> experimental(bool, AssumeMonotonicOSTimers, false, >>>>>>> \ >>>>>>> "Assume that the OS system timers are monotonic " >>>>>>> \ >>>>>>> "(Solaris and OS X)") >>>>>>> \ >>>>>> >>>>>> Sounds good. Will you close 6864866 as a duplicate of this one? >>>>> >>>>> I will include 6864866 in the hg commit message closing both with >>>>> the same fix. >>>>> >>>>>> >>>>>>>> os.hpp: >>>>>>>> >>>>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>>>> # include "jvm_bsd.h" >>>>>>>> # include >>>>>>>> + # include >>>>>>>> #endif >>>>>>>> >>>>>>>> I think this include needs to be in a OSX/Apple specific >>>>>>>> conditional. >>>>>>> >>>>>>> Changed it to: >>>>>>> >>>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>>> # include "jvm_bsd.h" >>>>>>> # include >>>>>>> # ifdef __APPLE__ >>>>>>> # include >>>>>>> # endif >>>>>> >>>>>> Ok. I wonder if someone could test this on a non-Apple BSD >>>>>> system? ;-) >>>>> >>>>> Updated review here: >>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >>>>> >>>>> >>>>> Thanks, >>>>> /Staffan >>>>> >>>>>> >>>>>> Thanks, >>>>>> David >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> /Staffan >>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> We should really fix the non-monotonic-clock path in the Linux >>>>>>>> and Windows implementations too ... but 32-bit is problematic >>>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> David >>>>>>>> >>>>>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>>>>> Here is an updated webrev with changes to the comments in >>>>>>>>> os_bsd.cpp and >>>>>>>>> os_solaris.cpp. >>>>>>>>> - obs -> obsv >>>>>>>>> - fixed URL to blog entry >>>>>>>>> >>>>>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>>>>> >>>>>>>>> >>>>>>>>> /Staffan >>>>>>>>> >>>>>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>>>>> >>>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>>>>> >>>>>>>>> >>>>>>>>>> > wrote: >>>>>>>>>> >>>>>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, >>>>>>>>>>>> but with >>>>>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>>>>> nanoseconds using information from mach_timebase_info(). >>>>>>>>>>>> Calls to >>>>>>>>>>>> mach_absolute_time() do not enter the kernel and are very >>>>>>>>>>>> fast. The >>>>>>>>>>>> resulting time has nanosecond precision and as good >>>>>>>>>>>> accuracy as one >>>>>>>>>>>> can get. >>>>>>>>>>> >>>>>>>>>>> Some numbers would be good on the public list :) I know the >>>>>>>>>>> numbers >>>>>>>>>>> already, but others on this list don?t. >>>>>>>>>> >>>>>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> Since the value from RDTSC can be subject to drifting >>>>>>>>>>>> between CPUs, >>>>>>>>>>>> we implement safeguards for this to make sure we never >>>>>>>>>>>> return a lower >>>>>>>>>>>> value than the previous values. This adds some overhead to >>>>>>>>>>>> nanoTime() >>>>>>>>>>>> but guards us against possible bugs in the OS. For users >>>>>>>>>>>> who are >>>>>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>>>>> >>>>>>>>>>> I now wonder if this safeguard can produce a stream of >>>>>>>>>>> exactly the same >>>>>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>>>>> alternative of answering the retrograde time, and the >>>>>>>>>>> observation the >>>>>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, >>>>>>>>>>> having this >>>>>>>>>>> safeguard seems OK. >>>>>>>>>>> >>>>>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>>>>> >>>>>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>>>>> >>>>>>>>>>> This looks good to me. >>>>>>>>>> >>>>>>>>>> Thanks. >>>>>>>>>> >>>>>>>>>>> And, since this question will inevitably pop up, do we plan >>>>>>>>>>> to bring it >>>>>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>>>>> >>>>>>>>>> I would like to do so, but I would also like to have it sit >>>>>>>>>> and bake >>>>>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>>>>> station, but perhaps 8u40? >>>>>>>>>> >>>>>>>>>> /Staffan >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.spitsyn at oracle.com Tue Apr 22 09:26:28 2014 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Tue, 22 Apr 2014 02:26:28 -0700 Subject: RFR: 6864866: add a flag to use result of gethrtime() directly in os::getTimeNanos() In-Reply-To: References: Message-ID: <535635C4.2060107@oracle.com> Looks good. Thanks, Serguei On 4/22/14 1:19 AM, Staffan Larsen wrote: > This is a follow-up to the review thread for JDK-8040140: "System.nanoTime() is slow and non-monotonic on OS X?. It was proposed in that thread to split out the addition of an experimental flag to remove the safety checks to a different review. > > On Solaris and OS X we take extra precautions to make sure that System.nanoTime() does not move backwards since we are not confident that the OS level calls provide this guarantee in all circumstances. The extra code we run does take time and can interfere with timing measurements. Thus the addition of an experimental flag to circumvent the extra code. This flag is intended for people who know what they are doing and have some degree of trust in their OS/hardware combination that we cannot provide in the general case. The flag does allow someone to create an unstable system where time can move backwards and cause all kinds of havoc, which is why the flag is not enabled by default. > > review: http://cr.openjdk.java.net/~sla/6864866/webrev.00/ > bug: https://bugs.openjdk.java.net/browse/JDK-6864866 > > Thanks, > /Staffan From david.holmes at oracle.com Tue Apr 22 10:14:13 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 22 Apr 2014 20:14:13 +1000 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> Message-ID: <535640F5.8010902@oracle.com> Karen, On 19/04/2014 12:43 AM, Karen Kinnear wrote: > Staffan, > > thank you for your patience. > > I am happy with the fix to Mac OS X in terms of adding the new code and > the guarantee about > time not moving backward. > > The cleanup in the Solaris code also looks good. > > What I would request please is to split this back into two parts - I > would like further discussion of the flag > in a separate thread, to allow the OS X changes to go back right away. > > And for the comment in the Solaris code - the one thing we do know is > that Solaris does not actually > guarantee that time will not go backward. The documentation for gethrtime certainly DOES guarantee that. From the manpage: NOTES Although the units of hi-res time are always the same (nanoseconds), the actual resolution is hardware dependent. Hi-res time is guaranteed to be monotonic (it won't go back- ward, it won't periodically wrap) and linear (it won't occa- sionally speed up or slow down for adjustment, like the time of day can), but not necessarily unique: two sufficiently proximate calls may return the same value. All the issue you cite are acknowledged bugs in the OS. David ----- They currently have issues > running on virtual machines unless > bound to a specific cpu, and in the past had issues with non-invariant > TSC, which tells us that they do not have > logic with specific guarantees handling changes across cores. So if > there is a way to phrase this - it is not > about Solaris having had bugs in the past, it is about Solaris not > actually guaranteeing time not moving > backward so we have to do it. > > thank you, > Karen > > On Apr 15, 2014, at 8:27 AM, Staffan Larsen wrote: > >> >> On 15 apr 2014, at 14:00, Karen Kinnear > > wrote: >> >>> Staffan, >>> >>> Have you heard back from the Solaris folks yet on how to tell that we >>> are on a virtual machine, and >>> where they tell us gethhrtime can move backward? >> >> I have not. It would be interesting to know this. >> >>> >>> Is there any thought that in cases where we know there is a problem >>> we might not want to >>> follow a script's flag recommendation? >> >> The default with my change is to guard against time moving backwards. >> If you want the ?scary? behavior you have to say >> -XX:+UnlockExperimentalFeatures -XX:+AssumeMonotonicOSTimers?. >> >>> >>> I have been in too many situations in which scripts for starting java >>> applications are inherited on >>> systems that are not appropriate, by folks who didn't write them and >>> don't know the history >>> of the flag settings. >>> >>> I am concerned about subtle unexpected behaviors here. >>> >>> Since I haven't had time (yet - sorry) to walk through all the >>> callers of getTimeNanos - could >>> you possibly let me know if there is a java call that ultimately uses >>> this and if so, the impact >>> on java code of time moving backward? >> >> Well.. the most obvious case is System.nanoTime(). It must not move >> backwards. But with the current code (before my change) it can do so >> on OS X (!). >> >>> >>> Same for callers in the vm please? I believe Ramki fixed at least one >>> of the garbage collectors >>> that had problems if time moved backward. Are the vm internal callers >>> ok if time moves backwards? >> >> Again, There should be no moving backwards unless you run with >> experimental features. >> >> Thanks, >> /Staffan >> >>> >>> Or I can do that research when I get the time - and I can get back to >>> you on that tomorrow - sorry, >>> another day of back-to-back meetings. >>> >>> thanks, >>> Karen >>> >>> On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: >>> >>>> >>>> On 15 apr 2014, at 11:38, David Holmes >>> > wrote: >>>> >>>>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>>>> >>>>>> On 15 apr 2014, at 09:14, David Holmes >>>>> > wrote: >>>>>> >>>>>>> Hi Staffan, >>>>>>> >>>>>>> Generally looks okay. >>>>>>> >>>>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>>>> >>>>>> I had forgotten to save the file. :-( >>>>>> >>>>>>> os_solaris.cpp: >>>>>>> >>>>>>> In the Solaris changes there is a lot of old code with inaccurate >>>>>>> comments, but I suppose cleaning that up (oldgetTimeNanos()) is >>>>>>> out of scope. You only added the check for >>>>>>> AssumeMonotonicOSTimers in the supports_cx8 path, but the other >>>>>>> path is now dead code. >>>>>> >>>>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is >>>>>> defined) on both solaris sparc and solaris x86, it looks like >>>>>> oldgetTimeNanos() is really dead code. I can remove it as part of >>>>>> this change if that?s ok. >>>>> >>>>> I'm in favour of removing dead code. :) >>>> >>>> Gone! >>>> >>>>>>> globals.hpp >>>>>>> >>>>>>> Do we need to document this only affects OSX and Solaris? (Though >>>>>>> implicitly this acts as-if true on Linux and Windows in the >>>>>>> common case.) >>>>>> >>>>>> I will update the description to: >>>>>> >>>>>> experimental(bool, AssumeMonotonicOSTimers, false, >>>>>> \ >>>>>> "Assume that the OS system timers are monotonic " >>>>>> \ >>>>>> "(Solaris and OS X)") >>>>>> \ >>>>> >>>>> Sounds good. Will you close 6864866 as a duplicate of this one? >>>> >>>> I will include 6864866 in the hg commit message closing both with >>>> the same fix. >>>> >>>>> >>>>>>> os.hpp: >>>>>>> >>>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>>> # include "jvm_bsd.h" >>>>>>> # include >>>>>>> + # include >>>>>>> #endif >>>>>>> >>>>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>>>> >>>>>> Changed it to: >>>>>> >>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>> # include "jvm_bsd.h" >>>>>> # include >>>>>> # ifdef __APPLE__ >>>>>> # include >>>>>> # endif >>>>> >>>>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >>>> >>>> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >>>> >>>> Thanks, >>>> /Staffan >>>> >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>>> >>>>>> Thanks, >>>>>> /Staffan >>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> We should really fix the non-monotonic-clock path in the Linux >>>>>>> and Windows implementations too ... but 32-bit is problematic >>>>>>> >>>>>>> Thanks, >>>>>>> David >>>>>>> >>>>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>>>> Here is an updated webrev with changes to the comments in >>>>>>>> os_bsd.cpp and >>>>>>>> os_solaris.cpp. >>>>>>>> - obs -> obsv >>>>>>>> - fixed URL to blog entry >>>>>>>> >>>>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>>>> >>>>>>>> /Staffan >>>>>>>> >>>>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>>>> >>>>>>>> > wrote: >>>>>>>> >>>>>>>>> >>>>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>>>> >>>>>>>> >>>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, >>>>>>>>>>> but with >>>>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>>>> mach_absolute_time() do not enter the kernel and are very >>>>>>>>>>> fast. The >>>>>>>>>>> resulting time has nanosecond precision and as good accuracy >>>>>>>>>>> as one >>>>>>>>>>> can get. >>>>>>>>>> >>>>>>>>>> Some numbers would be good on the public list :) I know the >>>>>>>>>> numbers >>>>>>>>>> already, but others on this list don?t. >>>>>>>>> >>>>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Since the value from RDTSC can be subject to drifting between >>>>>>>>>>> CPUs, >>>>>>>>>>> we implement safeguards for this to make sure we never return >>>>>>>>>>> a lower >>>>>>>>>>> value than the previous values. This adds some overhead to >>>>>>>>>>> nanoTime() >>>>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>>>> >>>>>>>>>> I now wonder if this safeguard can produce a stream of exactly >>>>>>>>>> the same >>>>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>>>> alternative of answering the retrograde time, and the >>>>>>>>>> observation the >>>>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, >>>>>>>>>> having this >>>>>>>>>> safeguard seems OK. >>>>>>>>>> >>>>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>>>> >>>>>>>>>> This looks good to me. >>>>>>>>> >>>>>>>>> Thanks. >>>>>>>>> >>>>>>>>>> And, since this question will inevitably pop up, do we plan to >>>>>>>>>> bring it >>>>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>>>> >>>>>>>>> I would like to do so, but I would also like to have it sit and >>>>>>>>> bake >>>>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>>>> station, but perhaps 8u40? >>>>>>>>> >>>>>>>>> /Staffan >>>> >>> >> > From coleen.phillimore at oracle.com Tue Apr 22 12:26:14 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Tue, 22 Apr 2014 08:26:14 -0400 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <534E55AA.1070607@oracle.com> References: <533D5F54.4060202@oracle.com> <534E55AA.1070607@oracle.com> Message-ID: <53565FE6.70303@oracle.com> Hi Marcus, On line 3154 in jni.cpp, do we have no way of knowing how long the buffer passed to us is? I'm always at odds with this but does the JNI spec say we /must not/ check or do not check input parameters? But in this case, you cannot check. Is that true? The code change and refactoring and test look nice. Thanks, Coleen On 4/16/14, 6:04 AM, Marcus Larsson wrote: > Hi again, > > I need another round of review for this fix. > Found a problem with the patch and had to update it, also added an > internal VM test for it. > Built and tested on all platforms with JPRT. > > Updated webrev at: http://cr.openjdk.java.net/~dsimms/6664815/ > > Thanks, > Marcus > > On 04/03/2014 03:17 PM, Marcus Larsson wrote: >> Hello, >> >> I would like reviews for the following bugfix removing a redundant >> memcpy. >> Built on all platforms and tested with JCK. >> >> Webrev: >> http://cr.openjdk.java.net/~dsimms/6664815/ >> >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-6664815 >> >> Regards, >> Marcus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.seigel at oracle.com Tue Apr 22 13:21:47 2014 From: harold.seigel at oracle.com (harold seigel) Date: Tue, 22 Apr 2014 09:21:47 -0400 Subject: RFR JDK-8040292: The verifier does not check that some annotation attributes are illegally specified more than once Message-ID: <53566CEB.2010600@oracle.com> Hi, Please review this relatively small JDK-9 fix for bug JDK-8040292. The JVM Specification states that there can only be one instance of certain attributes. The VM checked this for some, but not all cases. This fix adds the missing checks. Open webrev: http://cr.openjdk.java.net/~hseigel/bug_8040292_9/ Bug: https://bugs.openjdk.java.net/browse/JDK-8040292 The fix was tested with the Hotspot JTREG tests, JCK Lang tests, nsk Quick tests, and the test case in this webrev. Thanks! Harold From marcus.larsson at oracle.com Wed Apr 23 07:37:35 2014 From: marcus.larsson at oracle.com (Marcus Larsson) Date: Wed, 23 Apr 2014 09:37:35 +0200 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <53565FE6.70303@oracle.com> References: <533D5F54.4060202@oracle.com> <534E55AA.1070607@oracle.com> <53565FE6.70303@oracle.com> Message-ID: <53576DBF.8040002@oracle.com> Hi Coleen, That's right - in this case it's not possible to check the length of the buffer even though we should or would want to do so. The caller has to ensure that the buffer is large enough to hold the result. Thanks, Marcus On 04/22/2014 02:26 PM, Coleen Phillimore wrote: > > Hi Marcus, > > On line 3154 in jni.cpp, do we have no way of knowing how long the > buffer passed to us is? I'm always at odds with this but does the JNI > spec say we /must not/ check or do not check input parameters? But in > this case, you cannot check. Is that true? > > The code change and refactoring and test look nice. > Thanks, > Coleen > > On 4/16/14, 6:04 AM, Marcus Larsson wrote: >> Hi again, >> >> I need another round of review for this fix. >> Found a problem with the patch and had to update it, also added an >> internal VM test for it. >> Built and tested on all platforms with JPRT. >> >> Updated webrev at: http://cr.openjdk.java.net/~dsimms/6664815/ >> >> Thanks, >> Marcus >> >> On 04/03/2014 03:17 PM, Marcus Larsson wrote: >>> Hello, >>> >>> I would like reviews for the following bugfix removing a redundant >>> memcpy. >>> Built on all platforms and tested with JCK. >>> >>> Webrev: >>> http://cr.openjdk.java.net/~dsimms/6664815/ >>> >>> Bug: >>> https://bugs.openjdk.java.net/browse/JDK-6664815 >>> >>> Regards, >>> Marcus >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Wed Apr 23 13:23:41 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 23 Apr 2014 09:23:41 -0400 Subject: RFR(XXS) 6664815: Eliminate redundant memcpy operation in jni_GetStringUTFRegion In-Reply-To: <53576DBF.8040002@oracle.com> References: <533D5F54.4060202@oracle.com> <534E55AA.1070607@oracle.com> <53565FE6.70303@oracle.com> <53576DBF.8040002@oracle.com> Message-ID: <5357BEDD.9050903@oracle.com> Thank you for confirming. Looks good. Coleen On 4/23/14, 3:37 AM, Marcus Larsson wrote: > Hi Coleen, > > That's right - in this case it's not possible to check the length of > the buffer > even though we should or would want to do so. The caller has to ensure > that the buffer is large enough to hold the result. > > Thanks, > Marcus > > On 04/22/2014 02:26 PM, Coleen Phillimore wrote: >> >> Hi Marcus, >> >> On line 3154 in jni.cpp, do we have no way of knowing how long the >> buffer passed to us is? I'm always at odds with this but does the >> JNI spec say we /must not/ check or do not check input parameters? >> But in this case, you cannot check. Is that true? >> >> The code change and refactoring and test look nice. >> Thanks, >> Coleen >> >> On 4/16/14, 6:04 AM, Marcus Larsson wrote: >>> Hi again, >>> >>> I need another round of review for this fix. >>> Found a problem with the patch and had to update it, also added an >>> internal VM test for it. >>> Built and tested on all platforms with JPRT. >>> >>> Updated webrev at: http://cr.openjdk.java.net/~dsimms/6664815/ >>> >>> Thanks, >>> Marcus >>> >>> On 04/03/2014 03:17 PM, Marcus Larsson wrote: >>>> Hello, >>>> >>>> I would like reviews for the following bugfix removing a redundant >>>> memcpy. >>>> Built on all platforms and tested with JCK. >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~dsimms/6664815/ >>>> >>>> Bug: >>>> https://bugs.openjdk.java.net/browse/JDK-6664815 >>>> >>>> Regards, >>>> Marcus >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.tornqvist at oracle.com Wed Apr 23 15:18:52 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Wed, 23 Apr 2014 11:18:52 -0400 Subject: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler Message-ID: <00d201cf5f07$566170f0$032452d0$@oracle.com> Hi everyone, This is a small fix for an issue on Windows where NMT tries to track a free from a static destructor and ends up hanging on acquiring the ThreadCritical lock. The fix is to make sure we shut down NMT before the VM exits and then to not track malloc/free when NMT is shutting down. Zhengyu is working on a rewrite of the NMT feature where this won't be an issue, so this is a temporary workaround until then. Tested on Windows x64 using vm.quick and Hotspot jtreg tests. Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/8033405/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8033405 Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Wed Apr 23 18:09:52 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 23 Apr 2014 14:09:52 -0400 Subject: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler In-Reply-To: <00d201cf5f07$566170f0$032452d0$@oracle.com> References: <00d201cf5f07$566170f0$032452d0$@oracle.com> Message-ID: <535801F0.2060407@oracle.com> Christian, This looks good as a minimal fix until the new code is ready. Thanks, Coleen On 4/23/14, 11:18 AM, Christian Tornqvist wrote: > > Hi everyone, > > This is a small fix for an issue on Windows where NMT tries to track a > free from a static destructor and ends up hanging on acquiring the > ThreadCritical lock. The fix is to make sure we shut down NMT before > the VM exits and then to not track malloc/free when NMT is shutting > down. Zhengyu is working on a rewrite of the NMT feature where this > won't be an issue, so this is a temporary workaround until then. > > Tested on Windows x64 using vm.quick and Hotspot jtreg tests. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8033405/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8033405 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhengyu.gu at oracle.com Wed Apr 23 19:02:35 2014 From: zhengyu.gu at oracle.com (Zhengyu Gu) Date: Wed, 23 Apr 2014 15:02:35 -0400 Subject: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler In-Reply-To: <00d201cf5f07$566170f0$032452d0$@oracle.com> References: <00d201cf5f07$566170f0$032452d0$@oracle.com> Message-ID: <53580E4B.3090004@oracle.com> Look good to me. -Zhengyu On 4/23/2014 11:18 AM, Christian Tornqvist wrote: > > Hi everyone, > > This is a small fix for an issue on Windows where NMT tries to track a > free from a static destructor and ends up hanging on acquiring the > ThreadCritical lock. The fix is to make sure we shut down NMT before > the VM exits and then to not track malloc/free when NMT is shutting > down. Zhengyu is working on a rewrite of the NMT feature where this > won't be an issue, so this is a temporary workaround until then. > > Tested on Windows x64 using vm.quick and Hotspot jtreg tests. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8033405/webrev.00/ > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8033405 > > Thanks, > > Christian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Wed Apr 23 23:00:14 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 23 Apr 2014 19:00:14 -0400 Subject: RFR JDK-8040292: The verifier does not check that some annotation attributes are illegally specified more than once In-Reply-To: <53566CEB.2010600@oracle.com> References: <53566CEB.2010600@oracle.com> Message-ID: <535845FE.1050600@oracle.com> This change looks good. I think this code needs to be refactored longer term. Coleen On 4/22/14, 9:21 AM, harold seigel wrote: > Hi, > > Please review this relatively small JDK-9 fix for bug JDK-8040292. The > JVM Specification states that there can only be one instance of > certain attributes. The VM checked this for some, but not all cases. > This fix adds the missing checks. > > Open webrev: http://cr.openjdk.java.net/~hseigel/bug_8040292_9/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8040292 > > The fix was tested with the Hotspot JTREG tests, JCK Lang tests, nsk > Quick tests, and the test case in this webrev. > > Thanks! Harold From david.holmes at oracle.com Thu Apr 24 08:28:42 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 24 Apr 2014 18:28:42 +1000 Subject: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler In-Reply-To: <00d201cf5f07$566170f0$032452d0$@oracle.com> References: <00d201cf5f07$566170f0$032452d0$@oracle.com> Message-ID: <5358CB3A.1080005@oracle.com> Hi Christian, On 24/04/2014 1:18 AM, Christian Tornqvist wrote: > Hi everyone, > > This is a small fix for an issue on Windows where NMT tries to track a > free from a static destructor and ends up hanging on acquiring the > ThreadCritical lock. The fix is to make sure we shut down NMT before the > VM exits and then to not track malloc/free when NMT is shutting down. The real fix is to get rid of those non-trivial static destructors! That aside when exactly in the VM termination process will DllMain be called? How can we be sure that there is sufficient VM state still valid to perform the NMT shutdown? The detach hook should only be doing very simple resource cleanup - I'm not sure this qualifies. David > Zhengyu is working on a rewrite of the NMT feature where this won?t be > an issue, so this is a temporary workaround until then. > > Tested on Windows x64 using vm.quick and Hotspot jtreg tests. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8033405/webrev.00/ > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8033405 > > Thanks, > > Christian > From christian.tornqvist at oracle.com Thu Apr 24 10:00:13 2014 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Thu, 24 Apr 2014 06:00:13 -0400 Subject: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler In-Reply-To: <5358CB3A.1080005@oracle.com> References: <00d201cf5f07$566170f0$032452d0$@oracle.com> <5358CB3A.1080005@oracle.com> Message-ID: <022d01cf5fa3$fcee7e30$f6cb7a90$@oracle.com> Hi David, >The real fix is to get rid of those non-trivial static destructors! Someone can battle this out with the GC team (and any other team with static destructors), this was our first suggestion but nothing happened. People have spent man-weeks debugging the deadlocks caused by this issue. As I wrote in my email, this is merely a workaround to get rid of this hard-to-diagnose and time consuming deadlock issue until Zhengyu can push his re-worked NMT implementation where this won't be a problem anymore. >That aside when exactly in the VM termination process will DllMain be called? DllMain gets called before the CRT starts calling the static destructors. >How can we be sure that there is sufficient VM state still valid to perform the NMT shutdown? The only thing the MemTracker::shutdown() does is change the NMT state to NMT_shutdown_pending. Even though nothing else is alive at this point we're merely changing some fields and the DLL is still loaded, otherwise we wouldn't be in DllMain. Thanks, Christian -----Original Message----- From: David Holmes [mailto:david.holmes at oracle.com] Sent: Thursday, April 24, 2014 4:29 AM To: Christian Tornqvist; 'hotspot-runtime-dev' Subject: Re: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler Hi Christian, On 24/04/2014 1:18 AM, Christian Tornqvist wrote: > Hi everyone, > > This is a small fix for an issue on Windows where NMT tries to track a > free from a static destructor and ends up hanging on acquiring the > ThreadCritical lock. The fix is to make sure we shut down NMT before > the VM exits and then to not track malloc/free when NMT is shutting down. The real fix is to get rid of those non-trivial static destructors! That aside when exactly in the VM termination process will DllMain be called? How can we be sure that there is sufficient VM state still valid to perform the NMT shutdown? The detach hook should only be doing very simple resource cleanup - I'm not sure this qualifies. David > Zhengyu is working on a rewrite of the NMT feature where this won't be > an issue, so this is a temporary workaround until then. > > Tested on Windows x64 using vm.quick and Hotspot jtreg tests. > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8033405/webrev.00/ > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8033405 > > Thanks, > > Christian > From david.holmes at oracle.com Thu Apr 24 10:29:26 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 24 Apr 2014 20:29:26 +1000 Subject: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 hangs in atexit handler In-Reply-To: <022d01cf5fa3$fcee7e30$f6cb7a90$@oracle.com> References: <00d201cf5f07$566170f0$032452d0$@oracle.com> <5358CB3A.1080005@oracle.com> <022d01cf5fa3$fcee7e30$f6cb7a90$@oracle.com> Message-ID: <5358E786.6080904@oracle.com> Hi Christian, On 24/04/2014 8:00 PM, Christian Tornqvist wrote: > Hi David, > >> The real fix is to get rid of those non-trivial static destructors! > > Someone can battle this out with the GC team (and any other team with static > destructors), this was our first suggestion but nothing happened. This is something the VM lead(s) should address. People > have spent man-weeks debugging the deadlocks caused by this issue. As I > wrote in my email, this is merely a workaround to get rid of this > hard-to-diagnose and time consuming deadlock issue until Zhengyu can push > his re-worked NMT implementation where this won't be a problem anymore. > >> That aside when exactly in the VM termination process will DllMain be > called? > DllMain gets called before the CRT starts calling the static destructors. > >> How can we be sure that there is sufficient VM state still valid to perform > the NMT shutdown? > The only thing the MemTracker::shutdown() does is change the NMT state to > NMT_shutdown_pending. Even though nothing else is alive at this point we're > merely changing some fields and the DLL is still loaded, otherwise we > wouldn't be in DllMain. Okay - I hadn't checked what it actually did and assumed it was more substantial. I'm very wary of adding any VM related unload code; particularly when the whole problem is already caused by an at_exit handler. Thanks for clarifying. David > Thanks, > Christian > > -----Original Message----- > From: David Holmes [mailto:david.holmes at oracle.com] > Sent: Thursday, April 24, 2014 4:29 AM > To: Christian Tornqvist; 'hotspot-runtime-dev' > Subject: Re: RFR(S): 8033405 - metaspace/stressHierarchy/stressHierarchy005 > hangs in atexit handler > > Hi Christian, > > On 24/04/2014 1:18 AM, Christian Tornqvist wrote: >> Hi everyone, >> >> This is a small fix for an issue on Windows where NMT tries to track a >> free from a static destructor and ends up hanging on acquiring the >> ThreadCritical lock. The fix is to make sure we shut down NMT before >> the VM exits and then to not track malloc/free when NMT is shutting down. > > The real fix is to get rid of those non-trivial static destructors! > > That aside when exactly in the VM termination process will DllMain be > called? How can we be sure that there is sufficient VM state still valid to > perform the NMT shutdown? The detach hook should only be doing very simple > resource cleanup - I'm not sure this qualifies. > > David > >> Zhengyu is working on a rewrite of the NMT feature where this won't be >> an issue, so this is a temporary workaround until then. >> >> Tested on Windows x64 using vm.quick and Hotspot jtreg tests. >> >> Webrev: >> >> http://cr.openjdk.java.net/~ctornqvi/webrev/8033405/webrev.00/ >> >> Bug: >> >> https://bugs.openjdk.java.net/browse/JDK-8033405 >> >> Thanks, >> >> Christian >> > From harold.seigel at oracle.com Thu Apr 24 14:09:45 2014 From: harold.seigel at oracle.com (harold seigel) Date: Thu, 24 Apr 2014 10:09:45 -0400 Subject: RFR JDK-8040292: The verifier does not check that some annotation attributes are illegally specified more than once In-Reply-To: <535845FE.1050600@oracle.com> References: <53566CEB.2010600@oracle.com> <535845FE.1050600@oracle.com> Message-ID: <53591B29.4060700@oracle.com> Hi Coleen, Thanks for the review. I agree with your refactoring comment. Harold On 4/23/2014 7:00 PM, Coleen Phillimore wrote: > > This change looks good. I think this code needs to be refactored > longer term. > Coleen > > On 4/22/14, 9:21 AM, harold seigel wrote: >> Hi, >> >> Please review this relatively small JDK-9 fix for bug JDK-8040292. >> The JVM Specification states that there can only be one instance of >> certain attributes. The VM checked this for some, but not all >> cases. This fix adds the missing checks. >> >> Open webrev: http://cr.openjdk.java.net/~hseigel/bug_8040292_9/ >> Bug: https://bugs.openjdk.java.net/browse/JDK-8040292 >> >> The fix was tested with the Hotspot JTREG tests, JCK Lang tests, nsk >> Quick tests, and the test case in this webrev. >> >> Thanks! Harold > From karen.kinnear at oracle.com Thu Apr 24 14:34:05 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Thu, 24 Apr 2014 10:34:05 -0400 Subject: RFR: 8040140 System.nanoTime() is slow and non-monotonic on OS X In-Reply-To: <5E4FF5E1-F4D9-41D9-9689-7DF398C1C06D@oracle.com> References: <534C323E.2040809@oracle.com> <534CDC62.6010906@oracle.com> <534CFE33.2040106@oracle.com> <9487EC6A-50D0-4B4B-B4DE-F99B4A7C4CEC@oracle.com> <0D0408AF-B26A-4A34-AB44-2B46C1D3DAC2@oracle.com> <5E4FF5E1-F4D9-41D9-9689-7DF398C1C06D@oracle.com> Message-ID: Staffan, Looks good. Thank you for separating out the issues to get the Mac OS X fixes in right away. thanks, Karen On Apr 22, 2014, at 4:06 AM, Staffan Larsen wrote: > I have removed the AssumeMonotonicOSTime flag from this change set and updated the comments in the solaris code. > > Newest webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.04/ > > Thanks, > /Staffan > > > On 18 apr 2014, at 16:43, Karen Kinnear wrote: > >> Staffan, >> >> thank you for your patience. >> >> I am happy with the fix to Mac OS X in terms of adding the new code and the guarantee about >> time not moving backward. >> >> The cleanup in the Solaris code also looks good. >> >> What I would request please is to split this back into two parts - I would like further discussion of the flag >> in a separate thread, to allow the OS X changes to go back right away. >> >> And for the comment in the Solaris code - the one thing we do know is that Solaris does not actually >> guarantee that time will not go backward. They currently have issues running on virtual machines unless >> bound to a specific cpu, and in the past had issues with non-invariant TSC, which tells us that they do not have >> logic with specific guarantees handling changes across cores. So if there is a way to phrase this - it is not >> about Solaris having had bugs in the past, it is about Solaris not actually guaranteeing time not moving >> backward so we have to do it. >> >> thank you, >> Karen >> >> On Apr 15, 2014, at 8:27 AM, Staffan Larsen wrote: >> >>> >>> On 15 apr 2014, at 14:00, Karen Kinnear wrote: >>> >>>> Staffan, >>>> >>>> Have you heard back from the Solaris folks yet on how to tell that we are on a virtual machine, and >>>> where they tell us gethhrtime can move backward? >>> >>> I have not. It would be interesting to know this. >>> >>>> >>>> Is there any thought that in cases where we know there is a problem we might not want to >>>> follow a script's flag recommendation? >>> >>> The default with my change is to guard against time moving backwards. If you want the ?scary? behavior you have to say -XX:+UnlockExperimentalFeatures -XX:+AssumeMonotonicOSTimers?. >>> >>>> >>>> I have been in too many situations in which scripts for starting java applications are inherited on >>>> systems that are not appropriate, by folks who didn't write them and don't know the history >>>> of the flag settings. >>>> >>>> I am concerned about subtle unexpected behaviors here. >>>> >>>> Since I haven't had time (yet - sorry) to walk through all the callers of getTimeNanos - could >>>> you possibly let me know if there is a java call that ultimately uses this and if so, the impact >>>> on java code of time moving backward? >>> >>> Well.. the most obvious case is System.nanoTime(). It must not move backwards. But with the current code (before my change) it can do so on OS X (!). >>> >>>> >>>> Same for callers in the vm please? I believe Ramki fixed at least one of the garbage collectors >>>> that had problems if time moved backward. Are the vm internal callers ok if time moves backwards? >>> >>> Again, There should be no moving backwards unless you run with experimental features. >>> >>> Thanks, >>> /Staffan >>> >>>> >>>> Or I can do that research when I get the time - and I can get back to you on that tomorrow - sorry, >>>> another day of back-to-back meetings. >>>> >>>> thanks, >>>> Karen >>>> >>>> On Apr 15, 2014, at 7:42 AM, Staffan Larsen wrote: >>>> >>>>> >>>>> On 15 apr 2014, at 11:38, David Holmes wrote: >>>>> >>>>>> On 15/04/2014 7:20 PM, Staffan Larsen wrote: >>>>>>> >>>>>>> On 15 apr 2014, at 09:14, David Holmes wrote: >>>>>>> >>>>>>>> Hi Staffan, >>>>>>>> >>>>>>>> Generally looks okay. >>>>>>>> >>>>>>>> os_bsd.cpp still shows the old URL for Dave Dice's article >>>>>>> >>>>>>> I had forgotten to save the file. :-( >>>>>>> >>>>>>>> os_solaris.cpp: >>>>>>>> >>>>>>>> In the Solaris changes there is a lot of old code with inaccurate comments, but I suppose cleaning that up (oldgetTimeNanos()) is out of scope. You only added the check for AssumeMonotonicOSTimers in the supports_cx8 path, but the other path is now dead code. >>>>>>> >>>>>>> Since supports_cx8() returns true (because SUPPORTS_NATIVE_CX8 is defined) on both solaris sparc and solaris x86, it looks like oldgetTimeNanos() is really dead code. I can remove it as part of this change if that?s ok. >>>>>> >>>>>> I'm in favour of removing dead code. :) >>>>> >>>>> Gone! >>>>> >>>>>>>> globals.hpp >>>>>>>> >>>>>>>> Do we need to document this only affects OSX and Solaris? (Though implicitly this acts as-if true on Linux and Windows in the common case.) >>>>>>> >>>>>>> I will update the description to: >>>>>>> >>>>>>> experimental(bool, AssumeMonotonicOSTimers, false, \ >>>>>>> "Assume that the OS system timers are monotonic " \ >>>>>>> "(Solaris and OS X)") \ >>>>>> >>>>>> Sounds good. Will you close 6864866 as a duplicate of this one? >>>>> >>>>> I will include 6864866 in the hg commit message closing both with the same fix. >>>>> >>>>>> >>>>>>>> os.hpp: >>>>>>>> >>>>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>>>> # include "jvm_bsd.h" >>>>>>>> # include >>>>>>>> + # include >>>>>>>> #endif >>>>>>>> >>>>>>>> I think this include needs to be in a OSX/Apple specific conditional. >>>>>>> >>>>>>> Changed it to: >>>>>>> >>>>>>> #ifdef TARGET_OS_FAMILY_bsd >>>>>>> # include "jvm_bsd.h" >>>>>>> # include >>>>>>> # ifdef __APPLE__ >>>>>>> # include >>>>>>> # endif >>>>>> >>>>>> Ok. I wonder if someone could test this on a non-Apple BSD system? ;-) >>>>> >>>>> Updated review here: http://cr.openjdk.java.net/~sla/8040140/webrev.02/ >>>>> >>>>> Thanks, >>>>> /Staffan >>>>> >>>>>> >>>>>> Thanks, >>>>>> David >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> /Staffan >>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> We should really fix the non-monotonic-clock path in the Linux and Windows implementations too ... but 32-bit is problematic >>>>>>>> >>>>>>>> Thanks, >>>>>>>> David >>>>>>>> >>>>>>>> On 15/04/2014 4:00 PM, Staffan Larsen wrote: >>>>>>>>> Here is an updated webrev with changes to the comments in os_bsd.cpp and >>>>>>>>> os_solaris.cpp. >>>>>>>>> - obs -> obsv >>>>>>>>> - fixed URL to blog entry >>>>>>>>> >>>>>>>>> http://cr.openjdk.java.net/~sla/8040140/webrev.01/ >>>>>>>>> >>>>>>>>> /Staffan >>>>>>>>> >>>>>>>>> On 15 apr 2014, at 07:52, Staffan Larsen >>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 14 apr 2014, at 21:08, Aleksey Shipilev >>>>>>>>>> > wrote: >>>>>>>>>> >>>>>>>>>>> On 04/14/2014 06:55 PM, Staffan Larsen wrote: >>>>>>>>>>>> mach_absolute_time() is essentially a direct call to RDTSC, but with >>>>>>>>>>>> conversion factor to offset for any system sleeps and frequency >>>>>>>>>>>> changes. The call returns something that can be converted to >>>>>>>>>>>> nanoseconds using information from mach_timebase_info(). Calls to >>>>>>>>>>>> mach_absolute_time() do not enter the kernel and are very fast. The >>>>>>>>>>>> resulting time has nanosecond precision and as good accuracy as one >>>>>>>>>>>> can get. >>>>>>>>>>> >>>>>>>>>>> Some numbers would be good on the public list :) I know the numbers >>>>>>>>>>> already, but others on this list don?t. >>>>>>>>>> >>>>>>>>>> I posted the numbers in the bug, but forgot to say so here... >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> Since the value from RDTSC can be subject to drifting between CPUs, >>>>>>>>>>>> we implement safeguards for this to make sure we never return a lower >>>>>>>>>>>> value than the previous values. This adds some overhead to nanoTime() >>>>>>>>>>>> but guards us against possible bugs in the OS. For users who are >>>>>>>>>>>> willing to trust the OS and need the fastest possible calls to >>>>>>>>>>>> System.nanoTime(), we add a flag to disable this safeguard: >>>>>>>>>>>> -XX:+AssumeMonotonicOSTimers. >>>>>>>>>>> >>>>>>>>>>> I now wonder if this safeguard can produce a stream of exactly the same >>>>>>>>>>> timestamps if local clock is lagging behind. But considering the >>>>>>>>>>> alternative of answering the retrograde time, and the observation the >>>>>>>>>>> current Mac OS X mach_absolute_time() *appears* monotonic, having this >>>>>>>>>>> safeguard seems OK. >>>>>>>>>>> >>>>>>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8040140/webrev.00/ >>>>>>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8040140 >>>>>>>>>>> >>>>>>>>>>> This looks good to me. >>>>>>>>>> >>>>>>>>>> Thanks. >>>>>>>>>> >>>>>>>>>>> And, since this question will inevitably pop up, do we plan to bring it >>>>>>>>>>> into 8uX? I think many Mac users will be happy about that. >>>>>>>>>> >>>>>>>>>> I would like to do so, but I would also like to have it sit and bake >>>>>>>>>> for a while in 9 before that. I think the 8u20 train has left the >>>>>>>>>> station, but perhaps 8u40? >>>>>>>>>> >>>>>>>>>> /Staffan >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Thu Apr 24 15:42:51 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Thu, 24 Apr 2014 08:42:51 -0700 (PDT) Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses Message-ID: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> Greetings, ? Kindly asking for reviews for the following very small fix: ? Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 Webrev: http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ ? Description: The Event Based tracing framework assigns a unique traceid to Klass:es for tracking purposes. Normally, a new Klass is assigned it's traceid inside the Klass constructor. For Klass:es coming into the system via the ClassDataSharing (CDS) mechanism, the old traceid for the Klass will be stale, hence a "new" traceid needs to be (re)assigned to the Klass. ? Thank you Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.karlsson at oracle.com Thu Apr 24 16:30:27 2014 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Thu, 24 Apr 2014 18:30:27 +0200 Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses In-Reply-To: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> References: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> Message-ID: <53593C23.3090408@oracle.com> Hi Markus, On 2014-04-24 17:42, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following very small fix: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ > > Klass::restore_unshareable_info() might be called multiple times for a given Klass. This can happen if OutOfMemoryErrors is thrown when the Klass is loaded, and we later retry to load the Klass. Is it OK to call TRACE_INIT_ID(this) multiple times for the same Klass? thanks, StefanK > > Description: > > The Event Based tracing framework assigns a unique traceid to Klass:es > for tracking purposes. > Normally, a new Klass is assigned it's traceid inside the Klass > constructor. > For Klass:es coming into the system via the ClassDataSharing (CDS) > mechanism, the old traceid for the Klass will be stale, hence a "new" > traceid needs to be (re)assigned to the Klass. > > Thank you > > Markus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Thu Apr 24 16:41:48 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Thu, 24 Apr 2014 09:41:48 -0700 (PDT) Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses In-Reply-To: <53593C23.3090408@oracle.com> References: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> <53593C23.3090408@oracle.com> Message-ID: Thanks Stefan, ? Yes, i think it's ok as long as the Klass ?is not able to "do anything" useful ?- i.e. the Klass is not able to execute anything which would involve its traceid. So, I would assume the semantics of Klass::restore_unsharable_info() would be similar in nature to a constructor? It prepares the Klass for use. ? As long as the Klass is coming out "prepared" with a unique ID assigned, this will be fine. ? Thanks Markus ? ? From: Stefan Karlsson Sent: den 24 april 2014 18:30 To: Markus Gr?nlund; serviceability-dev at openjdk.java.net serviceability-dev at openjdk.java.net; hotspot-runtime-dev Subject: Re: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses ? Hi Markus, On 2014-04-24 17:42, Markus Gr?nlund wrote: Greetings, ? Kindly asking for reviews for the following very small fix: ? Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Emgronlun/8041723/webrev01/"http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ Klass::restore_unshareable_info() might be called multiple times for a given Klass. This can happen if OutOfMemoryErrors is thrown when the Klass is loaded, and we later retry to load the Klass. Is it OK to call TRACE_INIT_ID(this) multiple times for the same Klass? thanks, StefanK ? Description: The Event Based tracing framework assigns a unique traceid to Klass:es for tracking purposes. Normally, a new Klass is assigned it's traceid inside the Klass constructor. For Klass:es coming into the system via the ClassDataSharing (CDS) mechanism, the old traceid for the Klass will be stale, hence a "new" traceid needs to be (re)assigned to the Klass. ? Thank you Markus ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleen.phillimore at oracle.com Thu Apr 24 16:55:37 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Thu, 24 Apr 2014 12:55:37 -0400 Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses In-Reply-To: References: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> <53593C23.3090408@oracle.com> Message-ID: <53594209.7000705@oracle.com> On 4/24/14, 12:41 PM, Markus Gr?nlund wrote: > > Thanks Stefan, > > Yes, i think it's ok as long as the Klass is not able to "do > anything" useful -- i.e. the Klass is not able to execute anything > which would involve its traceid. > > So, I would assume the semantics of Klass::restore_unsharable_info() > would be similar in nature to a constructor? It prepares the Klass for > use. > Stefan is right. It's sort of a restartable constructor. We keep the values "restored" so far if you get OOM while restoring the values. You could conditionally if DumpSharedSpaces not initalize this field in the Klass constructor and check if it's zero before calling TRACE_INIT_ID, if TRACE_INIT_ID has side effects you only want once. I was thinking earlier that it stores some sort of scalar to this field and that would be ok to do more than once. > > As long as the Klass is coming out "prepared" with a unique ID > assigned, this will be fine. > So in the rare case of OOM during restore_unshareable_info, you might get an extra unique value if the class is successfully loaded again (which is also rare except in our testing apparently). I think this fix is good. Coleen > Thanks > > Markus > > *From:*Stefan Karlsson > *Sent:* den 24 april 2014 18:30 > *To:* Markus Gr?nlund; serviceability-dev at openjdk.java.net > serviceability-dev at openjdk.java.net; hotspot-runtime-dev > *Subject:* Re: RFR(XXS): Event Based tracing framework trace_id's to > be reassigned for CDS klasses > > Hi Markus, > > On 2014-04-24 17:42, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following very small fix: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ > > > > Klass::restore_unshareable_info() might be called multiple times for a > given Klass. This can happen if OutOfMemoryErrors is thrown when the > Klass is loaded, and we later retry to load the Klass. Is it OK to > call TRACE_INIT_ID(this) multiple times for the same Klass? > > thanks, > StefanK > > Description: > > The Event Based tracing framework assigns a unique traceid to Klass:es > for tracking purposes. > Normally, a new Klass is assigned it's traceid inside the Klass > constructor. > For Klass:es coming into the system via the ClassDataSharing (CDS) > mechanism, the old traceid for the Klass will be stale, hence a "new" > traceid needs to be (re)assigned to the Klass. > > Thank you > > Markus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.gronlund at oracle.com Thu Apr 24 17:06:36 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Thu, 24 Apr 2014 10:06:36 -0700 (PDT) Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses In-Reply-To: <53594209.7000705@oracle.com> References: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> <53593C23.3090408@oracle.com> <53594209.7000705@oracle.com> Message-ID: Thanks Coleen, ? It's just a simple scalar assignment - it's ok to take yet another incremented value if needed. ? /Markus ? From: Coleen Phillimore Sent: den 24 april 2014 18:56 To: hotspot-runtime-dev at openjdk.java.net Subject: Re: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses ? ? On 4/24/14, 12:41 PM, Markus Gr?nlund wrote: Thanks Stefan, ? Yes, i think it's ok as long as the Klass ?is not able to "do anything" useful ?- i.e. the Klass is not able to execute anything which would involve its traceid. So, I would assume the semantics of Klass::restore_unsharable_info() would be similar in nature to a constructor? It prepares the Klass for use. Stefan is right.?? It's sort of a restartable constructor.?? We keep the values "restored" so far if you get OOM while restoring the values.? You could conditionally if DumpSharedSpaces not initalize this field in the Klass constructor and check if it's zero before calling TRACE_INIT_ID, if TRACE_INIT_ID has side effects you only want once.? I was thinking earlier that it stores some sort of scalar to this field and that would be ok to do more than once. ? As long as the Klass is coming out "prepared" with a unique ID assigned, this will be fine. So in the rare case of OOM during restore_unshareable_info, you might get an extra unique value if the class is successfully loaded again (which is also rare except in our testing apparently). I think this fix is good. Coleen ? Thanks Markus ? ? From: Stefan Karlsson Sent: den 24 april 2014 18:30 To: Markus Gr?nlund; HYPERLINK "mailto:serviceability-dev at openjdk.java.net"serviceability-dev at openjdk.java.net HYPERLINK "mailto:serviceability-dev at openjdk.java.net"serviceability-dev at openjdk.java.net; hotspot-runtime-dev Subject: Re: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses ? Hi Markus, On 2014-04-24 17:42, Markus Gr?nlund wrote: Greetings, ? Kindly asking for reviews for the following very small fix: ? Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Emgronlun/8041723/webrev01/"http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ Klass::restore_unshareable_info() might be called multiple times for a given Klass. This can happen if OutOfMemoryErrors is thrown when the Klass is loaded, and we later retry to load the Klass. Is it OK to call TRACE_INIT_ID(this) multiple times for the same Klass? thanks, StefanK ? Description: The Event Based tracing framework assigns a unique traceid to Klass:es for tracking purposes. Normally, a new Klass is assigned it's traceid inside the Klass constructor. For Klass:es coming into the system via the ClassDataSharing (CDS) mechanism, the old traceid for the Klass will be stale, hence a "new" traceid needs to be (re)assigned to the Klass. ? Thank you Markus ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerard.ziemski at oracle.com Thu Apr 24 20:58:16 2014 From: gerard.ziemski at oracle.com (Gerard Ziemski) Date: Thu, 24 Apr 2014 15:58:16 -0500 Subject: RFR JDK-8038654: Separate SymbolTable and StringTable code Message-ID: <53597AE8.2070104@oracle.com> hi all, Please review this simple enhancement, which refactors symbolTable into symbolTable and stringTable No new or removed code. Webrev: http://cr.openjdk.java.net/~gziemski/8038654_rev0 Bug: https://bugs.openjdk.java.net/browse/JDK-8038654 Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. Thank you. From gerard.ziemski at oracle.com Thu Apr 24 20:59:29 2014 From: gerard.ziemski at oracle.com (Gerard Ziemski) Date: Thu, 24 Apr 2014 15:59:29 -0500 Subject: RFR JDK-8039525: HashTable lookup API needs refactoring Message-ID: <53597B31.6000007@oracle.com> hi all, Please review this simple enhancement, which renames symbolTable::lookup API using names that better reflect the method purpose, ie: lookup_only, lookup_and_add, lookup_only_and_hash, lookup_and_add_unicode and lookup_only_and_hash_unicode. No new or removed code. Webrev: http://cr.openjdk.java.net/~gziemski/8039525_rev0 Bug: https://bugs.openjdk.java.net/browse/JDK-8039525 Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. Thank you. From john.r.rose at oracle.com Fri Apr 25 00:23:17 2014 From: john.r.rose at oracle.com (John Rose) Date: Thu, 24 Apr 2014 17:23:17 -0700 Subject: RFR JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <53597B31.6000007@oracle.com> References: <53597B31.6000007@oracle.com> Message-ID: Three comments: 1. Yay! I have a soft spot for this kind of change. 2. You apparently added a blank-carrying line in symbolTable.hpp. jcheck will stop you from committing it. 3. Please get rid of "probe*" while you are at it, or at least pick a name which fits in your new scheme. IIRC it was an incursion from a non-runtime programmer. Reviewed. ? John On Apr 24, 2014, at 1:59 PM, Gerard Ziemski wrote: > hi all, > > Please review this simple enhancement, which renames symbolTable::lookup API using names that better reflect the method purpose, ie: lookup_only, lookup_and_add, lookup_only_and_hash, lookup_and_add_unicode and lookup_only_and_hash_unicode. > > No new or removed code. > > Webrev: http://cr.openjdk.java.net/~gziemski/8039525_rev0 > Bug: https://bugs.openjdk.java.net/browse/JDK-8039525 > > Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. > > Thank you. From john.r.rose at oracle.com Fri Apr 25 00:25:34 2014 From: john.r.rose at oracle.com (John Rose) Date: Thu, 24 Apr 2014 17:25:34 -0700 Subject: RFR JDK-8038654: Separate SymbolTable and StringTable code In-Reply-To: <53597AE8.2070104@oracle.com> References: <53597AE8.2070104@oracle.com> Message-ID: Reviewed. On Apr 24, 2014, at 1:58 PM, Gerard Ziemski wrote: > hi all, > > Please review this simple enhancement, which refactors symbolTable into symbolTable and stringTable > > No new or removed code. > > Webrev: http://cr.openjdk.java.net/~gziemski/8038654_rev0 > Bug: https://bugs.openjdk.java.net/browse/JDK-8038654 > > Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. > > Thank you. From christian.thalinger at oracle.com Fri Apr 25 01:21:27 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Thu, 24 Apr 2014 15:21:27 -1000 Subject: RFR JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <53597B31.6000007@oracle.com> References: <53597B31.6000007@oracle.com> Message-ID: <154C9BBB-F4AA-45AC-B148-7312992950C4@oracle.com> I don?t think we need the suffix _only if we have _and_add. The lookups are then doing what they are supposed to do. On Apr 24, 2014, at 10:59 AM, Gerard Ziemski wrote: > hi all, > > Please review this simple enhancement, which renames symbolTable::lookup API using names that better reflect the method purpose, ie: lookup_only, lookup_and_add, lookup_only_and_hash, lookup_and_add_unicode and lookup_only_and_hash_unicode. > > No new or removed code. > > Webrev: http://cr.openjdk.java.net/~gziemski/8039525_rev0 > Bug: https://bugs.openjdk.java.net/browse/JDK-8039525 > > Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. > > Thank you. From christian.thalinger at oracle.com Fri Apr 25 01:29:26 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Thu, 24 Apr 2014 15:29:26 -1000 Subject: RFR JDK-8038654: Separate SymbolTable and StringTable code In-Reply-To: <53597AE8.2070104@oracle.com> References: <53597AE8.2070104@oracle.com> Message-ID: Thanks for doing this. At some point I had these changes myself but the surrounding changes got dropped so this got lost too. On Apr 24, 2014, at 10:58 AM, Gerard Ziemski wrote: > hi all, > > Please review this simple enhancement, which refactors symbolTable into symbolTable and stringTable > > No new or removed code. > > Webrev: http://cr.openjdk.java.net/~gziemski/8038654_rev0 > Bug: https://bugs.openjdk.java.net/browse/JDK-8038654 > > Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. > > Thank you. From john.r.rose at oracle.com Fri Apr 25 01:54:06 2014 From: john.r.rose at oracle.com (John Rose) Date: Thu, 24 Apr 2014 18:54:06 -0700 Subject: RFR JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <154C9BBB-F4AA-45AC-B148-7312992950C4@oracle.com> References: <53597B31.6000007@oracle.com> <154C9BBB-F4AA-45AC-B148-7312992950C4@oracle.com> Message-ID: <74E3BD6C-71B3-43ED-BB1A-1A2FAD6EA187@oracle.com> On Apr 24, 2014, at 6:21 PM, Christian Thalinger wrote: > I don?t think we need the suffix _only if we have _and_add. The lookups are then doing what they are supposed to do. +1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.karlsson at oracle.com Fri Apr 25 07:27:53 2014 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Fri, 25 Apr 2014 09:27:53 +0200 Subject: RFR JDK-8038654: Separate SymbolTable and StringTable code In-Reply-To: <53597AE8.2070104@oracle.com> References: <53597AE8.2070104@oracle.com> Message-ID: <535A0E79.6090607@oracle.com> Hi Gerard, On 2014-04-24 22:58, Gerard Ziemski wrote: > hi all, > > Please review this simple enhancement, which refactors symbolTable > into symbolTable and stringTable > > No new or removed code. > > Webrev: http://cr.openjdk.java.net/~gziemski/8038654_rev0 > Bug: https://bugs.openjdk.java.net/browse/JDK-8038654 Great to see these two getting separated! I have some comments about the include directives: 1) Could you make sure that your include statements are sorted? 2) There's a lot of places where you add #include "classfile/stringTable.hpp" and keep #include "classfile/symbolTable.hpp", when the SymbolTable isn't used from that file. Could you try to clean that up so that we only include the file we need? 3) I don't think stringTable.cpp should be including symbolTable.hpp. 4) stringTable.hpp could forward declare Symbol instead of including symbol.hpp. 5) Not really related to your change, but at some point we should get rid of the include of the inline.hpp file in symbolTable.hpp/stringTable.hpp. thanks, StefanK > > Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on > Mac OS X and Linux. > > Thank you. From erik.helin at oracle.com Fri Apr 25 07:52:33 2014 From: erik.helin at oracle.com (Erik Helin) Date: Fri, 25 Apr 2014 09:52:33 +0200 Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses In-Reply-To: References: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> <53593C23.3090408@oracle.com> <53594209.7000705@oracle.com> Message-ID: <535A1441.3020304@oracle.com> Hi Markus, this looks good. Thanks, Erik On 2014-04-24 19:06, Markus Gr?nlund wrote: > Thanks Coleen, > > It?s just a simple scalar assignment ? it?s ok to take yet another > incremented value if needed. > > /Markus > > *From:*Coleen Phillimore > *Sent:* den 24 april 2014 18:56 > *To:* hotspot-runtime-dev at openjdk.java.net > *Subject:* Re: RFR(XXS): Event Based tracing framework trace_id's to be > reassigned for CDS klasses > > On 4/24/14, 12:41 PM, Markus Gr?nlund wrote: > > Thanks Stefan, > > Yes, i think it?s ok as long as the Klass is not able to ?do > anything? useful ? i.e. the Klass is not able to execute anything > which would involve its traceid. > > So, I would assume the semantics of Klass::restore_unsharable_info() > would be similar in nature to a constructor? It prepares the Klass > for use. > > Stefan is right. It's sort of a restartable constructor. We keep the > values "restored" so far if you get OOM while restoring the values. You > could conditionally if DumpSharedSpaces not initalize this field in the > Klass constructor and check if it's zero before calling TRACE_INIT_ID, > if TRACE_INIT_ID has side effects you only want once. I was thinking > earlier that it stores some sort of scalar to this field and that would > be ok to do more than once. > > As long as the Klass is coming out ?prepared? with a unique ID assigned, > this will be fine. > > > So in the rare case of OOM during restore_unshareable_info, you might > get an extra unique value if the class is successfully loaded again > (which is also rare except in our testing apparently). > > I think this fix is good. > > Coleen > > > Thanks > > Markus > > *From:*Stefan Karlsson > *Sent:* den 24 april 2014 18:30 > *To:* Markus Gr?nlund; serviceability-dev at openjdk.java.net > > serviceability-dev at openjdk.java.net > ; hotspot-runtime-dev > *Subject:* Re: RFR(XXS): Event Based tracing framework trace_id's to be > reassigned for CDS klasses > > Hi Markus, > > On 2014-04-24 17:42, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following very small fix: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ > > > > Klass::restore_unshareable_info() might be called multiple times for a > given Klass. This can happen if OutOfMemoryErrors is thrown when the > Klass is loaded, and we later retry to load the Klass. Is it OK to call > TRACE_INIT_ID(this) multiple times for the same Klass? > > thanks, > StefanK > > > Description: > > The Event Based tracing framework assigns a unique traceid to Klass:es > for tracking purposes. > Normally, a new Klass is assigned it?s traceid inside the Klass > constructor. > For Klass:es coming into the system via the ClassDataSharing (CDS) > mechanism, the old traceid for the Klass will be stale, hence a "new" > traceid needs to be (re)assigned to the Klass. > > Thank you > > Markus > From markus.gronlund at oracle.com Fri Apr 25 08:04:08 2014 From: markus.gronlund at oracle.com (=?iso-8859-1?B?TWFya3VzIEdy9m5sdW5k?=) Date: Fri, 25 Apr 2014 01:04:08 -0700 (PDT) Subject: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses In-Reply-To: <535A1441.3020304@oracle.com> References: <4739f2b4-e670-47d1-8210-1ac799e5b649@default> <53593C23.3090408@oracle.com> <53594209.7000705@oracle.com> <535A1441.3020304@oracle.com> Message-ID: <1fb57186-1aca-4417-922f-1683b1c9c50e@default> Thanks Erik, Coleen and Stefan. /Markus -----Original Message----- From: Erik Helin Sent: den 25 april 2014 09:53 To: Markus Gr?nlund; Coleen Phillimore Cc: hotspot-runtime-dev at openjdk.java.net; serviceability-dev at openjdk.java.net serviceability-dev at openjdk.java.net Subject: Re: RFR(XXS): Event Based tracing framework trace_id's to be reassigned for CDS klasses Hi Markus, this looks good. Thanks, Erik On 2014-04-24 19:06, Markus Gr?nlund wrote: > Thanks Coleen, > > It's just a simple scalar assignment - it's ok to take yet another > incremented value if needed. > > /Markus > > *From:*Coleen Phillimore > *Sent:* den 24 april 2014 18:56 > *To:* hotspot-runtime-dev at openjdk.java.net > *Subject:* Re: RFR(XXS): Event Based tracing framework trace_id's to > be reassigned for CDS klasses > > On 4/24/14, 12:41 PM, Markus Gr?nlund wrote: > > Thanks Stefan, > > Yes, i think it's ok as long as the Klass is not able to "do > anything" useful - i.e. the Klass is not able to execute anything > which would involve its traceid. > > So, I would assume the semantics of Klass::restore_unsharable_info() > would be similar in nature to a constructor? It prepares the Klass > for use. > > Stefan is right. It's sort of a restartable constructor. We keep the > values "restored" so far if you get OOM while restoring the values. > You could conditionally if DumpSharedSpaces not initalize this field > in the Klass constructor and check if it's zero before calling > TRACE_INIT_ID, if TRACE_INIT_ID has side effects you only want once. > I was thinking earlier that it stores some sort of scalar to this > field and that would be ok to do more than once. > > As long as the Klass is coming out "prepared" with a unique ID > assigned, this will be fine. > > > So in the rare case of OOM during restore_unshareable_info, you might > get an extra unique value if the class is successfully loaded again > (which is also rare except in our testing apparently). > > I think this fix is good. > > Coleen > > > Thanks > > Markus > > *From:*Stefan Karlsson > *Sent:* den 24 april 2014 18:30 > *To:* Markus Gr?nlund; serviceability-dev at openjdk.java.net > > serviceability-dev at openjdk.java.net > ; hotspot-runtime-dev > *Subject:* Re: RFR(XXS): Event Based tracing framework trace_id's to > be reassigned for CDS klasses > > Hi Markus, > > On 2014-04-24 17:42, Markus Gr?nlund wrote: > > Greetings, > > Kindly asking for reviews for the following very small fix: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8041723 > > Webrev: http://cr.openjdk.java.net/~mgronlun/8041723/webrev01/ > > > > Klass::restore_unshareable_info() might be called multiple times for a > given Klass. This can happen if OutOfMemoryErrors is thrown when the > Klass is loaded, and we later retry to load the Klass. Is it OK to > call > TRACE_INIT_ID(this) multiple times for the same Klass? > > thanks, > StefanK > > > Description: > > The Event Based tracing framework assigns a unique traceid to Klass:es > for tracking purposes. > Normally, a new Klass is assigned it's traceid inside the Klass > constructor. > For Klass:es coming into the system via the ClassDataSharing (CDS) > mechanism, the old traceid for the Klass will be stale, hence a "new" > traceid needs to be (re)assigned to the Klass. > > Thank you > > Markus > From per.liden at oracle.com Fri Apr 25 11:26:54 2014 From: per.liden at oracle.com (Per Liden) Date: Fri, 25 Apr 2014 13:26:54 +0200 Subject: RFR JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <154C9BBB-F4AA-45AC-B148-7312992950C4@oracle.com> References: <53597B31.6000007@oracle.com> <154C9BBB-F4AA-45AC-B148-7312992950C4@oracle.com> Message-ID: <535A467E.4040504@oracle.com> On 2014-04-25 03:21, Christian Thalinger wrote: > I don?t think we need the suffix _only if we have _and_add. The lookups are then doing what they are supposed to do. Also, lookup_and_add() should probably be lookup_or_add(). /Per From staffan.larsen at oracle.com Fri Apr 25 12:56:20 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 25 Apr 2014 14:56:20 +0200 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> Message-ID: <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> Still looking for a Review of this change. Thanks, /Staffan On 7 apr 2014, at 21:19, Staffan Larsen wrote: > And the links: > > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ > > Sorry about that, > /Staffan > > On 7 apr 2014, at 20:08, Staffan Larsen wrote: > >> >> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >> >> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >> >> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >> >> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >> >> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >> >> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >> >> Thanks, >> /Staffan > From kmcguigan at twitter.com Fri Apr 25 15:02:04 2014 From: kmcguigan at twitter.com (Keith McGuigan) Date: Fri, 25 Apr 2014 11:02:04 -0400 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> Message-ID: Hi Staffan - It looks good to me. Why is the bug marked "closed" though? On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: > Still looking for a Review of this change. > > Thanks, > /Staffan > > On 7 apr 2014, at 21:19, Staffan Larsen wrote: > > > And the links: > > > > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 > > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ > > > > Sorry about that, > > /Staffan > > > > On 7 apr 2014, at 20:08, Staffan Larsen > wrote: > > > >> > >> The problem here is that the code for finding local VMs is not looking > for the data in the correct place. > >> > >> When a JVM is started it will create the perf-data file in a > user-specific directory inside /tmp (*). The code in the JDK > (PerfDataFile.java) that lists all active JVMs looks for the user-specific > directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the > command line, the code in PerfDataFile will look in the wrong place. > >> > >> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. > On OS X and Windows, there are user-specific temp directories that should > be used, and so the VM queries the OS for these paths. > >> > >> The solution would be for PerfDataFile to use the same locations as the > VM creates them in. The simplest way to guarantee that the same directory > is used is to ask the VM to provide the location. Thus I have introduced a > new JVM_ function: JVM_GetTemporaryDirectory. > >> > >> (Since this change touches both hotspot and jdk repos I will submit the > hotspot part first under a different bug id (provided that the review goes > well)). > >> > >> The newly added test starts two VM with all possible combinations of > setting and not setting java.io.tmpdir to verify that the mechanism is > indeed not looking at that variable. I also removed an if-statement in > BasicTests.java which would have found this issue a long time ago had it > not been there. > >> > >> Thanks, > >> /Staffan > > > > -- [image: twitter-icon-large.png] Keith McGuigan @kamggg kmcguigan at twitter.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Fri Apr 25 15:16:50 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 25 Apr 2014 17:16:50 +0200 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> Message-ID: <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> Thanks Keith! As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. /Staffan On 25 apr 2014, at 17:02, Keith McGuigan wrote: > Hi Staffan - > > It looks good to me. Why is the bug marked "closed" though? > > > On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: > Still looking for a Review of this change. > > Thanks, > /Staffan > > On 7 apr 2014, at 21:19, Staffan Larsen wrote: > > > And the links: > > > > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 > > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ > > > > Sorry about that, > > /Staffan > > > > On 7 apr 2014, at 20:08, Staffan Larsen wrote: > > > >> > >> The problem here is that the code for finding local VMs is not looking for the data in the correct place. > >> > >> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. > >> > >> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. > >> > >> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. > >> > >> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). > >> > >> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. > >> > >> Thanks, > >> /Staffan > > > > > > > -- > > Keith McGuigan > @kamggg > kmcguigan at twitter.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.daugherty at oracle.com Fri Apr 25 15:23:51 2014 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Fri, 25 Apr 2014 09:23:51 -0600 Subject: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> Message-ID: <535A7E07.1090206@oracle.com> Looks like when the bug was filed Oracle internal information like hostnames were included in the description section. You can edit it out, but that doesn't remove it from the history so the entire bug has to be marked confidential... We've updated our internal wikis to let folks know that they should put non-Oracle-internal info in the description and then add a separate note for the configuration info with the access level set to "screening required" or "confidential". Getting everyone on the same page is slow process... Dan On 4/25/14 9:16 AM, Staffan Larsen wrote: > Thanks Keith! > > As far as I can tell there was no good reason for making the bug > Confidential, but I can?t undo it. Sorry about that. > > /Staffan > > On 25 apr 2014, at 17:02, Keith McGuigan > wrote: > >> Hi Staffan - >> >> It looks good to me. Why is the bug marked "closed" though? >> >> >> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen >> > wrote: >> >> Still looking for a Review of this change. >> >> Thanks, >> /Staffan >> >> On 7 apr 2014, at 21:19, Staffan Larsen >> > wrote: >> >> > And the links: >> > >> > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >> > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >> >> > >> > Sorry about that, >> > /Staffan >> > >> > On 7 apr 2014, at 20:08, Staffan Larsen >> > wrote: >> > >> >> >> >> The problem here is that the code for finding local VMs is not >> looking for the data in the correct place. >> >> >> >> When a JVM is started it will create the perf-data file in a >> user-specific directory inside /tmp (*). The code in the JDK >> (PerfDataFile.java) that lists all active JVMs looks for the >> user-specific directory inside java.io.tmpdir. If a user sets >> -Djava.io.tmpdir on the command line, the code in PerfDataFile >> will look in the wrong place. >> >> >> >> (*) It's a little bit more complex. /tmp is used on Linux and >> Solaris. On OS X and Windows, there are user-specific temp >> directories that should be used, and so the VM queries the OS for >> these paths. >> >> >> >> The solution would be for PerfDataFile to use the same >> locations as the VM creates them in. The simplest way to >> guarantee that the same directory is used is to ask the VM to >> provide the location. Thus I have introduced a new JVM_ function: >> JVM_GetTemporaryDirectory. >> >> >> >> (Since this change touches both hotspot and jdk repos I will >> submit the hotspot part first under a different bug id (provided >> that the review goes well)). >> >> >> >> The newly added test starts two VM with all possible >> combinations of setting and not setting java.io.tmpdir to verify >> that the mechanism is indeed not looking at that variable. I also >> removed an if-statement in BasicTests.java which would have found >> this issue a long time ago had it not been there. >> >> >> >> Thanks, >> >> /Staffan >> > >> >> >> >> >> -- >> twitter-icon-large.png >> >> Keith McGuigan >> @kamggg >> kmcguigan at twitter.com >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Fri Apr 25 16:24:41 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 25 Apr 2014 18:24:41 +0200 Subject: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> Message-ID: <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> It looks like a completely messed this up by not pushing the hotspot parts first and now I have broken the build in jdk9-dev. Should I push an anti-delta of the patch? I can prepare a review of it in a moment. /Staffan On 25 apr 2014, at 17:16, Staffan Larsen wrote: > Thanks Keith! > > As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. > > /Staffan > > On 25 apr 2014, at 17:02, Keith McGuigan wrote: > >> Hi Staffan - >> >> It looks good to me. Why is the bug marked "closed" though? >> >> >> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: >> Still looking for a Review of this change. >> >> Thanks, >> /Staffan >> >> On 7 apr 2014, at 21:19, Staffan Larsen wrote: >> >> > And the links: >> > >> > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >> > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >> > >> > Sorry about that, >> > /Staffan >> > >> > On 7 apr 2014, at 20:08, Staffan Larsen wrote: >> > >> >> >> >> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >> >> >> >> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >> >> >> >> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >> >> >> >> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >> >> >> >> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >> >> >> >> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >> >> >> >> Thanks, >> >> /Staffan >> > >> >> >> >> >> -- >> >> Keith McGuigan >> @kamggg >> kmcguigan at twitter.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Fri Apr 25 16:36:34 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 25 Apr 2014 18:36:34 +0200 Subject: Urgent: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> Message-ID: <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> Here is an anti-delta for the broken push. I prepared it using ?hg backout?. webrev: http://cr.openjdk.java.net/~sla/8041948/webrev.00/ bug: https://bugs.openjdk.java.net/browse/JDK-8041948 If I can get this reviewed quickly I can push the fix soon (and I will spend the weekend in shame). Thanks, /Staffan On 25 apr 2014, at 18:24, Staffan Larsen wrote: > It looks like a completely messed this up by not pushing the hotspot parts first and now I have broken the build in jdk9-dev. > > Should I push an anti-delta of the patch? I can prepare a review of it in a moment. > > /Staffan > > On 25 apr 2014, at 17:16, Staffan Larsen wrote: > >> Thanks Keith! >> >> As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. >> >> /Staffan >> >> On 25 apr 2014, at 17:02, Keith McGuigan wrote: >> >>> Hi Staffan - >>> >>> It looks good to me. Why is the bug marked "closed" though? >>> >>> >>> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: >>> Still looking for a Review of this change. >>> >>> Thanks, >>> /Staffan >>> >>> On 7 apr 2014, at 21:19, Staffan Larsen wrote: >>> >>> > And the links: >>> > >>> > bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >>> > webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >>> > >>> > Sorry about that, >>> > /Staffan >>> > >>> > On 7 apr 2014, at 20:08, Staffan Larsen wrote: >>> > >>> >> >>> >> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >>> >> >>> >> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >>> >> >>> >> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >>> >> >>> >> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >>> >> >>> >> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >>> >> >>> >> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >>> >> >>> >> Thanks, >>> >> /Staffan >>> > >>> >>> >>> >>> >>> -- >>> >>> Keith McGuigan >>> @kamggg >>> kmcguigan at twitter.com >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.darcy at oracle.com Fri Apr 25 16:43:13 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 25 Apr 2014 09:43:13 -0700 Subject: Urgent: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> Message-ID: <535A90A1.2050609@oracle.com> Approved! -Joe On 04/25/2014 09:36 AM, Staffan Larsen wrote: > Here is an anti-delta for the broken push. I prepared it using ?hg backout?. > > webrev: http://cr.openjdk.java.net/~sla/8041948/webrev.00/ > bug: https://bugs.openjdk.java.net/browse/JDK-8041948 > > If I can get this reviewed quickly I can push the fix soon (and I will spend the weekend in shame). > > Thanks, > /Staffan > > > On 25 apr 2014, at 18:24, Staffan Larsen wrote: > >> It looks like a completely messed this up by not pushing the hotspot parts first and now I have broken the build in jdk9-dev. >> >> Should I push an anti-delta of the patch? I can prepare a review of it in a moment. >> >> /Staffan >> >> On 25 apr 2014, at 17:16, Staffan Larsen wrote: >> >>> Thanks Keith! >>> >>> As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. >>> >>> /Staffan >>> >>> On 25 apr 2014, at 17:02, Keith McGuigan wrote: >>> >>>> Hi Staffan - >>>> >>>> It looks good to me. Why is the bug marked "closed" though? >>>> >>>> >>>> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: >>>> Still looking for a Review of this change. >>>> >>>> Thanks, >>>> /Staffan >>>> >>>> On 7 apr 2014, at 21:19, Staffan Larsen wrote: >>>> >>>>> And the links: >>>>> >>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >>>>> webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >>>>> >>>>> Sorry about that, >>>>> /Staffan >>>>> >>>>> On 7 apr 2014, at 20:08, Staffan Larsen wrote: >>>>> >>>>>> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >>>>>> >>>>>> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >>>>>> >>>>>> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >>>>>> >>>>>> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >>>>>> >>>>>> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >>>>>> >>>>>> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >>>>>> >>>>>> Thanks, >>>>>> /Staffan >>>> >>>> >>>> >>>> -- >>>> >>>> Keith McGuigan >>>> @kamggg >>>> kmcguigan at twitter.com From Alan.Bateman at oracle.com Fri Apr 25 16:44:10 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 25 Apr 2014 17:44:10 +0100 Subject: Urgent: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> Message-ID: <535A90DA.6060903@oracle.com> On 25/04/2014 17:36, Staffan Larsen wrote: > Here is an anti-delta for the broken push. I prepared it using ?hg > backout?. > > webrev: http://cr.openjdk.java.net/~sla/8041948/webrev.00/ > > bug: https://bugs.openjdk.java.net/browse/JDK-8041948 > > If I can get this reviewed quickly I can push the fix soon (and I will > spend the weekend in shame). > I just ran into the build issue a few minutes ago. From a quick scan of the patch then it looks to be anti-delta so I think it's good. -Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Fri Apr 25 16:46:39 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 25 Apr 2014 18:46:39 +0200 Subject: Urgent: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <535A90A1.2050609@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> <535A90A1.2050609@oracle.com> Message-ID: <084B0307-0050-4C9B-B3D4-6D9BAA5899AC@oracle.com> Thanks Joe - fix has been pushed. (I will now retreat to a dark place and grumble over the impossibility of pushing coordinated changes). /Staffan On 25 apr 2014, at 18:43, Joe Darcy wrote: > Approved! > > -Joe > > On 04/25/2014 09:36 AM, Staffan Larsen wrote: >> Here is an anti-delta for the broken push. I prepared it using ?hg backout?. >> >> webrev: http://cr.openjdk.java.net/~sla/8041948/webrev.00/ >> bug: https://bugs.openjdk.java.net/browse/JDK-8041948 >> >> If I can get this reviewed quickly I can push the fix soon (and I will spend the weekend in shame). >> >> Thanks, >> /Staffan >> >> >> On 25 apr 2014, at 18:24, Staffan Larsen wrote: >> >>> It looks like a completely messed this up by not pushing the hotspot parts first and now I have broken the build in jdk9-dev. >>> >>> Should I push an anti-delta of the patch? I can prepare a review of it in a moment. >>> >>> /Staffan >>> >>> On 25 apr 2014, at 17:16, Staffan Larsen wrote: >>> >>>> Thanks Keith! >>>> >>>> As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. >>>> >>>> /Staffan >>>> >>>> On 25 apr 2014, at 17:02, Keith McGuigan wrote: >>>> >>>>> Hi Staffan - >>>>> >>>>> It looks good to me. Why is the bug marked "closed" though? >>>>> >>>>> >>>>> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: >>>>> Still looking for a Review of this change. >>>>> >>>>> Thanks, >>>>> /Staffan >>>>> >>>>> On 7 apr 2014, at 21:19, Staffan Larsen wrote: >>>>> >>>>>> And the links: >>>>>> >>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >>>>>> webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >>>>>> >>>>>> Sorry about that, >>>>>> /Staffan >>>>>> >>>>>> On 7 apr 2014, at 20:08, Staffan Larsen wrote: >>>>>> >>>>>>> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >>>>>>> >>>>>>> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >>>>>>> >>>>>>> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >>>>>>> >>>>>>> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >>>>>>> >>>>>>> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >>>>>>> >>>>>>> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >>>>>>> >>>>>>> Thanks, >>>>>>> /Staffan >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Keith McGuigan >>>>> @kamggg >>>>> kmcguigan at twitter.com > From alejandro.murillo at oracle.com Fri Apr 25 17:04:48 2014 From: alejandro.murillo at oracle.com (Alejandro E Murillo) Date: Fri, 25 Apr 2014 11:04:48 -0600 Subject: Urgent: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <084B0307-0050-4C9B-B3D4-6D9BAA5899AC@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> <535A90A1.2050609@oracle.com> <084B0307-0050-4C9B-B3D4-6D9BAA5899AC@oracle.com> Message-ID: <535A95B0.3020007@oracle.com> what's wrong with pushing them to jdk9/hs-rt? We did this a couple of weeks ago with Erik (Gahlin) changes, it might disrupt nightly, as we still do not have the JPRT changes in place, but that was the agreement we have for jdk9: tightly coupled changes should be pushed through the hotspot repos. had that been pushed this week there, it would be in jdk9/dev next Tuesday Alejandro On 4/25/2014 10:46 AM, Staffan Larsen wrote: > Thanks Joe - fix has been pushed. > > (I will now retreat to a dark place and grumble over the impossibility of pushing coordinated changes). > > /Staffan > > On 25 apr 2014, at 18:43, Joe Darcy wrote: > >> Approved! >> >> -Joe >> >> On 04/25/2014 09:36 AM, Staffan Larsen wrote: >>> Here is an anti-delta for the broken push. I prepared it using ?hg backout?. >>> >>> webrev: http://cr.openjdk.java.net/~sla/8041948/webrev.00/ >>> bug: https://bugs.openjdk.java.net/browse/JDK-8041948 >>> >>> If I can get this reviewed quickly I can push the fix soon (and I will spend the weekend in shame). >>> >>> Thanks, >>> /Staffan >>> >>> >>> On 25 apr 2014, at 18:24, Staffan Larsen wrote: >>> >>>> It looks like a completely messed this up by not pushing the hotspot parts first and now I have broken the build in jdk9-dev. >>>> >>>> Should I push an anti-delta of the patch? I can prepare a review of it in a moment. >>>> >>>> /Staffan >>>> >>>> On 25 apr 2014, at 17:16, Staffan Larsen wrote: >>>> >>>>> Thanks Keith! >>>>> >>>>> As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. >>>>> >>>>> /Staffan >>>>> >>>>> On 25 apr 2014, at 17:02, Keith McGuigan wrote: >>>>> >>>>>> Hi Staffan - >>>>>> >>>>>> It looks good to me. Why is the bug marked "closed" though? >>>>>> >>>>>> >>>>>> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: >>>>>> Still looking for a Review of this change. >>>>>> >>>>>> Thanks, >>>>>> /Staffan >>>>>> >>>>>> On 7 apr 2014, at 21:19, Staffan Larsen wrote: >>>>>> >>>>>>> And the links: >>>>>>> >>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >>>>>>> webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >>>>>>> >>>>>>> Sorry about that, >>>>>>> /Staffan >>>>>>> >>>>>>> On 7 apr 2014, at 20:08, Staffan Larsen wrote: >>>>>>> >>>>>>>> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >>>>>>>> >>>>>>>> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >>>>>>>> >>>>>>>> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >>>>>>>> >>>>>>>> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >>>>>>>> >>>>>>>> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >>>>>>>> >>>>>>>> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> /Staffan >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Keith McGuigan >>>>>> @kamggg >>>>>> kmcguigan at twitter.com -- Alejandro From staffan.larsen at oracle.com Fri Apr 25 17:15:13 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 25 Apr 2014 19:15:13 +0200 Subject: Urgent: Broken build. Re: RFR: 8033104 sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms In-Reply-To: <535A95B0.3020007@oracle.com> References: <52A644A0-6EF1-44F2-BAAF-11F035EF585A@oracle.com> <3D74F5CF-1294-45E7-AAB2-761D0E485625@oracle.com> <6D91D5E8-F2BC-4F7C-AE01-C1FFE21798DD@oracle.com> <006E6009-48A5-4CC7-BF2A-23B5F1604327@oracle.com> <736C2B89-E262-40E3-A106-D3804765836E@oracle.com> <02ADC4B7-1A4B-4B60-A75D-415E00FBFD08@oracle.com> <535A90A1.2050609@oracle.com> <084B0307-0050-4C9B-B3D4-6D9BAA5899AC@oracle.com> <535A95B0.3020007@oracle.com> Message-ID: <837FBCA9-1047-4689-952C-CA28B3AADAEF@oracle.com> In this case I think it would have worked ok since the dependency was from jdk -> hotspot. If the dependency was the other way (or both ways), then such a push would break nightly testing in hotspot since that testing picks up the latest promoted JDK (instead of the JDK that is in the same forest). This is broken, IMO, and there is work in progress on fixing it. /Staffan On 25 apr 2014, at 19:04, Alejandro E Murillo wrote: > > what's wrong with pushing them to jdk9/hs-rt? > We did this a couple of weeks ago with Erik (Gahlin) changes, > it might disrupt nightly, as we still do not have the JPRT changes in place, > but that was the agreement we have for jdk9: > tightly coupled changes should be pushed through the hotspot repos. > had that been pushed this week there, it would be in jdk9/dev next Tuesday > > > Alejandro > > On 4/25/2014 10:46 AM, Staffan Larsen wrote: >> Thanks Joe - fix has been pushed. >> >> (I will now retreat to a dark place and grumble over the impossibility of pushing coordinated changes). >> >> /Staffan >> >> On 25 apr 2014, at 18:43, Joe Darcy wrote: >> >>> Approved! >>> >>> -Joe >>> >>> On 04/25/2014 09:36 AM, Staffan Larsen wrote: >>>> Here is an anti-delta for the broken push. I prepared it using ?hg backout?. >>>> >>>> webrev: http://cr.openjdk.java.net/~sla/8041948/webrev.00/ >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8041948 >>>> >>>> If I can get this reviewed quickly I can push the fix soon (and I will spend the weekend in shame). >>>> >>>> Thanks, >>>> /Staffan >>>> >>>> >>>> On 25 apr 2014, at 18:24, Staffan Larsen wrote: >>>> >>>>> It looks like a completely messed this up by not pushing the hotspot parts first and now I have broken the build in jdk9-dev. >>>>> >>>>> Should I push an anti-delta of the patch? I can prepare a review of it in a moment. >>>>> >>>>> /Staffan >>>>> >>>>> On 25 apr 2014, at 17:16, Staffan Larsen wrote: >>>>> >>>>>> Thanks Keith! >>>>>> >>>>>> As far as I can tell there was no good reason for making the bug Confidential, but I can?t undo it. Sorry about that. >>>>>> >>>>>> /Staffan >>>>>> >>>>>> On 25 apr 2014, at 17:02, Keith McGuigan wrote: >>>>>> >>>>>>> Hi Staffan - >>>>>>> >>>>>>> It looks good to me. Why is the bug marked "closed" though? >>>>>>> >>>>>>> >>>>>>> On Fri, Apr 25, 2014 at 8:56 AM, Staffan Larsen wrote: >>>>>>> Still looking for a Review of this change. >>>>>>> >>>>>>> Thanks, >>>>>>> /Staffan >>>>>>> >>>>>>> On 7 apr 2014, at 21:19, Staffan Larsen wrote: >>>>>>> >>>>>>>> And the links: >>>>>>>> >>>>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8033104 >>>>>>>> webrev: http://cr.openjdk.java.net/~sla/8033104/webrev.00/ >>>>>>>> >>>>>>>> Sorry about that, >>>>>>>> /Staffan >>>>>>>> >>>>>>>> On 7 apr 2014, at 20:08, Staffan Larsen wrote: >>>>>>>> >>>>>>>>> The problem here is that the code for finding local VMs is not looking for the data in the correct place. >>>>>>>>> >>>>>>>>> When a JVM is started it will create the perf-data file in a user-specific directory inside /tmp (*). The code in the JDK (PerfDataFile.java) that lists all active JVMs looks for the user-specific directory inside java.io.tmpdir. If a user sets -Djava.io.tmpdir on the command line, the code in PerfDataFile will look in the wrong place. >>>>>>>>> >>>>>>>>> (*) It's a little bit more complex. /tmp is used on Linux and Solaris. On OS X and Windows, there are user-specific temp directories that should be used, and so the VM queries the OS for these paths. >>>>>>>>> >>>>>>>>> The solution would be for PerfDataFile to use the same locations as the VM creates them in. The simplest way to guarantee that the same directory is used is to ask the VM to provide the location. Thus I have introduced a new JVM_ function: JVM_GetTemporaryDirectory. >>>>>>>>> >>>>>>>>> (Since this change touches both hotspot and jdk repos I will submit the hotspot part first under a different bug id (provided that the review goes well)). >>>>>>>>> >>>>>>>>> The newly added test starts two VM with all possible combinations of setting and not setting java.io.tmpdir to verify that the mechanism is indeed not looking at that variable. I also removed an if-statement in BasicTests.java which would have found this issue a long time ago had it not been there. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> /Staffan >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> Keith McGuigan >>>>>>> @kamggg >>>>>>> kmcguigan at twitter.com > > -- > Alejandro > From coleen.phillimore at oracle.com Mon Apr 28 21:07:40 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Mon, 28 Apr 2014 17:07:40 -0400 Subject: RFR (S) 8023697: failed class resolution reports different class name in detail message for the ,first and subsequent times Message-ID: <535EC31C.40503@oracle.com> Summary: Cache detail message when we cache exception for constant pool resolution. In the resolution error table. Provide a default message if one is not in the original exception. Also, consolidate duplicate code for MethodHandleInError and MethodTypeInError with UnresolvedClassInError. open webrev at http://cr.openjdk.java.net/~coleenp/8023697/ bug link https://bugs.openjdk.java.net/browse/JDK-8023697 Ran jck8, ute vm.quick.testlist, jtreg tests in hotspot/test, java/lang/invoke jdk jtreg tests. Thanks, Coleen From karen.kinnear at oracle.com Mon Apr 28 22:11:26 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Mon, 28 Apr 2014 18:11:26 -0400 Subject: RFR (S) 8023697: failed class resolution reports different class name in detail message for the , first and subsequent times In-Reply-To: <535EC31C.40503@oracle.com> References: <535EC31C.40503@oracle.com> Message-ID: <68F0F5FF-4804-47DB-A5BE-E95726109CCC@oracle.com> Coleen, A couple of comments/questions: 1. Can you possibly measure footprint in a large application to see if the saved error messages use significant footprint? 2. I'm concerned about setting expectations that the detailed message will be repeated precisely for constant pool resolution - but for now that is only for Class, MethodHandle and MethodType resolution 3. A comment in the bug report says that for linkage errors in SD the detail message is the name of the class, in all cases but this one, the message is the same - I'm confused - did you test this with for instance a LoaderConstraint test - doesn't that have a different detail message? I appreciate consolidating the duplicate code. thanks, Karen On Apr 28, 2014, at 5:07 PM, Coleen Phillimore wrote: > Summary: Cache detail message when we cache exception for constant pool resolution. > > In the resolution error table. Provide a default message if one is not in the original exception. Also, consolidate duplicate code for MethodHandleInError and MethodTypeInError with UnresolvedClassInError. > > open webrev at http://cr.openjdk.java.net/~coleenp/8023697/ > bug link https://bugs.openjdk.java.net/browse/JDK-8023697 > > Ran jck8, ute vm.quick.testlist, jtreg tests in hotspot/test, java/lang/invoke jdk jtreg tests. > > Thanks, > Coleen From christian.thalinger at oracle.com Tue Apr 29 00:39:27 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Mon, 28 Apr 2014 14:39:27 -1000 Subject: RFR (S) 8023697: failed class resolution reports different class name in detail message for the , first and subsequent times In-Reply-To: <535EC31C.40503@oracle.com> References: <535EC31C.40503@oracle.com> Message-ID: <95B8B424-2852-4F10-B766-9749914AAC0C@oracle.com> Looks good to me but I?m not very familiar with that part of the code. On Apr 28, 2014, at 11:07 AM, Coleen Phillimore wrote: > Summary: Cache detail message when we cache exception for constant pool resolution. > > In the resolution error table. Provide a default message if one is not in the original exception. Also, consolidate duplicate code for MethodHandleInError and MethodTypeInError with UnresolvedClassInError. > > open webrev at http://cr.openjdk.java.net/~coleenp/8023697/ > bug link https://bugs.openjdk.java.net/browse/JDK-8023697 > > Ran jck8, ute vm.quick.testlist, jtreg tests in hotspot/test, java/lang/invoke jdk jtreg tests. > > Thanks, > Coleen From staffan.larsen at oracle.com Tue Apr 29 14:21:10 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 29 Apr 2014 16:21:10 +0200 Subject: RFR: 8031126 java/lang/management/ThreadMXBean/ThreadUserTime.java fails intermittently Message-ID: <345ACDE8-C55E-468C-8BCA-143CF422ED7F@oracle.com> When JDK-8036122 "Fix warning "format not a string literal?? was fixed, the fix introduced a regression in os_linux.cpp:slow_thread_cpu_time(). There is a static variable in the method with a format string. The format string was set to different value if NTPL was used. This check was only done once. After the fix, the incorrect format string is used on NPTL for all but the first call. Since all our linux variants use NPTL now, I suggest a simple fix that has only one format string. webrev: http://cr.openjdk.java.net/~sla/8031126/webrev.00/ bug: https://bugs.openjdk.java.net/browse/JDK-8031126 Thanks, /Staffan From david.holmes at oracle.com Tue Apr 29 23:37:05 2014 From: david.holmes at oracle.com (David Holmes) Date: Wed, 30 Apr 2014 09:37:05 +1000 Subject: Attachment test - please ignore Message-ID: <536037A1.6080507@oracle.com> A non-text attachment was scrubbed... Name: jdk9.patch Type: text/x-patch Size: 5418 bytes Desc: not available URL: From goetz.lindenmaier at sap.com Wed Apr 30 07:54:15 2014 From: goetz.lindenmaier at sap.com (Lindenmaier, Goetz) Date: Wed, 30 Apr 2014 07:54:15 +0000 Subject: 8031126 java/lang/management/ThreadMXBean/ThreadUserTime.java fails intermittently In-Reply-To: <345ACDE8-C55E-468C-8BCA-143CF422ED7F@oracle.com> References: <345ACDE8-C55E-468C-8BCA-143CF422ED7F@oracle.com> Message-ID: <4295855A5C1DE049A61835A1887419CC2CEBCA50@DEWDFEMB12A.global.corp.sap> Hi Staffan, sorry for introducing this bug! I obviously oversaw the 'static' at the variable declaration. Thanks for fixing this, Goetz. -----Original Message----- From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-bounces at openjdk.java.net] On Behalf Of Staffan Larsen Sent: Dienstag, 29. April 2014 16:21 To: hotspot-runtime-dev Subject: RFR: 8031126 java/lang/management/ThreadMXBean/ThreadUserTime.java fails intermittently When JDK-8036122 "Fix warning "format not a string literal"" was fixed, the fix introduced a regression in os_linux.cpp:slow_thread_cpu_time(). There is a static variable in the method with a format string. The format string was set to different value if NTPL was used. This check was only done once. After the fix, the incorrect format string is used on NPTL for all but the first call. Since all our linux variants use NPTL now, I suggest a simple fix that has only one format string. webrev: http://cr.openjdk.java.net/~sla/8031126/webrev.00/ bug: https://bugs.openjdk.java.net/browse/JDK-8031126 Thanks, /Staffan From volker.simonis at gmail.com Wed Apr 30 09:47:05 2014 From: volker.simonis at gmail.com (Volker Simonis) Date: Wed, 30 Apr 2014 11:47:05 +0200 Subject: RFR: 8031126 java/lang/management/ThreadMXBean/ThreadUserTime.java fails intermittently In-Reply-To: <345ACDE8-C55E-468C-8BCA-143CF422ED7F@oracle.com> References: <345ACDE8-C55E-468C-8BCA-143CF422ED7F@oracle.com> Message-ID: On Tue, Apr 29, 2014 at 4:21 PM, Staffan Larsen wrote: > When JDK-8036122 "Fix warning "format not a string literal?? was fixed, the fix introduced a regression in > os_linux.cpp:slow_thread_cpu_time(). There is a static variable in the method with a format string. The format string was set to different value if NTPL was used. This check was only done once. After the fix, the incorrect format string is used on NPTL for all but the first call. > > Since all our linux variants use NPTL now, I suggest a simple fix that has only one format string. > I agree that we only use NPTL now. However if you remove the check, I'd suggest we remove os::Linux::is_NPTL() altogether. For any case we can change the detection of the pthread version in os::Linux::libpthread_init() into a guarantee that we really use NPTL. And we should remove the kernel versions 2.5 and 2.5 from the list of supported kernel versions (i.e. SUPPORTED_OS_VERSION) in make/linux/Makefile because kernel 2.6 was the first one which supported NPTL. Of course all this cleanup could be done in extra, follow-up change. Regards, Volker > webrev: http://cr.openjdk.java.net/~sla/8031126/webrev.00/ > bug: https://bugs.openjdk.java.net/browse/JDK-8031126 > > Thanks, > /Staffan From staffan.larsen at oracle.com Wed Apr 30 11:42:31 2014 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Wed, 30 Apr 2014 13:42:31 +0200 Subject: RFR: 8031126 java/lang/management/ThreadMXBean/ThreadUserTime.java fails intermittently In-Reply-To: References: <345ACDE8-C55E-468C-8BCA-143CF422ED7F@oracle.com> Message-ID: Volker, I agree on all of that, it just seems widely out of scope for the small regression I?m trying to fix. Thanks, /Staffan On 30 apr 2014, at 11:47, Volker Simonis wrote: > On Tue, Apr 29, 2014 at 4:21 PM, Staffan Larsen > wrote: >> When JDK-8036122 "Fix warning "format not a string literal?? was fixed, the fix introduced a regression in >> os_linux.cpp:slow_thread_cpu_time(). There is a static variable in the method with a format string. The format string was set to different value if NTPL was used. This check was only done once. After the fix, the incorrect format string is used on NPTL for all but the first call. >> >> Since all our linux variants use NPTL now, I suggest a simple fix that has only one format string. >> > > I agree that we only use NPTL now. > > However if you remove the check, I'd suggest we remove > os::Linux::is_NPTL() altogether. > > For any case we can change the detection of the pthread version in > os::Linux::libpthread_init() into a guarantee that we really use NPTL. > And we should remove the kernel versions 2.5 and 2.5 from the list of > supported kernel versions (i.e. SUPPORTED_OS_VERSION) in > make/linux/Makefile because kernel 2.6 was the first one which > supported NPTL. > Of course all this cleanup could be done in extra, follow-up change. > > Regards, > Volker > >> webrev: http://cr.openjdk.java.net/~sla/8031126/webrev.00/ >> bug: https://bugs.openjdk.java.net/browse/JDK-8031126 >> >> Thanks, >> /Staffan From gerard.ziemski at oracle.com Wed Apr 30 18:00:14 2014 From: gerard.ziemski at oracle.com (Gerard Ziemski) Date: Wed, 30 Apr 2014 13:00:14 -0500 Subject: RFR (round 2) JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <53597B31.6000007@oracle.com> References: <53597B31.6000007@oracle.com> Message-ID: <53613A2E.1010604@oracle.com> hi all, Please review this 2nd webrev for a simple enhancement, which renames symbolTable::lookup API using names that better reflect the method purpose, ie: lookup, lookup_and_add, lookup_and_hash, lookup_and_add_unicode, lookup_and_hash_unicode and lookup_and_ignore_hash. The changes since webrev 1: Re: Christian Thalinger Dropped the ?_only? suffix completely - I decided it was no longer needed after being left with 1 API using it (ie. lookup_only ?> lookup, after dropping it first from lookup_only_and_add) Re: John Rose Renamed ?probe? into ?lookup_and_ignore_hash?. Removed ?blank? lines and checked with jcheck Re: Per Liden Decided to leave ?lookup_and_add? alone, since ?lookup_or_add? implies one or the other and seems even less right. We could have renamed ?lookup_and_add? as ?lookup_and_add_if_needed?, but there is no ?lookup_and_add_always?, so I simply left it alone - hope that?s OK. Webrev: http://cr.openjdk.java.net/~gziemski/8039525_rev1 Bug: https://bugs.openjdk.java.net/browse/JDK-8039525 Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. Thank you. From christian.thalinger at oracle.com Wed Apr 30 18:58:27 2014 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Wed, 30 Apr 2014 08:58:27 -1000 Subject: RFR (round 2) JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <53613A2E.1010604@oracle.com> References: <53597B31.6000007@oracle.com> <53613A2E.1010604@oracle.com> Message-ID: <68D6AB4C-87E6-4FDD-B05C-BA56E3159615@oracle.com> One more comment: why do we need the _ignore_hash versions? The method signature already implies that the user is ignoring it: ! static Symbol* lookup_and_hash(const char* name, int len, unsigned int& hash); ! static Symbol* lookup_and_ignore_hash(const char* name, int len) { That also questions the _and_hash versions. Anyway, maybe I?m not understanding the purpose of this change. Whatever you do the change looks good. On Apr 30, 2014, at 8:00 AM, Gerard Ziemski wrote: > hi all, > > Please review this 2nd webrev for a simple enhancement, which renames symbolTable::lookup > API using names that better reflect the method purpose, ie: lookup, lookup_and_add, > lookup_and_hash, lookup_and_add_unicode, lookup_and_hash_unicode and lookup_and_ignore_hash. > > > The changes since webrev 1: > > Re: Christian Thalinger > > Dropped the ?_only? suffix completely - I decided it was no longer needed after being left > with 1 API using it (ie. lookup_only ?> lookup, after dropping it first from lookup_only_and_add) > > Re: John Rose > > Renamed ?probe? into ?lookup_and_ignore_hash?. Removed ?blank? lines and checked with jcheck > > Re: Per Liden > > Decided to leave ?lookup_and_add? alone, since ?lookup_or_add? implies one or the other and seems > even less right. We could have renamed ?lookup_and_add? as ?lookup_and_add_if_needed?, > but there is no ?lookup_and_add_always?, so I simply left it alone - hope that?s OK. > > > Webrev: http://cr.openjdk.java.net/~gziemski/8039525_rev1 > Bug: https://bugs.openjdk.java.net/browse/JDK-8039525 > > Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on Mac OS X and Linux. > > Thank you. > > > > From gerard.ziemski at oracle.com Wed Apr 30 19:56:12 2014 From: gerard.ziemski at oracle.com (Gerard Ziemski) Date: Wed, 30 Apr 2014 14:56:12 -0500 Subject: RFR (round 2) JDK-8039525: HashTable lookup API needs refactoring In-Reply-To: <68D6AB4C-87E6-4FDD-B05C-BA56E3159615@oracle.com> References: <53597B31.6000007@oracle.com> <53613A2E.1010604@oracle.com> <68D6AB4C-87E6-4FDD-B05C-BA56E3159615@oracle.com> Message-ID: <5361555C.7000300@oracle.com> Thanks for the review. You have to be familiar with the base API to know that it takes hash. The idea behind these changes is to clarify, and they are not required as you noted. This also is a first stab at this, we can come and revisit later, but let's just make a bit of progress now. cheers On 4/30/2014 1:58 PM, Christian Thalinger wrote: > One more comment: why do we need the _ignore_hash versions? The > method signature already implies that the user is ignoring it: > > *! static Symbol*_lookup_and_hash_(const char* name, int len, unsigned int& hash);* > *! static Symbol*_lookup_and_ignore_hash_(const char* name, int len) {* > > That also questions the _and_hash versions. Anyway, maybe I?m not > understanding the purpose of this change. Whatever you do the change > looks good. > > On Apr 30, 2014, at 8:00 AM, Gerard Ziemski > wrote: > >> hi all, >> >> Please review this 2nd webrev for a simple enhancement, which renames >> symbolTable::lookup >> API using names that better reflect the method purpose, ie: lookup, >> lookup_and_add, >> lookup_and_hash, lookup_and_add_unicode, lookup_and_hash_unicode and >> lookup_and_ignore_hash. >> >> >> The changes since webrev 1: >> >> Re: Christian Thalinger >> >> Dropped the ?_only? suffix completely - I decided it was no longer >> needed after being left >> with 1 API using it (ie. lookup_only ?> lookup, after dropping it >> first from lookup_only_and_add) >> >> Re: John Rose >> >> Renamed ?probe? into ?lookup_and_ignore_hash?. Removed ?blank? lines >> and checked with jcheck >> >> Re: Per Liden >> >> Decided to leave ?lookup_and_add? alone, since ?lookup_or_add? >> implies one or the other and seems >> even less right. We could have renamed ?lookup_and_add? as >> ?lookup_and_add_if_needed?, >> but there is no ?lookup_and_add_always?, so I simply left it alone - >> hope that?s OK. >> >> >> Webrev: http://cr.openjdk.java.net/~gziemski/8039525_rev1 >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8039525 >> >> Tested with hotspot jtreg, vm.quicklooks and JPRT. Locally builds on >> Mac OS X and Linux. >> >> Thank you. >> >> >> >> > From coleen.phillimore at oracle.com Wed Apr 30 21:41:25 2014 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 30 Apr 2014 17:41:25 -0400 Subject: RFR (S) 8023697: failed class resolution reports different class name in detail message for the ,first and subsequent times In-Reply-To: <68F0F5FF-4804-47DB-A5BE-E95726109CCC@oracle.com> References: <535EC31C.40503@oracle.com> <68F0F5FF-4804-47DB-A5BE-E95726109CCC@oracle.com> Message-ID: <53616E05.8020704@oracle.com> Karen, Thank you for looking at the code. On 4/28/14, 6:11 PM, Karen Kinnear wrote: > Coleen, > > A couple of comments/questions: > > 1. Can you possibly measure footprint in a large application to see if the saved error messages use significant footprint? I ran medrec and dacapo. Only failed constant pool resolutions are cached in this resolution error table. For these applications there was only one entry in this hashtable, so the footprint increase for both the pointer and the refcounted Symbol (which is the class name) is mimimal. The spec requires that the JVM throw the same exception for subsequent resolutions from the constant pool. For the field and method cases, we repeat the resolution steps and get the same answer. Only for classes, method handles and method types, do we save the resolution error. The resolution error is for errors during class loading from constant pool symbolic reference in the spec 5.3 paragraph 1 and does not include errors for linking and initializing the class. The error conditions for this are saved with a different mechanism (InstanceKlass::is_in_error_state()). > 2. I'm concerned about setting expectations that the detailed message will be repeated precisely for constant pool resolution > - but for now that is only for Class, MethodHandle and MethodType resolution Since the JVM repeats the attempted resolution for these other types of constant pool resolution, the message will already be the same. > 3. A comment in the bug report says that for linkage errors in SD the detail message is the name of the class, in all cases but this one, the > message is the same > - I'm confused - did you test this with for instance a LoaderConstraint test - doesn't that have a different detail message? I fixed the comment in the bug. For the case in the test, where the error came from the super class not found, the message refers to the super class. For all the other testing I did, since we save the name of the class in the error message. The loader constraint test does not save the error in the resolution error table. In investigating this, I found there were two parameters unused in handle_resolution_exception() so cleaned them up too. open webrev at http://cr.openjdk.java.net/~coleenp/8023697_2/ Thanks, Coleen > I appreciate consolidating the duplicate code. > > thanks, > Karen > > On Apr 28, 2014, at 5:07 PM, Coleen Phillimore wrote: > >> Summary: Cache detail message when we cache exception for constant pool resolution. >> >> In the resolution error table. Provide a default message if one is not in the original exception. Also, consolidate duplicate code for MethodHandleInError and MethodTypeInError with UnresolvedClassInError. >> >> open webrev athttp://cr.openjdk.java.net/~coleenp/8023697/ >> bug linkhttps://bugs.openjdk.java.net/browse/JDK-8023697 >> >> Ran jck8, ute vm.quick.testlist, jtreg tests in hotspot/test, java/lang/invoke jdk jtreg tests. >> >> Thanks, >> Coleen