Community
Participate
Working Groups
We are using this bug to track the fix for bug 194081 for TPTP 4.6 release. Please see bug 194081 for more details.
Created attachment 133882 [details] Shadow Stack Solution Implementation patch. This patch is used for TPTP 4.6.0 This patch is used to reattach problem for TPTP 4.6.0. The problem details, please refer bug 194081.
(In reply to comment #1) > Created an attachment (id=133882) [details] > Shadow Stack Solution Implementation patch. This patch is used for TPTP 4.6.0 > > This patch is used to reattach problem for TPTP 4.6.0. The problem details, > please refer bug 194081. > Hi Chengrui, Could you attach the binary patch for testing? Thanks.
(In reply to comment #2) > (In reply to comment #1) > > Created an attachment (id=133882) [details] [details] > > Shadow Stack Solution Implementation patch. This patch is used for TPTP 4.6.0 > > > > This patch is used to reattach problem for TPTP 4.6.0. The problem details, > > please refer bug 194081. > > > > > Hi Chengrui, > > Could you attach the binary patch for testing? > > Thanks. > Eugene and I have tested with more applications. A crash problem and additional profiling data problem are founded. Please refer discussion in bug 194081. I will handle the problem asap and report the update. Thanks, Chengrui
Created attachment 134400 [details] Profilers Binary files for testing on WindowsXP Hi, Jonathan, I have solved the crash and additional profiling data problems above. This attachment zip file is the profilers binary files for testing on WindowsXP. Please try with it. If no problem, I will submit the patch for reviewing in bug 270767 and bug 194081 respectively. Thanks, Chengrui
The following was reproduced on Windows using the updated XP binary you posted. 1. Set environment variables 2. Run the following: java -classpath d:\test-classes -agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf HeapJniCarTest 3. From the Eclipse workbench, Profiling Dialogue -> Attach to Agent -> Agent Tab -> select the agent, double click the agent. 4. Create a new Filter set with no filters. 5. Click profile. It will crash on attach. Result: HeapJniCarTest about to run. If Enabled mode, attach this process to agent. Press [Enter]: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02644e45, pid=3432, tid=8008 # # Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86) # Problematic frame: # C [HeapProf.dll+0x4e45] # # An error report file with more information is saved as: # D:\test-classes6\hs_err_pid3432.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Used a Sun JVM: D:\test-classes6>java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode) The HeapJniCarTest is available from test-results/ in CVS, if you do not already have it.
(In reply to comment #5) > The following was reproduced on Windows using the updated XP binary you posted. > > 1. Set environment variables > 2. Run the following: java -classpath d:\test-classes > -agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf HeapJniCarTest > > 3. From the Eclipse workbench, Profiling Dialogue -> Attach to Agent -> Agent > Tab -> select the agent, double click the agent. > 4. Create a new Filter set with no filters. > > 5. Click profile. It will crash on attach. > > Result: > > HeapJniCarTest about to run. > If Enabled mode, attach this process to agent. > Press [Enter]: # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02644e45, pid=3432, tid=8008 > # > # Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86) > # Problematic frame: > # C [HeapProf.dll+0x4e45] > # > # An error report file with more information is saved as: > # D:\test-classes6\hs_err_pid3432.log > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > > Used a Sun JVM: > > D:\test-classes6>java -version > java version "1.6.0_13" > Java(TM) SE Runtime Environment (build 1.6.0_13-b03) > Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode) > > > The HeapJniCarTest is available from test-results/ in CVS, if you do not > already have it. > I test it with StartStop and PerformanceExample using CGProf. I will try with this new test case. Please give all test cases that will need be tested to avoid solve the problem one by one. Thanks, Chengrui
As part of the JVMTI testing we use: - InOut - StartStop - HeapJniCarTest - statisticsTest - ArgumentsTest Plus a few others, see the 'Platform.Agents.JVMTI.Windows_IA32.testsuite' file under test-results/org.eclipse.hyades.use.cases/manual/Profiling_and_Logging/ for the full suite.
(In reply to comment #5) > The following was reproduced on Windows using the updated XP binary you posted. > > 1. Set environment variables > 2. Run the following: java -classpath d:\test-classes > -agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf HeapJniCarTest > > 3. From the Eclipse workbench, Profiling Dialogue -> Attach to Agent -> Agent > Tab -> select the agent, double click the agent. > 4. Create a new Filter set with no filters. > > 5. Click profile. It will crash on attach. > > Result: > > HeapJniCarTest about to run. > If Enabled mode, attach this process to agent. > Press [Enter]: # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02644e45, pid=3432, tid=8008 > # > # Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86) > # Problematic frame: > # C [HeapProf.dll+0x4e45] > # > # An error report file with more information is saved as: > # D:\test-classes6\hs_err_pid3432.log > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > > Used a Sun JVM: > > D:\test-classes6>java -version > java version "1.6.0_13" > Java(TM) SE Runtime Environment (build 1.6.0_13-b03) > Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode) > > > The HeapJniCarTest is available from test-results/ in CVS, if you do not > already have it. > Hi, Jonathan, After I execute step2, the HeapJniCarTest will end soon and print message below: ---------------------------------------- Default configuration values for connection with AC are used. Note: Agent and AC should use same configuration for correct work. Rollup the window. Start the car. Rev the engine. Tire inflated. Oops! stop the car. --------------------------------------- I have no chance to execute attach operation. Because the program will run as usual with enabled mode. If execute with controlled mode, I get the profiling result as usual. I can not reproduce the problem. Please give the test details description how to execute re-attach operation in bug 194081 on HeapJniCarTest. BTW, please make sure the problem will not be produced with original profilers. Thanks, Chengrui
Created attachment 134618 [details] HeapJniCarTest - Class + Source Here is the HeapJniCarTest class I tested with, which is also available from /test-results/platform/org.eclipse.tptp.ac.testautomation/automation-files/external_classes/HeapJniCarTest.(java/class) This class pauses twice in order to allow for attach operations, and is part of our JVMTI test suite.
Created attachment 134724 [details] Reupload proifilers binary for WindowsXP Hi, Jonathan, I can not reproduce the problem with the test file you supplied. It works well on my machine. And my JRE version is the same with you: C:\Project\Java_workspace\HeapJniCarTest\bin>java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing) To avoid profiler binary files for testing has problem. I re-upload it again. Please try with this new .zip file. Thanks.
Created attachment 134727 [details] DefaultFiltersRemoved.png I am still able to reproduce with latest upload. My only suggestion is that the crucial point is that you MUST remove all default filters from inside Eclipse before attaching, screenshot included. If you do not remove all filters, the test will pass. I tried a second machine (Vista 32-bit), with the latest upload, and was able to reproduce there as well with Sun JVM: D:\jgw\auto-test-framework\external_classes>java -version java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b06) Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing) I am building the patched agent controller by taking either latest 4.6.0 or the 4.5.2.1 M2 candidate (either will reproduce the bug) and extracting your files overtop the plugins/org.eclipse.tptp.javaprofiler directory.
(In reply to comment #11) > Created an attachment (id=134727) [details] > DefaultFiltersRemoved.png > > I am still able to reproduce with latest upload. My only suggestion is that the > crucial point is that you MUST remove all default filters from inside Eclipse > before attaching, screenshot included. If you do not remove all filters, the > test will pass. > > I tried a second machine (Vista 32-bit), with the latest upload, and was able > to reproduce there as well with Sun JVM: > > D:\jgw\auto-test-framework\external_classes>java -version > java version "1.6.0_02" > Java(TM) SE Runtime Environment (build 1.6.0_02-b06) > Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing) > > I am building the patched agent controller by taking either latest 4.6.0 or the > 4.5.2.1 M2 candidate (either will reproduce the bug) and extracting your files > overtop the plugins/org.eclipse.tptp.javaprofiler directory. > Hi, Jonathan, Thanks for you information. Now I can reproduce the problem. But the problem can also be reproduced with original profilers. It seems the problem is not related with new added code. Actually new added patch code just handle for CGProf with execdetails. Please try with old profilers. If the problem on HeapJniCarTest can be also reproduced on your side, please report another bug for it. If no new problem is found, I will submit patch for reviewing. Thanks, Chengrui
Hi, Jonathan, I have tested with below test cases according to your testing operation with CGProf in enabled mode and no crash happens: - InOut - StartStop - HeapJniCarTest - statisticsTest - ArgumentsTest Thanks, Chengrui
Great, I have confirmed that the bug I found is present in the existing profiler, and have filed bug 275321. I have not found any additional bugs, so you may proceed with review.
Created attachment 134949 [details] Shadow stack solution patch to solve reattach and attach problem with CGProf enabled mode This patch is used to solve re-attach problem caused by JVMTI limitation. When the problem is fixed in TPTP 4.6.0, I will submit a corresponding patch to bug 194081 for TPTP 4.5.2.1. Dear commiters, please help to review the patch code. Thanks. -- Chengrui
Patch looks good, just one thing: I noticed in 'IsExcludedClass(const char* szClassName)' in ProvEnv.cpp you have hardcoded a list of classes to exclude: "org.eclipse.tptp.martini.", "com.ibm.crypto", "sun.reflect.Generated", "jrockit.", "com.Intel.VTune.VTuneAPI", "org.eclipse.hyades.collection.profiler", "java.lang.", "java.security.", "java.awt.", "java.io.", "javax.swing." "com.ibm.jvm.", "com.ibm.misc.", "com.ibm.oti.", "sun.nio.", "CGLIB$$" Is it possible to gather this information without hardcoding the classes, using the JVMTI interface?
We've checked the patch into HEAD w/ project lead approval, so that we do not miss the RC deadline. I am leaving the bug open to continue discussion from comment 16.
(In reply to comment #16) > Patch looks good, just one thing: I noticed in 'IsExcludedClass(const char* > szClassName)' in ProvEnv.cpp you have hardcoded a list of classes to exclude: > > "org.eclipse.tptp.martini.", "com.ibm.crypto", "sun.reflect.Generated", > "jrockit.", "com.Intel.VTune.VTuneAPI", > "org.eclipse.hyades.collection.profiler", "java.lang.", "java.security.", > "java.awt.", "java.io.", "javax.swing." "com.ibm.jvm.", "com.ibm.misc.", > "com.ibm.oti.", "sun.nio.", "CGLIB$$" > > Is it possible to gather this information without hardcoding the classes, using > the JVMTI interface? > At first, 'IsExcludedClass' is not used. But it will generate different profiling data between attach to a Java application and not attach to a Java application. For example, try with StartStop test case and if you profile it directly (not using detach and reattach) you will just receive default package profiling data. However, if you try with detach and reattach, you will receive additional profiling data such as "java.io." etc. It will confuse the users. Eugene has reported the problem in comment 53 of bug 194081. The root cause of the problem is hardcoded a list of classes have been used in Martini framework which is above the JVMTI. These classes are instrumented in CGProf/HeapProf/ThreadProf adaptors. You can find these code in adaptors' functions named as 'CanInstrumentClass'. Because 'CanInstrumentClass' is not a Martini profiling interface, we can not call it directly from profilers. And to keep consistency, the similar filter rule is added in profiler Shadow Stack solution code. Thanks, Chengrui
I see, thanks for the detailed explanation Chengrui. :)
Resolving the defect since the patch has been committed to HEAD for TPTP 4.6.
Created attachment 136463 [details] Shadow Stack solution design and implementation document for bug 194081 and bug 270767 This design document is about shadow stack solution design, patch implementation and test cases. It is used to solve attach or reattach problem with CGProf execDetails in enabled mode. Thanks, Chengrui
Created attachment 139605 [details] Animated Slide to show how Shadow Stack Solution is executed This slide is an additional document for Shadow Stack Solution
Please note, submitted patch for this defect here caused incomplete code modification problems for memory usage, which have been fixed in bug 277431 and bug 278437. Just a reminder for reference in the future.
Eugene, Could you please verify this in the TPTP 4.6 driver? Since you found problem with the verification of bug 194081 in TPTP 4.5.2.1 M3, I wonder if you have similar problem in TPTP 4.6.
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.