SootUp icon indicating copy to clipboard operation
SootUp copied to clipboard

Invokedynamic: Error: Not dummy Operand from SootMethod.getBody()

Open slimming-fat opened this issue 1 year ago • 6 comments

Error retrieving method body image

slimming-fat avatar Apr 03 '23 12:04 slimming-fat

@Jacky-code519 It would be really nice of you not posting stack traces as image. IntelliJ and Eclipse have such a nice function to parse stacktraces and make them clickable to the code references, but with images this is impossible.

jpstotz avatar Apr 03 '23 12:04 jpstotz

Yeah some additonal information would be nice. Are you using the released version or the current dev snapshot?

can you send the bytecode which caused this issue? I can only guess that the InvokeDynamicInstruction in the method causes a problem.

JonasKlauke avatar Apr 03 '23 13:04 JonasKlauke

@jpstotz @JonasKlauke

Yeah some additonal information would be nice. Are you using the released version or the current dev snapshot?

can you send the bytecode which caused this issue? I can only guess that the InvokeDynamicInstruction in the method causes a problem.

I'm using the released version Interllij's debug results in the following image

The bytecode is as follows:

public static skipUntilByteCount(Lorg/reactivestreams/Publisher;J)Lreactor/core/publisher/Flux;
   L0
    LINENUMBER 450 L0
    ALOAD 0
    LDC "Publisher must not be null"
    INVOKESTATIC org/springframework/util/Assert.notNull (Ljava/lang/Object;Ljava/lang/String;)V
   L1
    LINENUMBER 451 L1
    LLOAD 1
    LCONST_0
    LCMP
    IFLT L2
    ICONST_1
    GOTO L3
   L2
   FRAME SAME
    ICONST_0
   L3
   FRAME SAME1 I
    LDC "'maxByteCount' must be a positive number"
    INVOKESTATIC org/springframework/util/Assert.isTrue (ZLjava/lang/String;)V
   L4
    LINENUMBER 453 L4
    LLOAD 1
    ALOAD 0
    INVOKEDYNAMIC get(JLorg/reactivestreams/Publisher;)Ljava/util/function/Supplier;
[
      // handle kind 0x6 : INVOKESTATIC
      java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
      // arguments:
      ()Ljava/lang/Object;, 
      // handle kind 0x6 : INVOKESTATIC
      org/springframework/core/io/buffer/DataBufferUtils.lambda$skipUntilByteCount$16(JLorg/reactivestreams/Publisher;)Lorg/reactivestreams/Publisher;, 
      ()Lorg/reactivestreams/Publisher;
    ]
    INVOKESTATIC reactor/core/publisher/Flux.defer (Ljava/util/function/Supplier;)Lreactor/core/publisher/Flux;
    LDC Lorg/springframework/core/io/buffer/PooledDataBuffer;.class
    INVOKEDYNAMIC accept()Ljava/util/function/Consumer;
[
      // handle kind 0x6 : INVOKESTATIC
      java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
      // arguments:
      (Ljava/lang/Object;)V, 
      // handle kind 0x6 : INVOKESTATIC
      org/springframework/core/io/buffer/DataBufferUtils.release(Lorg/springframework/core/io/buffer/DataBuffer;)Z, 
      (Lorg/springframework/core/io/buffer/PooledDataBuffer;)V
    ]
   L5
    LINENUMBER 472 L5
    INVOKEVIRTUAL reactor/core/publisher/Flux.doOnDiscard (Ljava/lang/Class;Ljava/util/function/Consumer;)Lreactor/core/publisher/Flux;
   L6
    LINENUMBER 453 L6
    ARETURN
   L7
    LOCALVARIABLE publisher Lorg/reactivestreams/Publisher; L0 L7 0
    // signature Lorg/reactivestreams/Publisher<+Lorg/springframework/core/io/buffer/DataBuffer;>;
    // declaration: publisher extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>
    LOCALVARIABLE maxByteCount J L0 L7 1
    MAXSTACK = 4
    MAXLOCALS = 3

  // access flags 0x9
  // signature <T::Lorg/springframework/core/io/buffer/DataBuffer;>(TT;)TT;
  // declaration: T retain<T extends org.springframework.core.io.buffer.DataBuffer>(T)

slimming-fat avatar Apr 04 '23 01:04 slimming-fat

are there any updates on this issue? I'm also seeing failures with invoke dynamic instructions in resolving method bodies.

SoniaZaldana avatar May 04 '23 19:05 SoniaZaldana

possibly the same underlying error as #666

swissiety avatar Aug 30 '23 09:08 swissiety

#666 is merged - @slimming-fat does the error still occur with the current develop branch as dependency?

swissiety avatar Nov 02 '23 17:11 swissiety

stale - probably fixed by #666

swissiety avatar Jul 05 '24 15:07 swissiety