Community
Participate
Working Groups
Using upstream Eclipse with Linux Tools 0.7. Here is the original bug report: Just made the test using the factorial project. Got the following error on a popup window called "Problem occurred": "Launching factorial" has encountered a problem. An internal error occurred during: "Launching factorial". When hitting the "Details" button: An internal error occurred during: "Launching factorial". java.lang.ExceptionInInitializerError Test was done using Eclipse SDK 3.6.2 with CDT 7.0.2. Java version 1.5.0. OS used was RHEL 6.0. processor was a Power6 3,5Ghz on a LPar with 2GB of RAM.
Here is the conversation which followed: I assume you did: Right click on binary in CDT view => Profile as => Profile with Oprofile, right? Can you run the binary without errors? Right click => Run as => Local C/C++ Application Just making sure this isn't a CDT problem :)
> I assume you did: Right click on binary in CDT view => Profile as => > Profile with Oprofile, right? Precisely. > > Can you run the binary without errors? Right click => Run as => Local > C/C++ Application > > Just making sure this isn't a CDT problem :) Hehehe sorry, forgot to mention that. Project runs fine as local application, but fails to profile with Oprofile.
I forgot to send the stack trace from workspace/.metadata/.log . I think it might be helpful java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.initialize(J9VMInternals.java:218) at org.eclipse.linuxtools.oprofile.core.linux.LinuxOpcontrolProvider.setupDaemon(LinuxOpcontrolProvider.java:179) at org.eclipse.linuxtools.oprofile.launch.launching.AbstractOprofileLaunchConfigurationDelegate.oprofileSetupDaemon(AbstractOprofileLaunchConfigurationDelegate.java:130) at org.eclipse.linuxtools.oprofile.launch.launching.OprofileLaunchConfigurationDelegate.preExec(OprofileLaunchConfigurationDelegate.java:42) at org.eclipse.linuxtools.oprofile.launch.launching.AbstractOprofileLaunchConfigurationDelegate.launch(AbstractOprofileLaunchConfigurationDelegate.java:66) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:924) at org.eclipse.debug.internal.ui.DebugUIPlugin $8.run(DebugUIPlugin.java:1128) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: java.lang.NullPointerException at org.eclipse.linuxtools.oprofile.core.opxml.info.InfoAdapter.createHeaders(InfoAdapter.java:131) at org.eclipse.linuxtools.oprofile.core.opxml.info.InfoAdapter.process(InfoAdapter.java:124) at org.eclipse.linuxtools.oprofile.core.linux.OpxmlRunner.run(OpxmlRunner.java:106) at org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider $OpInfoRunner.run(LinuxOpxmlProvider.java:55) at org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider $OpInfoRunner.run0(LinuxOpxmlProvider.java:46) at org.eclipse.linuxtools.oprofile.core.daemon.OpInfo.getInfo(OpInfo.java:85) at org.eclipse.linuxtools.oprofile.core.Oprofile._initializeOprofileCore(Oprofile.java:94) at org.eclipse.linuxtools.oprofile.core.Oprofile.initializeOprofileModule(Oprofile.java:64) at org.eclipse.linuxtools.oprofile.core.Oprofile.<clinit>(Oprofile.java:43) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:196) ... 9 more
Ok
Daniel, I've created this bug to debug this further. I hope that's ok. Unfortunately I have no access to a PPC machine, so I am dependent on your help to debug this. Here's my suggestion: 1.) Import oprofile sources (using the attached PSF file; File => Import => Team => PSF; note, you need subclipse or something equivalent) 2.) cd to org.eclipse.linuxtools.oprofile.core/natives/linux/scripts (in the file system) 3.) su -c './install.sh' (this installs the oprofile wrapper) 4.) Place a breakpoint on line 131 of org.eclipse.linuxtools.oprofile.core.opxml.info.InfoAdapter in createHeaders() 5.) Right-click on org.eclipse.linuxtools.oprofile.core => Debug as => Eclipse Application (this fires up a second Eclipse instance) 6.) Import factorial project again. 7.) Right-click on binary => Profile As => Profile with Oprofile This should stop in the host Eclipse instance where you are getting a NullPointerException. I'd like to know what the variables in this passage are for you: // number of counters (snippet from InfoAdapter). String numCounters = String.valueOf(getNrCounters()); Element numCountersTag = newDoc.createElement(NUM_COUNTERS); Also, could you past output of the following commands: $ cd /dev/oprofile && find $ su -c 'ophelp -X' Thanks!
Created attachment 188798 [details] Linux Tools Oprofile PSF
Hello, I've done a debug session, just like Severin described. What I've got so far: - the variables you asked: numCounters = "6" numCountersTag = none, Null Pointer exception occurs on this line. The outputs of the commands you asked are attached, since I think they are too big to post here. - I did a quick investigation of my own on this debug. On the breakpoint of line 131, the InfoAdapter object has the following attributes: newDoc = null newRoot = null oldRoot = null On line 132: Element numCountersTag = newDoc.createElement(NUM_COUNTERS); gives a null pointer because newDoc is null itself. Going a bit deeper, what I think might be the start of the problem is at line 101, same class, createDom(InputStream is) method: Document oldDoc = builder.parse(is); This line gives an exception on the terminal: [Fatal Error] :138:127: Invalid byte 1 of 1-byte UTF-8 sequence. And this exception skips all the remaining lines of createDOM() where newDoc, newRoot and oldRoot are initialized.
Created attachment 188929 [details] output of "cd /dev/oprofile && find"
Created attachment 188930 [details] output of " su -c 'ophelp -X' "
(In reply to comment #7) > Going a bit deeper, what I think might be the start of the problem is at line > 101, same class, createDom(InputStream is) method: > > Document oldDoc = builder.parse(is); > > This line gives an exception on the terminal: > > [Fatal Error] :138:127: Invalid byte 1 of 1-byte UTF-8 sequence. > > And this exception skips all the remaining lines of createDOM() where newDoc, > newRoot and oldRoot are initialized. Thanks! It looks like XML parsing is broken on your system. We are using javax.xml.parsers.DocumentBuilder which is part of your JVM. I'll attach a small reproducer (a simple Java project). I expect this to cause the same exception, however, you should see the entire trace. Could you post output of this reproducer? 1.) su -c 'opcontrol --init' 2.) Run TestDocumentParse in Eclipse Which Eclipse and Java version are you using? Anyhow, it doesn't seem to be a problem of the Linux Tools OProfile plug-in.
Created attachment 188947 [details] Example project illustrating XML parsing problem.
su -c 'opcontrol --init' returned no output. And you were right Severin, the example project you sent gave the same exception. I tried to run it with another JVM and it worked ... so I guess we're talking about a JVM issue. I couldn't run the plugins with gcj (and later on I've learned that Eclipse is incompatible with gcj) but I'll assume that the JVM is indeed the problem. I'll open a bug against this JVM (FYI it's an IBM J5 JVM) and hope they can fix it fast. Thanks for the help!
(In reply to comment #12) > And you were right Severin, the example project you sent gave the same > exception. I tried to run it with another JVM and it worked ... so I guess > we're talking about a JVM issue. I couldn't run the plugins with gcj (and later > on I've learned that Eclipse is incompatible with gcj) but I'll assume that the > JVM is indeed the problem. > > I'll open a bug against this JVM (FYI it's an IBM J5 JVM) and hope they can fix > it fast. OK, I'll close this bug for now. Feel free to get back to us, once the JVM issue has been sorted out and you still have problems with OProfile. Thanks!