Enigma icon indicating copy to clipboard operation
Enigma copied to clipboard

Some classes and methods do not decompile

Open NeunEinser opened this issue 5 years ago • 15 comments

Maybe someone wants to look into some of these.

java 8 and java 11:

net.minecraft.client.font.FontManager$1.apply(Ljava.util.Map;Lnet.minecraft.resource.ResourceManager;Lnet.minecraft.util.profiler.Profiler;)V
net.minecraft.client.font.FontManager.getTextRenderer(Lnet.minecraft.util.Identifier;)Lnet.minecraft.client.font.TextRenderer;
net.minecraft.client.render.model.ModelLoader.loadModel(Lnet.minecraft.util.Identifier;)V
net.minecraft.client.render.model.ModelLoader.<clinit>()V
net.minecraft.client.resource.ClientResourcePackCreator
net.minecraft.command.EntitySelectorOptions.register()V
net.minecraft.data.server.AdvancementsProvider.run(Lnet.minecraft.data.DataCache;)V
net.minecraft.data.server.LootTablesProvider.run(Lnet.minecraft.data.DataCache;)V
net.minecraft.data.server.RecipesProvider.run(Lnet.minecraft.data.DataCache;)V
net.minecraft.datafixers.fixes.FixChoiceTypes.a(Ljava.lang.String;Lcom.mojang.datafixers.types.templates.TaggedCoice.TaggedCoiceType;Lcom.mojang.datafixers.types.templates.TaggedCoice.TaggedCoiceType;)Lcom.mojang.datafixers.TypeRewriteRule;
net.minecraft.datafixers.fixes.LeavesFix
net.minecraft.datafixers.fixes.SwimStatsRenameFix
net.minecraft.entity.LivingEntity
net.minecraft.server.command.ScheduleCommand.execute(Lnet.minecraft.server.command.ServerCommandSource;Lcom.mojang.datafixers.util.Either;I)I
net.minecraft.server.world.ThreadedAnvilChunkStorage
net.minecraft.util.registry.Registry.<clinit>()V
net.minecraft.village.PointOfInterestType.setup(Lnet.minecraft.village.PointOfInterestType;)Lnet.minecraft.village.PointOfInterestType;
net.minecraft.world.gen.decorator.CountChanceHeightmapDoubleDecorator
net.minecraft.world.gen.decorator.CountHeightmap32Decorator
net.minecraft.world.gen.decorator.CountHeightmapDoubleDecorator
net.minecraft.world.gen.decorator.NoiseHeightmap32Decorator
net.minecraft.world.gen.decorator.NoiseHeightmapDoubleDecorator
net.minecraft.world.loot.condition.BlockStatePropertyLootCondition.Factory.fromJson(Lcom.google.hson.JsonObject;Lcom.google.hson.JsonDeserializationContext;)Lnet.minecraft.world.loot.condition.BlockStatePropertyLootCondition;
net.minecraft.world.storage.SerializingRegionBasedStorage.a(Lnet.minecraft.world.chunk.ChunkPos;Lcom.mojang.datafixers.types.DynamicOps;Ljava.lang.Object;)V

java 11 only:

net.minecraft.client.audio.AlUtil
net.minecraft.client.audio.AudioStream
net.minecraft.client.audio.OggAudioStream
net.minecraft.client.audio.SoundEngine.init()V
net.minecraft.client.audio.SoundEngine.e()I
net.minecraft.client.audio.SoundEngine.openDevice()J
net.minecraft.client.audio.SoundLoader.loadStatic(Lnet.minecraft.util.Identifier;)Ljava.util.concurrent.CompletableFuture;
net.minecraft.client.audio.Source
net.minecraft.client.audio.StaticSound
net.minecraft.server.dedicated.DedicatedServerWatchdog.run()V
net.minecraft.server.dedicated.MinecraftDedicatedServer
net.minecraft.server.dedicated.gui.DedicatedServerGui
net.minecraft.server.dedicated.gui.PlayerListGui
net.minecraft.server.dedicated.gui.PlayerStatsGui
net.minecraft.util.SystemUtil.getJVMFlags()Ljava.util.stream.Stream;

NeunEinser avatar May 02 '19 12:05 NeunEinser

Is this as of 1.14?

liach avatar May 02 '19 14:05 liach

Yes

NeunEinser avatar May 02 '19 14:05 NeunEinser

How did you get this, these work for me...

Runemoro avatar May 02 '19 23:05 Runemoro

The error on LivingEntity and ClientResourcePackCreator is a stack overflow, looping on these 5 lines:

	at com.strobel.decompiler.languages.java.ast.transforms.InsertNecessaryConversionsTransform.visitReturnStatement(InsertNecessaryConversionsTransform.java:37)
	at com.strobel.decompiler.languages.java.ast.ReturnStatement.acceptVisitor(ReturnStatement.java:57)
	at com.strobel.decompiler.languages.java.ast.transforms.InsertNecessaryConversionsTransform.recurse(InsertNecessaryConversionsTransform.java:576)
	at com.strobel.decompiler.languages.java.ast.transforms.InsertNecessaryConversionsTransform.addCastForAssignment(InsertNecessaryConversionsTransform.java:336)
	at com.strobel.decompiler.languages.java.ast.transforms.InsertNecessaryConversionsTransform.visitReturnStatement(InsertNecessaryConversionsTransform.java:222)

SimpleTickScheduler is fine in my testing. Others are not tested yet.

liach avatar May 03 '19 11:05 liach

The error on LivingEntity and ClientResourcePackCreator is a stack overflow, looping on these 5 lines:

For me it's just freezing with no exception. Are you sure it's a stack overflow exception and not just a long stack trace with some other exception?

SimpleTickScheduler is fine in my testing. Others are not tested yet.

I tried a few of the other classes in the list, and they work fine for me too. And there are also a few classes (ex. ThreadedAnvilChunkStorage) which don't decompile and are not on the list. Not sure how @NeunEinser made that list.

Runemoro avatar May 03 '19 13:05 Runemoro

Fyi I grabbed that log from the dev env of enigma.

liach avatar May 03 '19 13:05 liach

How did you get this, these work for me...

It was a manual process. None of them work for me. Note that some are just methods and not the entire class.

AIUtil for example:

java.lang.IllegalStateException: Invalid BootstrapMethods attribute entry: 2 additional arguments required for method java/lang/invoke/StringConcatFactory.makeConcatWithConstants, but only 1 specified.
	at com.strobel.assembler.ir.Error.invalidBootstrapMethodEntry(Error.java:244)
	at com.strobel.assembler.ir.MetadataReader.readAttributeCore(MetadataReader.java:267)
	at com.strobel.assembler.metadata.ClassFileReader.readAttributeCore(ClassFileReader.java:261)
	at com.strobel.assembler.ir.MetadataReader.inflateAttributes(MetadataReader.java:426)
	at com.strobel.assembler.metadata.ClassFileReader.visitAttributes(ClassFileReader.java:1134)
	at com.strobel.assembler.metadata.ClassFileReader.readClass(ClassFileReader.java:439)
	at com.strobel.assembler.metadata.ClassFileReader.readClass(ClassFileReader.java:377)
	at com.strobel.assembler.metadata.MetadataSystem.resolveType(MetadataSystem.java:129)
	at cuchaz.enigma.Deobfuscator$NoRetryMetadataSystem.resolveType(Deobfuscator.java:418)
	at com.strobel.assembler.metadata.MetadataSystem.resolveCore(MetadataSystem.java:81)
	at com.strobel.assembler.metadata.MetadataResolver.resolve(MetadataResolver.java:104)
	at cuchaz.enigma.Deobfuscator$NoRetryMetadataSystem.resolve(Deobfuscator.java:429)
	at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedType.resolve(CoreMetadataFactory.java:616)
	at com.strobel.assembler.metadata.MetadataResolver.resolve(MetadataResolver.java:91)
	at cuchaz.enigma.Deobfuscator$NoRetryMetadataSystem.resolve(Deobfuscator.java:429)
	at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedType.resolve(CoreMetadataFactory.java:616)
	at com.strobel.assembler.metadata.ClassFileReader.populateNamedInnerTypes(ClassFileReader.java:698)
	at com.strobel.assembler.metadata.ClassFileReader.readClass(ClassFileReader.java:442)
	at com.strobel.assembler.metadata.ClassFileReader.readClass(ClassFileReader.java:377)
	at com.strobel.assembler.metadata.MetadataSystem.resolveType(MetadataSystem.java:129)
	at cuchaz.enigma.Deobfuscator$NoRetryMetadataSystem.resolveType(Deobfuscator.java:418)
	at com.strobel.assembler.metadata.MetadataSystem.lookupTypeCore(MetadataSystem.java:86)
	at com.strobel.assembler.metadata.MetadataResolver.lookupType(MetadataResolver.java:46)
	at cuchaz.enigma.SourceProvider.getSources(SourceProvider.java:51)
	at cuchaz.enigma.gui.GuiController.decompileSource(GuiController.java:347)
	at cuchaz.enigma.gui.GuiController.lambda$loadClass$7(GuiController.java:333)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

NeunEinser avatar May 03 '19 15:05 NeunEinser

java.lang.IllegalStateException: Invalid BootstrapMethods attribute entry: 2 additional arguments required for method java/lang/invoke/StringConcatFactory.makeConcatWithConstants, but only 1 specified.

I'm not getting this at all. What version of Java are you using? I'm guessing you're using Java 9+ since makeConcatWithConstants doesn't exist on Java 8, and that somehow breaks Procyon.

Runemoro avatar May 03 '19 15:05 Runemoro

SimpleTickScheduler is fine in my testing. Others are not tested yet.

Sorry, this one was supposed to be ThreadedAnvilChunkStorage, which is the one underneath

NeunEinser avatar May 03 '19 15:05 NeunEinser

I'm not getting this at all. What version of Java are you using? I'm guessing you're using Java 9+ since makeConcatWithConstants doesn't exist on Java 8, and that somehow breaks Procyon.

java 11.0.2 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

I can try switching to java 8, if you think that helps. But as java 11 is long time support as well, it should be supported.

NeunEinser avatar May 03 '19 15:05 NeunEinser

Yes, so the problem for most of these seems to be that Procyon is incompatible with Java 9+.

Runemoro avatar May 03 '19 15:05 Runemoro

I updated the post now and split them up into 2 categories. Unfortunately, most of them actually are not caused by java 11.

Also, I double checked that no further mistakes like that one have happened:

SimpleTickScheduler is fine in my testing. Others are not tested yet.

Sorry, this one was supposed to be ThreadedAnvilChunkStorage, which is the one underneath

NeunEinser avatar May 03 '19 15:05 NeunEinser

As of https://github.com/FabricMC/Enigma/commit/574c99db3a665f043886e102eec86e5403dfcc9f, the stackoverflow errors should no longer be swallowed by Enigma and instead displayed.

Gegy avatar May 06 '19 16:05 Gegy

StackOverflowErrors still happen while decompiling. I tried using a big value for -Xss and some bugged classes decompiled fine but several are still not decompiled correctly. The error is exactly the same as mentionned above.

Iltotore avatar Jan 13 '20 19:01 Iltotore

https://github.com/mstrobel/procyon/issues/2 (The snippet also has the stack overflow error, after you silence the classcastexception)

natanfudge avatar Jan 13 '20 19:01 natanfudge

Upstream has been fixed recently, also this is more of a decompiler issue rather than an Enigma issue, so I suppose this can be closed

NebelNidas avatar Sep 21 '22 21:09 NebelNidas