[diffoscope] diffoscope (JVM bytecode) is not supported for Java 21

Aman Sharma amansha at kth.se
Wed Jul 24 17:57:39 UTC 2024


Hi all,


I have been using diffoscope to diff between Java classfiles. However, it seems to be unsupported for JDK >= 21 because procyon fails to decompile the code. As a fallback, diffoscope then shows the diff between hexdumps.

With JDK 17, diffoscope either shows the diff between the disassembled output or decompiled output (side question, how does it decide between the two?).


Details to reproduce the issue.


```

java --version

>>> openjdk 21.0.2


diffoscope --version

>>> diffoscope 272

diffoscope A45305b1a-3bdc-455f-b22d-96636743c129.class A4e6577e8-d1ee-4acd-b38f-1dcd68658a48.class
>>>
--- A45305b1a-3bdc-455f-b22d-96636743c129.class
+++ A4e6577e8-d1ee-4acd-b38f-1dcd68658a48.class
│┄ Command `'procyon -ec {}'` failed with exit code 1. Standard output:
│┄     Exception in thread "main" java.lang.reflect.GenericSignatureFormatError
│┄      at com.strobel.assembler.metadata.signatures.SignatureParser.error(SignatureParser.java:70)
│┄      at com.strobel.assembler.metadata.signatures.Signatur  [...]
@@ -1,22 +1,22 @@
 00000000: cafe babe 0000 0037 000e 0100 6069 6f2f  .......7....`io/
 00000010: 6472 6f70 7769 7a61 7264 2f6a 6572 7365  dropwizard/jerse
 00000020: 792f 4472 6f70 7769 7a61 7264 5265 736f  y/DropwizardReso
 00000030: 7572 6365 436f 6e66 6967 2453 7065 6369  urceConfig$Speci
-00000040: 6669 6342 696e 6465 7265 3735 6461 3661  ficBindere75da6a
-00000050: 632d 3332 3031 2d34 3037 332d 6264 3466  c-3201-4073-bd4f
-00000060: 2d37 3536 3832 6337 3631 3836 3207 0001  -75682c761862...
+00000040: 6669 6342 696e 6465 7231 6437 3137 3235  ficBinder1d71725
+00000050: 382d 6132 3334 2d34 3332 322d 6161 3866  8-a234-4322-aa8f
+00000060: 2d31 3637 6163 3434 3534 3434 3307 0001  -167ac4454443...
 00000070: 0100 106a 6176 612f 6c61 6e67 2f4f 626a  ...java/lang/Obj
 00000080: 6563 7407 0003 0100 0a53 6f75 7263 6546  ect......SourceF
 00000090: 696c 6501 0050 4472 6f70 7769 7a61 7264  ile..PDropwizard
 000000a0: 5265 736f 7572 6365 436f 6e66 6967 2453  ResourceConfig$S
-000000b0: 7065 6369 6669 6342 696e 6465 7265 3735  pecificBindere75
-000000c0: 6461 3661 632d 3332 3031 2d34 3037 332d  da6ac-3201-4073-
-000000d0: 6264 3466 2d37 3536 3832 6337 3631 3836  bd4f-75682c76186
-000000e0: 322e 6a61 7661 0100 3c69 6f2f 6472 6f70  2.java..<io/drop
+000000b0: 7065 6369 6669 6342 696e 6465 7231 6437  pecificBinder1d7
+000000c0: 3137 3235 382d 6132 3334 2d34 3332 322d  17258-a234-4322-
+000000d0: 6161 3866 2d31 3637 6163 3434 3534 3434  aa8f-167ac445444
+000000e0: 332e 6a61 7661 0100 3c69 6f2f 6472 6f70  3.java..<io/drop
 000000f0: 7769 7a61 7264 2f6a 6572 7365 792f 4472  wizard/jersey/Dr
 00000100: 6f70 7769 7a61 7264 5265 736f 7572 6365  opwizardResource
 00000110: 436f 6e66 6967 2453 7065 6369 6669 6342  Config$SpecificB
 00000120: 696e 6465 7207 0007 0100 063c 696e 6974  inder......<init
 00000130: 3e01 0026 284c 6a61 7661 2f6c 616e 672f  >..&(Ljava/lang/
 00000140: 4f62 6a65 6374 3b4c 6a61 7661 2f6c 616e  Object;Ljava/lan
 00000150: 672f 436c 6173 733b 2956 0c00 0900 0a0a  g/Class;)V......


```


Regards,
Aman Sharma

PhD Student
KTH Royal Institute of Technology
School of Electrical Engineering and Computer Science (EECS)
Department of Theoretical Computer Science (TCS)
<http://www.kth.se><https://www.kth.se/profile/amansha><https://www.kth.se/profile/amansha>
<https://www.kth.se/profile/amansha>https://algomaster99.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/diffoscope/attachments/20240724/f47ffe4e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A45305b1a-3bdc-455f-b22d-96636743c129.class
Type: application/java-vm
Size: 418 bytes
Desc: A45305b1a-3bdc-455f-b22d-96636743c129.class
URL: <http://lists.reproducible-builds.org/pipermail/diffoscope/attachments/20240724/f47ffe4e/attachment.class>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A4e6577e8-d1ee-4acd-b38f-1dcd68658a48.class
Type: application/java-vm
Size: 418 bytes
Desc: A4e6577e8-d1ee-4acd-b38f-1dcd68658a48.class
URL: <http://lists.reproducible-builds.org/pipermail/diffoscope/attachments/20240724/f47ffe4e/attachment-0001.class>


More information about the diffoscope mailing list