soot-oss / SootUp

A new version of Soot with a completely overhauled architecture
https://soot-oss.github.io/SootUp/
GNU Lesser General Public License v2.1
580 stars 77 forks source link

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

Closed slimming-fat closed 3 months ago

slimming-fat commented 1 year ago

Error retrieving method body image

jpstotz commented 1 year ago

@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.

JonasKlauke commented 1 year ago

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.

slimming-fat commented 1 year ago

@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)
SoniaZaldana commented 1 year ago

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

swissiety commented 1 year ago

possibly the same underlying error as #666

swissiety commented 11 months ago

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

swissiety commented 3 months ago

stale - probably fixed by #666