Community
Participate
Working Groups
Build Identifier: M20110210-1200 Note, we are seeing this problem on POWER5,6,7. I don't know if it's a problem on x86. About 10 of 200 of the event names that are in the OProfile profile configuration event tab have the beginning of their names chopped off. For example, a name that should be something like PM_LD_MISS_L1_LSU1_GRP46 is showing up in the dialog as _LD_MISS_L1_LSU1_GRP46. Some of shortened names are much shorter, like _GRP32. Reproducible: Always Steps to Reproduce: 1.Build any small app (e.g. C hello_world) 2.right-click on the executable and select "Profile configurations" 3.Click on the Events tab and scroll through the event list, and note the event names which are incorrect.
I'm debugging into this problem now, trying to figure out where things are going astray.
So far I'm not able to reproduce this on x86_64, FWIW.
(In reply to comment #2) > So far I'm not able to reproduce this on x86_64, FWIW. Thanks for having a look at it. I handed this bug off to another engineer here, so she will be looking into the problem on POWER. It might be some bug in the JRE. I hope not!
Created attachment 194649 [details] Bug fix: 343025 - Event names in the OProfile are malformed
The issue occurs on IBM JVM, it does not occur on Oracle JVM. DESCRIPTION OF THE SOLUTION: The issue could be solved by increasing the input-buffer size used by the XMLReader class which is responsible for parsing the xml. At the beginning I thought that the problem was with xml header but after adding it (xml declaration and dtd) some events were fixed and others got incorrect, so I saw that it was not the solution. The input-buffer size can be increased as following: XMLReader reader; ... try { reader.setProperty("http://apache.org/xml/properties/input-buffer-size", new Integer(102400)); } catch (SAXNotRecognizedException e1) { e1.printStackTrace(); } catch (SAXNotSupportedException e1) { e1.printStackTrace(); } The default input-buffer size is 2KB. Instead of the specification http://xerces.apache.org/xerces2-j/properties.html recommends to use 4K or 8K for documents larger than 10K, it was so small for the xml generated by the plug-in based on opxml created on tachyon (Power 6) which is 1.6 MB. It was solved using the buffer-size 49KB, it did not work less than that. Just for the contingency, I am using 100KB. I also checked that this modification does not change the result on Oracle JVM. The fix has been verified on x86, Power6 and Power7 and worked well. This appears to be a bug in the IBM JRE version 1.6.0. This patch is a work-around for that bug.
Thanks, pushed (Commit d2c6aa98558db174e32f51705d4de3c25d978588).
Created attachment 194709 [details] Patch generated from EGit - Bug fix: 343025 - Event names in the OProfile are malformed
Attaching the same patch but generated from EGit.
(In reply to comment #8) > Attaching the same patch but generated from EGit. Thanks, but this has been pushed already (see comment 6). Let me know if that doesn't fix your issue.
(In reply to comment #9) > (In reply to comment #8) > > Attaching the same patch but generated from EGit. > > Thanks, but this has been pushed already (see comment 6). Let me know if that > doesn't fix your issue. There is no error on earlier patch. It was just recreated from EGit for users who use EGit to apply the patches. Both have been generated from the same commit. Sorry for the confusion.
(In reply to comment #5) > The issue occurs on IBM JVM, it does not occur on Oracle JVM. > > DESCRIPTION OF THE SOLUTION: > The issue could be solved by increasing the input-buffer size used by the > XMLReader class which is responsible for parsing the xml. At the beginning I > thought that the problem was with xml header but after adding it (xml > declaration and dtd) some events were fixed and others got incorrect, so I saw > that it was not the solution. > > The input-buffer size can be increased as following: > > XMLReader reader; > ... > try { > > reader.setProperty("http://apache.org/xml/properties/input-buffer-size", new > Integer(102400)); > } catch (SAXNotRecognizedException e1) { > e1.printStackTrace(); > } catch (SAXNotSupportedException e1) { > e1.printStackTrace(); > } > > The default input-buffer size is 2KB. Instead of the specification > http://xerces.apache.org/xerces2-j/properties.html recommends to use 4K or 8K > for documents larger than 10K, it was so small for the xml generated by the > plug-in based on opxml created on tachyon (Power 6) which is 1.6 MB. It was > solved using the buffer-size 49KB, it did not work less than that. Just for > the contingency, I am using 100KB. I also checked that this modification does > not change the result on Oracle JVM. The fix has been verified on x86, Power6 > and Power7 and worked well. > This appears to be a bug in the IBM JRE version 1.6.0. This patch is a > work-around for that bug. Just an additional information to the Comment #5, the complete JVM version is: java version "1.6.0" Java(TM) SE Runtime Environment (build pxp6460sr9fp1-20110208_03(SR9 FP1)) IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux ppc64-64 jvmxp6460sr9-20110203_74623 (JIT enabled, AOT enabled) J9VM - 20110203_074623 JIT - r9_20101028_17488ifx3 GC - 20101027_AA) JCL - 20110203_01
Created attachment 195430 [details] Correct Bug fix: 343025 - Event names in the OProfile are malformed After reported the error to the IBM Java team, they answered with the correct solution of the problem. The problem occurred because XMLReader parser split some characters into two or more set of characters and the plug-in was using only the last one as the event name. As per IBM Java team, the XMLReader is working as designed and that behaviour is allowed per spec, so it is not an error, it is programmers responsibility to handle those chars correctly. The solution that had been used for this defect was a work-around. I had increased the parser's input buffer size and it seemed to be fixed because the char split occurs when parser reaches the buffer size. As more the size was increased, less (or none) event names were getting wrong... But it is not a correct solution, it may not fix for all situation. The correct solution is modify the OprofileSAXHandlerclass (which implements ContentHandler interface) to manipulate those characters correctly. This patch removes the previous modification and adds the correct fix for the bug. The Java Bug Report PMR number is 41320,001,866. The patch was generated from EGit.
Do you have any information about when the new fix is planned to be included? Thanks!
Reopening, for new fix.
(In reply to comment #13) > Do you have any information about when the new fix is planned to be included? > Thanks! Actual fix applied with commit 1f60ad6a4954e25d701e0a923fb09e4ebd869f7b. No regressions on my end. Please verify it fixes your issue as well.
(In reply to comment #15) > (In reply to comment #13) > > Do you have any information about when the new fix is planned to be included? > > Thanks! > > Actual fix applied with commit 1f60ad6a4954e25d701e0a923fb09e4ebd869f7b. No > regressions on my end. Please verify it fixes your issue as well. Thanks! It has verified and is ok.
Closing. Thanks.