1 Reply Latest reply on Jun 8, 2016 11:44 AM by Andrew Dinn

    Is it possible to use Byteman on Java 1.6.0_45-b06?

    Taylor Marks Newbie

      I'm trying to run Byteman on an old project that has to use Java 6. I was under the impression that this would work, but it looks like there's a bug with how java agents work that actually prevents byteman from running on 1.6.0_45 (the last publically released version of Java 6.)

       

      Here's how I'm trying to launch my program with Byteman (line breaks added to hopefully make it easier to read):

       

      > java

      -Xmx256m

      -Dsun.java2d.noddraw

      -Dsun.java2d.ddoffscreen=false

      -Dsun.java2d.d3d=false

      -Dsun.rmi.client.logCalls=true

      -Dsun.rmi.transport.tcp.logLevel=Verbose

      -Dorg.jboss.byteman.transform.all

      -javaagent:/byteman-3.0.3/lib/byteman.jar=script:/Apps/byteman.btm,

      boot:/byteman-3.0.3/lib/byteman.jar,

      listener:true

      com.tecinno.orenge.tools.OrengeRMIServiceClient

       

      It outputs this error message ~20 times:

       

       

      *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at ../../../src/share/instrument/JPLISAgent.c line:806


      Then the output ends with this:

      java.lang.NoClassDefFoundError

      - klass: 'java/lang/NoClassDefFoundError'

      #

      # A fatal error has been detected by the Java Runtime Environment:

      #

      #  Internal Error (exceptions.cpp:397), pid=2600, tid=2268

      #  fatal error: ExceptionMark destructor expects no pending exceptions

      #

      # JRE version: 6.0_45-b06

      # Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode windows-x86 )

      # An error report file with more information is saved as:

      # D:\Apps\IAS_6.4\Orengebox\Shared\Common\hs_err_pid2600.log

      #

      # If you would like to submit a bug report, please visit:

      #   http://java.sun.com/webapps/bugreport/crash.jsp

      #


      Is this something that can be fixed without changing the JVM we're using? If the only option is to change JVM, which ones could we switch to?

        • 1. Re: Is it possible to use Byteman on Java 1.6.0_45-b06?
          Andrew Dinn Master

          Hi Taylor,

           

          Yes, as far as I know this ought to work. I can't really identify exactly what is going wrong here as you are using Oracles's JVM (so it seems) and I only have sources for the icedtea6 release builds which are currently based on release b39. However, there ought not to be any signiifcant difference in how they are implemented.

           

          The error itself is not very informative since it merely indicates that something went wrong during the attempt to transform the class bytes for a given class i..e below the point where the JVMTI code invokes the agent. The error get sprinted when control returns to the  JVMTI layer and it notices that an exception occurred. I have no reason to expect such an error so it might be useful to try to find out more info. There are two things you could do to help pin down what is going wrong.

           

          Firstly, assuming it will not compromise the privacy of your app, could you show me the rules that are being loaded at startup. If that is not an option then could you try to make up some rules which manifest the same failure and then post those rules

           

          Secondly, could you run with -Dorg.jboss.byteman.verbose added on the command line and show me any output that Byteman prints to the command line as a result of setting that property. If Byteman does produce some output then I may also need you to try to collect any transformed bytecode generated by Byteman but we'll negotiate that if and when we see what trace output is generated.

           

          Meanwhile, I'll do some experiments see if I can generate a similar error. Thanks very much for reporting this issue and for any further info you can provide.

           

          regards,

           

           

          Andrew Dinn