VerifyError when binding thread.getId() and compileToBytecode
willreichert Mar 4, 2013 2:23 PMHI All:
I noticed the byteman scripts on my server were not logging when using compileToBytecode in the benchmark environment and created a local test to troubleshoot. The local environment simply logs the threadId on method entry but I see a java.lang.VerifyError whenever I try and BIND Thread.currentThread().getId() while also using compileToBytecode. The Byteman script is the following:
RULE perf.byteman.runner.RunByteman.foo_entry CLASS perf.byteman.runner.RunByteman METHOD foo AT ENTRY BIND threadId = ""+Thread.currentThread().getId(); threadName = Thread.currentThread().getName(); IF TRUE DO openTrace("schedule","/home/wreicher/foo.stacks.log"); traceln("schedule"," threadId="+threadId); ENDRULE
and I am using the following JVM arguments:
-javaagent:/home/wreicher/tools/byteman/byteman-download-2.1.2/lib/byteman.jar=listener:true,port:9876,script:/home/wreicher/tools/byteman/fooStack.btm,boot:/home/wreicher/tools/byteman/byteman-download-2.1.2/lib/byteman.jar -Dorg.jboss.byteman.transform.all -Dorg.jboss.byteman.compileToBytecode
The console log from running my simple test is the following:
Installed rule using default helper : perf.byteman.runner.RunByteman.foo_entry perf.byteman.runner.RunByteman.foo_entry : java.lang.VerifyError: (class: org/jboss/byteman/rule/helper/Helper_HelperAdapter_Compiled_1, method: execute0 signature: ()V) Stack size too large Exception in thread "main" org.jboss.byteman.rule.exception.ExecuteException: perf.byteman.runner.RunByteman.foo_entry : caught java.lang.VerifyError: (class: org/jboss/byteman/rule/helper/Helper_HelperAdapter_Compiled_1, method: execute0 signature: ()V) Stack size too large at org.jboss.byteman.rule.Rule.execute(Rule.java:714) at org.jboss.byteman.rule.Rule.execute(Rule.java:651) at perf.byteman.runner.RunByteman.foo(RunByteman.java) at perf.byteman.runner.RunByteman.main(RunByteman.java:46) Caused by: java.lang.VerifyError: (class: org/jboss/byteman/rule/helper/Helper_HelperAdapter_Compiled_1, method: execute0 signature: ()V) Stack size too large at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413) at java.lang.Class.getConstructor0(Class.java:2723) at java.lang.Class.getConstructor(Class.java:1676) at org.jboss.byteman.rule.Rule.execute(Rule.java:678) ... 3 more
The simple same is just a main method that calls foo so I doubt there is much to be seen there but if needed I wil include it as well
Please let me know if there is any other information I should be trying to collect or if you have an idea why I am seeing the VerifyError in my local test and why the benchmark test is simply not creating the log file.
--Will