Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with java agent on Mohist 1.18.2 to 1.20.1 #70

Open
JulianVennen opened this issue Aug 12, 2023 · 5 comments
Open

Crash with java agent on Mohist 1.18.2 to 1.20.1 #70

JulianVennen opened this issue Aug 12, 2023 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JulianVennen
Copy link

When trying to use serialization is bad as a java agent on a Mohist server with any version starting at 1.18.2 the server crashes with the message java.lang.reflect.InaccessibleObjectException: Unable to make field static final java.lang.invoke.MethodHandles$Lookup java.lang.invoke.MethodHandles$Lookup.IMPL_LOOKUP accessible: module java.base does not "opens java.lang.invoke" to unnamed module @6591f517.

Here's a log from a Mohist 1.20.1 server with this issue: https://mclo.gs/o4nssB6

@dogboy21
Copy link
Owner

Which command are you using to start the server?

@JulianVennen
Copy link
Author

java -javaagent:/aternos/other/serializationisbad.jar -jar server.jar

@dogboy21 dogboy21 added the bug Something isn't working label Aug 14, 2023
@dogboy21
Copy link
Owner

Could you please try adding --add-opens java.base/java.lang.invoke=cpw.mods.securejarhandler to the launch arguments before the -jar argument?

@JulianVennen
Copy link
Author

It says WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens with the same error following it: https://mclo.gs/soEugHB

This might also be a problem with Mohist

@dogboy21
Copy link
Owner

dogboy21 commented Aug 14, 2023

I'm not really sure what's causing this issue at the moment, but I saw similar behavior when using MultiMC.

It appears to be some incompatibility with wrappers around the Forge ModLauncher (MultiMC uses ForgeWrapper and Mohist itself also wraps ModLauncher).
But (at least to my knowledge) I'm not messing with any internals of ML that could cause this issue.

I will take a look at that again, maybe I overlooked something.
(Or maybe someone reading this has an idea?)

In the meantime you could just try to run SiB as a coremod instead of as an agent.

@dogboy21 dogboy21 added the help wanted Extra attention is needed label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants