Skip to content
This repository has been archived by the owner. It is now read-only.

INVOKESPECIAL/STATIC on interfaces require ASM 5 #498

Open
edmand46 opened this issue Aug 22, 2016 · 35 comments
Open

INVOKESPECIAL/STATIC on interfaces require ASM 5 #498

edmand46 opened this issue Aug 22, 2016 · 35 comments

Comments

@edmand46
Copy link

@edmand46 edmand46 commented Aug 22, 2016

Server Log: http://pastebin.com/mPZ1AvyU
Explanation of issue:
INVOKESPECIAL/STATIC on interfaces require ASM 5,but i have installed ASM 5,

Screenshot

How to recreate this issue: Just install MythicMobs plugin v2.4.5
Thermos Version: 1.7.10-1614.57

@spannerman79
Copy link
Contributor

@spannerman79 spannerman79 commented Aug 22, 2016

http://mythicmobs.net/manual/doku.php/changelog#section241

Something changed with MythicMobs between v2.4.1 -> v2.4.5

Did you discuss this with the MythicMobs's dev/s?

@Brend-Smits
Copy link

@Brend-Smits Brend-Smits commented Aug 22, 2016

Have you tried using a lower version of Mythic mobs?
Maybe they work, please do report back. I've always had trouble with Mythic mobs and Thermos as well.

@Time6628
Copy link
Member

@Time6628 Time6628 commented Aug 22, 2016

v2.4.5 is for 1.9. Thermos is for 1.7.10. I don't think those numbers match 🐱

@Brend-Smits
Copy link

@Brend-Smits Brend-Smits commented Aug 22, 2016

2.4.5 is not just for 1.9.
It support 1.9 - 1.7 as far as I know.
2.4.5 works on Spigot just fine.

@edmand46
Copy link
Author

@edmand46 edmand46 commented Aug 22, 2016

spannerman79 yes i am say MythicMobs`s devs
Link: http://www.mythicmobs.net/index.php?threads/unhandled-exception-executing-command-mm.2234/

Also i now try use 2.4.1-2.4.4, and error on start:
http://pastebin.com/sE8N7Twt

v2.4.5 started, but crashed on command /mm mobs
http://pastebin.com/aUWeV4mk

Have you tried using a lower version of Mythic mobs?

Yes 2.3.0, worked, but docs irrelevant and mobs can`t drop mod items, I would like fresher, maybe it fixed.

v2.4.5 is for 1.9. Thermos is for 1.7.10. I don't think those numbers match

v2.4.5 for 1.7.10 should also work.

@sameer
Copy link
Member

@sameer sameer commented Aug 22, 2016

It shouldn't work. We don't have asm 5 if I remember correctly.

@sameer
Copy link
Member

@sameer sameer commented Aug 22, 2016

(You can't install asm 5 it has to be added as a library, which means getting rid of the older one)

@edmand46
Copy link
Author

@edmand46 edmand46 commented Aug 22, 2016

Loaded ASM 5.1 - from logs [asm-all-5.0.3.jar:5.1]

@sameer
Copy link
Member

@sameer sameer commented Aug 22, 2016

Seems this issue has to do with java 8 compatibility...

@edmand46
Copy link
Author

@edmand46 edmand46 commented Aug 22, 2016

What need to Fix? Plugin, Thermos?

@Brend-Smits
Copy link

@Brend-Smits Brend-Smits commented Aug 22, 2016

Plugin is not at fault, it works fine on vanilla spigot.

@ghost
Copy link

@ghost ghost commented Aug 22, 2016

I just ran this plugin and had no issues in a test environment. But I'm using Java U102.

@Brend-Smits
Copy link

@Brend-Smits Brend-Smits commented Aug 22, 2016

@iKaneki-Ken Thermos 57 + 2.4.5 MM ?
Did you execute the /mm command?

@kalek3
Copy link

@kalek3 kalek3 commented Aug 23, 2016

Please ROBOTIA give the solution !!

@sameer
Copy link
Member

@sameer sameer commented Aug 23, 2016

I'm not sure what the solution is, but the problem is all over Google.

@ghost
Copy link

@ghost ghost commented Aug 24, 2016

@Rubbertjuh Yes I did.

@ghost
Copy link

@ghost ghost commented Aug 24, 2016

@kalek3 A solution to a problem like this can't be given immediately. Time is required when it comes to situations like this as testing is required before implementing a commit. So please, be patient with Robotia.

@kalek3
Copy link

@kalek3 kalek3 commented Aug 24, 2016

All right, but I hope there is a solution !

@sameer
Copy link
Member

@sameer sameer commented Aug 24, 2016

The version 5.0.3 is indeed loaded. I found this old issue where someone had the problem. But MinecraftForge is now on OpCodes.ASM5, so this invokespecial exception should not be happening. 😕
image

All OpCodes are set to ASM 5. They used to be ASM4 a long time ago.
Are you sure you are not using a backport?

@masterfapper72
Copy link

@masterfapper72 masterfapper72 commented Aug 24, 2016

Yes sure, I just download your last thermos version and the last mythicmobs plugin, not more, but it still not working.

@Shevchik
Copy link

@Shevchik Shevchik commented Aug 25, 2016

This has nothing to do with forge transformers. plugins are remapped using specialsource and stacktrace clearly shows that.

And thermos bundles outdated specialsource version that still uses Opcodes.ASM4.

@sameer
Copy link
Member

@sameer sameer commented Aug 25, 2016

Thank you for catching that, I was in a rush when I made my last comment @Shevchik.

I do not think it is safe to update special source in this case though -- it could break compatibility with plugins designed for 1.7.10.

Do you know if upgrading the special source version causes any issues?

@Shevchik
Copy link

@Shevchik Shevchik commented Aug 25, 2016

No idea, closed my modded server long time ago. Maybe it can break everything on update (not just 1.7.10, because all plugins are remapped actually), so just try?

I use specialsource to remap jars in some of my projects and it works.

@kalek3
Copy link

@kalek3 kalek3 commented Aug 25, 2016

I would opt to try !

@spannerman79
Copy link
Contributor

@spannerman79 spannerman79 commented Aug 27, 2016

That update has failed build tests @robotia https://travis-ci.org/CyberdyneCC/Thermos/builds/155127126

@masterfapper72
Copy link

@masterfapper72 masterfapper72 commented Aug 27, 2016

What does it mean?

@Time6628 Time6628 removed the External label Aug 28, 2016
@kalek3
Copy link

@kalek3 kalek3 commented Aug 29, 2016

Why ?

@ghost
Copy link

@ghost ghost commented Aug 29, 2016

warning: [options] bootstrap class path not set in conjunction with -source 1.6
/home/travis/build/CyberdyneCC/Thermos/src/main/java/org/bukkit/craftbukkit/CraftServer.java:163: error: softValues() is not public in MapMaker; cannot be accessed from outside package
    private final Map<UUID, OfflinePlayer> offlinePlayers = new MapMaker().softValues().makeMap();
                                                                          ^
/home/travis/build/CyberdyneCC/Thermos/eclipse/cauldron/src/main/java/net/minecraftforge/oredict/OreDictionary.java:323: error: cannot find symbol
        if (ids != null) set.addAll(ids);
                         ^
  symbol:   variable set
  location: class OreDictionary
/home/travis/build/CyberdyneCC/Thermos/eclipse/cauldron/src/main/java/net/minecraftforge/oredict/OreDictionary.java:325: error: cannot find symbol
        if (ids != null) set.addAll(ids);
                         ^
  symbol:   variable set
  location: class OreDictionary
/home/travis/build/CyberdyneCC/Thermos/eclipse/cauldron/src/main/java/net/minecraftforge/oredict/OreDictionary.java:327: error: cannot find symbol
        Integer[] tmp = set.toArray(new Integer[set.size()]);
                                                ^
  symbol:   variable set
  location: class OreDictionary
/home/travis/build/CyberdyneCC/Thermos/eclipse/cauldron/src/main/java/net/minecraftforge/oredict/OreDictionary.java:327: error: cannot find symbol
        Integer[] tmp = set.toArray(new Integer[set.size()]);
                        ^
  symbol:   variable set
  location: class OreDictionary
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
1 warning
:obfuscateJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cauldron:compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED

That's why.

@masterfapper72
Copy link

@masterfapper72 masterfapper72 commented Aug 29, 2016

Ok, can it be solved?

@KaiKikuchi
Copy link

@KaiKikuchi KaiKikuchi commented Sep 14, 2016

I got the OP exception by simply adding any of the Discord Java Libraries (JDA, Javacord, Discord4J) to a Bukkit plugin and running it on Thermos.

So I decided to do some investigation. I checked all source codes, and honestly I couldn't find anything wrong on Thermos, nor on SpecialSource. The error shouldn't be an error at all. So I've looked into ASM source code. It seems to use ASM5 by default, so everything should work properly. So I just decided to check the actual exception cause. This is the method that throws the exception:

    public void visitMethodInsn(int opcode, String owner, String name,
            String desc, boolean itf) {
        if (api < Opcodes.ASM5) {
            if (itf != (opcode == Opcodes.INVOKEINTERFACE)) {
                throw new IllegalArgumentException(
                        "INVOKESPECIAL/STATIC on interfaces require ASM 5");
            }
            visitMethodInsn(opcode, owner, name, desc);
            return;
        }
        if (mv != null) {
            mv.visitMethodInsn(opcode, owner, name, desc, itf);
        }
    }

I couldn't find what causes the "api" attribute to be assigned to a value lower than Opcodes.ASM5. As specified on a previous post by Robotia, Thermos is using ASM5, I've checked that too.

I run out of time and ideas.

Then I thought, "what if I just suppress the error?"

So I did something that shouldn't be done: bytecode editor and added a little "goto" that skips the exception.

That made both my plugin and MythicMobs work just fine.

I know, this is a wrong thing to do. Please don't punch me! 😲
I just wanted to find a temporary solution that may help fixing the real issue that I can't find yet.

I am not sure if I should post the modified jar and/or give details about the bytecode edit I've done. Let me know.

EDIT: I did some further investigation. I added some debug code to check what is actually using ASM4. I made a log of all stack traces that use ASM4: log.zip

I think SpecialSource is the culprit.

@KaiKikuchi
Copy link

@KaiKikuchi KaiKikuchi commented Sep 14, 2016

The solution is so easy that I wonder why nobody tested it.

The SpecialSource library included with Thermos uses ASM4.
Updating it to the latest version will fix the issue.

This is how I fixed it:

  • Navigate to libraries\net\md-5\SpecialSource\1.7-SNAPSHOT folder
  • Delete the SpecialSource-1.7-SNAPSHOT.jar jar file
  • Download SpecialSource v1.7.4
  • Copy the jar file to the libraries\net\md-5\SpecialSource\1.7-SNAPSHOT folder
  • Rename the jar file you just copied to SpecialSource-1.7-SNAPSHOT.jar

I am using Thermos 1.7.10-1614.56, but I think the fix should be the same or similar for other Thermos versions.

@sameer
Copy link
Member

@sameer sameer commented Sep 14, 2016

Thank you for testing this @KaiKikuchi.

I do not recommend setting this as a default, however. ASM4 is used by mods and plugins that were for 1.7.10, (namely MobiusCore/Opis) and forcing ASM5 could cause problems. 😕

If anyone finds that ASM5 works perfectly with MobiusCore and Opis, please post here.

Thanks!

@KaiKikuchi
Copy link

@KaiKikuchi KaiKikuchi commented Sep 14, 2016

Hey Robotia. Thank you for your reply.

Honestly I don't think that updating SpecialSource will cause issues to other plugins and mods, as I noticed that the current version of ASM supports both ASM4 and ASM5. Also the current version of ASM uses ASM5 by default. And Forge uses ASM5 by default too. Honestly, I don't know how this could affect plugins. Currently, it's not affecting any of the plugins I use.

Anyway, we will still test this and let you know if any issue arises.

@Brend-Smits
Copy link

@Brend-Smits Brend-Smits commented Sep 14, 2016

I can confirm that the fix @KaiKikuchi provided is indeed working. I tested it with MythicMobs and everything was working out like it is suppose to do. Thanks a lot for making this fix Kaikikuchi, I'm sure a lot of people appreciate this a lot!

Just for clarification, I'm running tekkit legends and FTB infinity with both a decent amount of plugins on the server, none of these plugins and mods broke because we upgraded the library.
Thanks again.

Donating to you as we speak as this is something I've wanted for a long time now!

@Eufranio
Copy link

@Eufranio Eufranio commented Oct 1, 2016

Citizens doesn't work with ASM 5 too :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants