From neojia at gmail.com Wed May 16 20:51:28 2007 From: neojia at gmail.com (Neo Jia) Date: Wed, 16 May 2007 22:51:28 -0500 Subject: [PATCH] fastdebug version: crash in Argument class while printing uninitialized string to outputStream (+PrintMallocFree) Message-ID: <5d649bdb0705162051l8f3d7e0o2ff246af97f1305a@mail.gmail.com> hi, This bug is in the fastdebug version while turning +PrintMallocFree on and having other options following, such as java -XX:+PrintMallocFree -Xmx16m -classpath . helloworld will trigger this bug. But it won't crash if you switch the position with -Xmx16m and -XX:+PrintMallocFree. The root cause for this problem is that when the Argument class is trying to allocate memory for incoming arguments such as string "+PrintMallocFree" and "-Xmx16m", the "+PrintMallcFree" option will trigger to initialize "xmlstream" before the Argument has copied all those incoming arguments. And the "xmlstream" will read the argument list in its init. function. The problem happens that the Argument class increase the counter before it actually copy the string to its internal array. So "xmlstream" will read garbage and crash the VM. My fix is to defer increasing the counter of the argument list when the array is not fully copied. Please note: With this fix, the system will not crash but it will lost some arguments in the generated XML file because the counter is less than it should be when we begin the XML file. It would be great if you can provide a better solution to keep all the arguments in XML file. Thanks, Neo Index: hotspot/src/share/vm/runtime/arguments.cpp =================================================================== --- hotspot/src/share/vm/runtime/arguments.cpp (revision 86) +++ hotspot/src/share/vm/runtime/arguments.cpp (working copy) @@ -628,14 +628,14 @@ int index = *count; - // expand the array and add arg to the last element - (*count)++; if (*bldarray == NULL) { - *bldarray = NEW_C_HEAP_ARRAY(char*, *count); + *bldarray = NEW_C_HEAP_ARRAY(char*, index + 1); } else { - *bldarray = REALLOC_C_HEAP_ARRAY(char*, *bldarray, *count); + *bldarray = REALLOC_C_HEAP_ARRAY(char*, *bldarray, index + 1); } (*bldarray)[index] = strdup(arg); + // expand the array and add arg to the last element + (*count)++; } void Arguments::build_jvm_args(const char* arg) { -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! -------------- next part -------------- A non-text attachment was scrubbed... Name: arguments_list.patch Type: application/octet-stream Size: 807 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20070516/7f887b75/attachment.obj From neojia at gmail.com Fri May 18 08:22:54 2007 From: neojia at gmail.com (Neo Jia) Date: Fri, 18 May 2007 10:22:54 -0500 Subject: [BUG FIX] dtrace_object_alloc might not be reached in function, TemplateTable::_new() of AMD64 In-Reply-To: <462784D3.7050600@sun.com> References: <462784D3.7050600@sun.com> Message-ID: <5d649bdb0705180822wc018b8cqb2c619f87fb46ec6@mail.gmail.com> On 4/19/07, Lev Serebryakov wrote: > > > In the interpreter code, templateTable_amd64.cpp, function: void > > TemplateTable::_new(), line:3335-3342 contains the code for DTrace of > > object allocation. But if the code fall into the previous if-branch > > (line:3302), it will jump to the line: 3352, which will not report the > > object allocation to DTrace. > > > After comparing the code with templateTable_i486.cpp and sparc > > platform, I changed the code and put the patch file in this > > attachment, please check. > > I'll sponsor this one. Lev, Is there update for this patch? Thanks, Neo > > > -- > // Lev Serebryakov > -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! From Tom.Marble at Sun.COM Sun May 20 13:26:05 2007 From: Tom.Marble at Sun.COM (Tom Marble) Date: Sun, 20 May 2007 15:26:05 -0500 Subject: test of new Gmane migration Message-ID: <4650AEDD.4000304@sun.com> All: Please ignore this test message whose purpose is to confirm that the Gmane gateway has been migrated from the old list to the new list. --Tom From neojia at gmail.com Sun May 20 20:57:22 2007 From: neojia at gmail.com (Neo Jia) Date: Sun, 20 May 2007 22:57:22 -0500 Subject: Fwd: [PATCH] ReferenceProcessor::verify() fail with VerifyBeforeGC && !UseTLAB In-Reply-To: <5d649bdb0705091522w4579f5bn7e71d112cd07086b@mail.gmail.com> References: <5d649bdb0705091522w4579f5bn7e71d112cd07086b@mail.gmail.com> Message-ID: <5d649bdb0705202057w701e998dke54e153e3e4f16a5@mail.gmail.com> hi, I sent the original mail to "openjdk.dev.java.net" mailling list so just re-send it again. Thanks, Neo ---------- Forwarded message ---------- From: Neo Jia Date: May 9, 2007 5:22 PM Subject: [PATCH] ReferenceProcessor::verify() fail with VerifyBeforeGC && !UseTLAB To: hotspot-runtime-dev at openjdk.dev.java.net hi, The ReferenceProcessor::verify() will fail because it is called before its initalization while turning on VerifyBeforeGC && !UseTLAB on universe2_init() function. Thanks, Neo Index: runtime/init.cpp =================================================================== --- runtime/init.cpp (revision 86) +++ runtime/init.cpp (working copy) @@ -53,6 +53,7 @@ void templateTable_init(); void InterfaceSupport_init(); void universe2_init(); // dependent on codeCache_init and stubRoutines_init +void universe2_verify(); // Move out verification from universe2 void referenceProcessor_init(); void jni_handles_init(); void vmStructs_init(); @@ -110,6 +111,7 @@ SharedRuntime::generate_stubs(); universe2_init(); // dependent on codeCache_init and stubRoutines_init referenceProcessor_init(); + universe2_verify(); jni_handles_init(); vmStructs_init(); Index: memory/universe.cpp =================================================================== --- memory/universe.cpp (revision 86) +++ memory/universe.cpp (working copy) @@ -724,6 +724,9 @@ void universe2_init() { EXCEPTION_MARK; Universe::genesis(CATCH); +} + +void universe2_verify() { // Although we'd like to verify here that the state of the heap // is good, we can't because the main thread has not yet added // itself to the threads list (so, using current interfaces Index: memory/universe.hpp =================================================================== --- memory/universe.hpp (revision 86) +++ memory/universe.hpp (working copy) @@ -106,6 +106,7 @@ friend jint universe_init(); friend void universe2_init(); + friend void universe2_verify(); friend bool universe_post_init(); #ifdef JVMPI_SUPPORT -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! -------------- next part -------------- A non-text attachment was scrubbed... Name: reference_processor_verify.patch Type: application/octet-stream Size: 1549 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20070520/fe900a7a/attachment.obj From nima.gougol at gmail.com Sat May 26 15:46:03 2007 From: nima.gougol at gmail.com (Nima Gougol) Date: Sat, 26 May 2007 15:46:03 -0700 Subject: JIT threshold, priority queue Message-ID: Hello everybody. Here I am trying to optimize Hotspot JDK 7. You guys know hotspot schedule hot methods whose usage frequency is higher than a fixed threshold through a FIFO queue for Just-In-Time compilation. I am trying to enhance this method with dynamic threshold and priority queues. I have already done some modifications. I have two problems. First, I need to trace the queue of methods that are scheduled for JIT compilations and see and compare my new policy with the default. How can I trace and log methods that are queue for JIT compilation? Second, I am trying to add to constants in through the file, src/share/vm/opto/c2_globals.hpp in order to use in my implementations for instance in file src/share/vm/oops/methodOop.hpp. But while making the hotpsot, compiler produce error that these identifiers are not defined. I think this is due to my way of building. Please let me know how I should add these identifiers and build hotspot. product(intx, CICompilerQueueType, 1, \ "Compiler Queue Algorithm to use") \ \ product(intx, PairQueueLength, 10, \ "Max Length of Pair Queue") \ Best Regards, Nima R. Gougol -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20070526/1152de18/attachment.html From Peter.Kessler at Sun.COM Sun May 27 13:26:47 2007 From: Peter.Kessler at Sun.COM (Peter B. Kessler) Date: Sun, 27 May 2007 13:26:47 -0700 Subject: JIT threshold, priority queue In-Reply-To: References: Message-ID: <4659E987.6030507@Sun.COM> This question is about the HotSpot runtime compilers, not about the HotSpot runtime libraries. I've cc'd hotspot-compiler-dev at openjdk.java.net who should be able to help you. I don't know much about the runtime compilation policy, but I do know that the compiler folks wish they could _delay_ compilation, so they get better statistics about the code they are compiling. ... peter Nima Gougol wrote: > Hello everybody. Here I am trying to optimize Hotspot JDK 7. You guys > know hotspot schedule hot methods whose usage frequency is higher than a > fixed threshold through a FIFO queue for Just-In-Time compilation. I am > trying to enhance this method with dynamic threshold and priority > queues. I have already done some modifications. I have two problems. > First, I need to trace the queue of methods that are scheduled for JIT > compilations and see and compare my new policy with the default. How can > I trace and log methods that are queue for JIT compilation? > > Second, I am trying to add to constants in through the file, > src/share/vm/opto/c2_globals.hpp in order to use in my implementations > for instance in file src/share/vm/oops/methodOop.hpp. But while making > the hotpsot, compiler produce error that these identifiers are not > defined. I think this is due to my way of building. Please let me know > how I should add these identifiers and build hotspot. > > product(intx, CICompilerQueueType, 1, \ > "Compiler Queue Algorithm to > use") \ > > \ > product(intx, PairQueueLength, > 10, \ > "Max Length of Pair > Queue") \ > > Best Regards, > > Nima R. Gougol -- NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.