Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation on class compiled with JDK7 #28

Open
robinH opened this issue Feb 20, 2013 · 3 comments
Open

Instrumentation on class compiled with JDK7 #28

robinH opened this issue Feb 20, 2013 · 3 comments

Comments

@robinH
Copy link

robinH commented Feb 20, 2013

64-bit W7 system 12 core, 6G mem
Eclipse Indigo SR2 Win32-x86_64
Eclipse JDK 7 set for 1.6 compliance with JRE6 installed and checked to be added to build path.
Clean my app & rebuild.
The program ends with a "dong"
It does not seem to want to see the class files I have listed.
'My Classes...' box (from log below) is : [MainXFoil, JFoil, ca.rbh.xfoil.JPolar, Foil, ca.rbh.xfoil.Complex, ca.rbh.util.log.Logger] and Instrumented/Total Classes says 0/793.
If I add a file and 'Apply Changes' it still says 0/793.
Should it accept a package wild card such as ca.rbh.xfoil.* ??
If then add a class spec *, I then get 771/796 Java classes and none of my (about
22) classes although 5 are listed in 'Classes...'.
Is something not working or do I just not understand what I am supposed to
do? My classes are all side-by-side in the same package and run fine
without InTrace, thus:

Loaded InTrace Agent.

InTrace Agent listening on port 9123

(ordinary log output follows)
INFO JFoil: mrcl()
INFO JFoil: comset()
etc,etc

------- Log --------------------------------------------------------------
*** Instructions
*** - Select Classes you want to Trace
*** Full help available on the Help tab


*** Latest Settings Received
[21:30:47.522]:[11]:DEBUG: Class Regex : [MainXFoil, JFoil, ca.rbh.xfoil.JPolar, Foil, ca.rbh.xfoil.Complex, ca.rbh.util.log.Logger]
Exclude Class Regex : []
Tracing Enabled : true
Save Traced Class Files : false

*** Latest Settings Received
*** Latest Settings Received
*** No instrumented classes
*** Latest Settings Received
[21:31:18.675]:[1]:DEBUG: Ignoring class not matching the active include regex: sun.launcher.LauncherHelper
[21:31:18.675]:[1]:DEBUG: Ignoring class not matching the active include regex: sun.misc.URLClassPath$FileLoader$1
[21:31:18.706]:[1]:DEBUG: Ignoring class not matching the active include regex: ca.rbh.util.log.SystemOutLogger
[21:31:18.706]:[1]:DEBUG: Ignoring class not matching the active include regex: java.lang.VerifyError
[21:32:28.476]:[1]:DEBUG: Ignoring class not matching the active include regex: java.lang.Throwable$WrappedPrintStream
[21:32:28.476]:[1]:DEBUG: Ignoring class not matching the active include regex: java.lang.Throwable$PrintStreamOrWriter
[21:32:28.476]:[1]:DEBUG: Ignoring class not matching the active include regex: java.util.IdentityHashMap$KeySet
[21:32:28.476]:[17]:DEBUG: Ignoring class not matching the active include regex: java.util.IdentityHashMap$KeyIterator
[21:32:28.476]:[17]:DEBUG: Ignoring class not matching the active include regex: java.util.IdentityHashMap$IdentityHashMapIterator
then crash..
---------- Console ---------------------------------------

Loaded InTrace Agent.

InTrace Agent listening on port 9123

Loaded InTrace Agent.

Establishing Callback Connection...

Unable to listen on port: 9123

InTrace Agent listening on port 9124

Program Paused

Exception in thread "main" java.lang.VerifyError: Expecting a stack map frame in method ca.rbh.xfoil.MainXFoil.analysisAlphaRe(Lca/rbh/xfoil/Conditions;Lca/rbh/xfoil/Foil;Lca/rbh/xfoil/JFoil;)V at offset 121
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

@mchr3k
Copy link
Owner

mchr3k commented Feb 20, 2013

The exception stack trace suggests that InTrace has hit an error trying to instrument one of your classes. I have not tested InTrace with JDK7 so I am initially marking this as a JDK7 bug.

@eostermueller
Copy link
Contributor

This VerifyError is a showstopper for me....see stacktrace below.
You can reproduce the problem using the spring boot war file I've created here:

https://github.com/eostermueller/perfSandbox

The older Release_30 intrace-agent.jar file also has lots of problems with spring boot.
One likely problem is spring boot's heavy reliance on annotations, which intrace's ASM 3.x does not support.

So Martin, any chance you could upgrade intrace to support ASM 5.1?
It might be a coincidence, but this ASM history shows a fix of a VerifyError: http://asm.ow2.org/history.html

Exception [null] instrumenting [javax.servlet.http.HttpServlet]
java.lang.VerifyError
        at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
        at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
        at org.intrace.agent.ClassTransformer.instrumentKlasses(ClassTransformer.java:729)
        at org.intrace.agent.ClassTransformer.getResponse(ClassTransformer.java:583)
        at org.intrace.agent.server.AgentClientConnection.runMethod(AgentClientConnection.java:118)
        at org.intrace.output.InstruRunnable.run(InstruRunnable.java:18)
        at java.lang.Thread.run(Thread.java:745)

@eostermueller
Copy link
Contributor

...forgot to mention that I got the above with branch iss37 on top of the very new/fresh pr #40 (thanks for that Martin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants