Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-405

Duplicate rule name causes FATAL ERROR

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 4.0.13
    • None
    • Hide

       Compile the sample app. Run it using a javaagent attached.
       

      $ git clone https://gitlab.com/whitingjr/byteman-native-call-reproducer
      
      $ cd byteman-native-call-reproducer
      $ javac src/main/java/org/jboss/perf/reproducer/byteman/duplicaterulename/App.java
      
      $ export BYTEMAN_HOME=  to a valid byteman install
      
      $ java -javaagent:${BYTEMAN_HOME}/lib/byteman.jar=listener:true,boot:${BYTEMAN_HOME}/lib/byteman.jar,script:src/main/resources/SwitchObjectStoreImpl.btm -cp src/main/java/ org.jboss.perf.reproducer.byteman.duplicaterulename.App
      

       

       

      Show
       Compile the sample app. Run it using a javaagent attached.   $ git clone https://gitlab.com/whitingjr/byteman-native-call-reproducer $ cd byteman-native-call-reproducer $ javac src/main/java/org/jboss/perf/reproducer/byteman/duplicaterulename/App.java $ export BYTEMAN_HOME= to a valid byteman install $ java -javaagent:${BYTEMAN_HOME}/lib/byteman.jar=listener:true,boot:${BYTEMAN_HOME}/lib/byteman.jar,script:src/main/resources/SwitchObjectStoreImpl.btm -cp src/main/java/ org.jboss.perf.reproducer.byteman.duplicaterulename.App    
    • Undefined

       I found loading a script using either javaagent or bmsubmit tool causes the JVM to have a fatal error and exit. The script defines two rules with an identical rule name.

       The cause is purely a user error but should not necessarily cause the JVM stop.

      Exception in thread "main" java.lang.reflect.InvocationTargetException
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
       at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
       at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
      Caused by: java.lang.reflect.InvocationTargetException
       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
       at org.jboss.byteman.agent.Main.premain(Main.java:271)
       ... 6 more
      Caused by: java.lang.Exception: Transformer : duplicate script name Switch store implementation to use VolatileStorein file src/main/resources/SwitchObjectStoreImpl.btm line 13
       previously defined in file src/main/resources/SwitchObjectStoreImpl.btm line 5
       at org.jboss.byteman.agent.Transformer.<init>(Transformer.java:96)
       at org.jboss.byteman.agent.Retransformer.<init>(Retransformer.java:60)
       ... 11 more
      *** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
      FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
      Aborted (core dumped)

        1. App.java
          0.5 kB
        2. SwitchObjectStoreImpl.btm
          0.6 kB

            rhn-engineering-adinn Andrew Dinn
            jwhiting@redhat.com Jeremy Whiting
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: