makamys / CoreTweaks

A bunch of random bug fixes, optimizations and tweaks (1.7.10)
MIT License
46 stars 5 forks source link

Client Crash (seems to be caused by memory leak) #31

Closed louloumc closed 8 months ago

louloumc commented 8 months ago

Hello, author. After using your mod here, the client will crash after a while. This is my logs.

java.lang.NoClassDefFoundError: makamys/coretweaks/util/GLUtil
    at makamys.coretweaks.tweak.crashhandler.CrashHandler.resetState(CrashHandler.java:40) ~[CrashHandler.class:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:3036) [bao.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:148) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: java.lang.ClassNotFoundException: makamys.coretweaks.util.GLUtil
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:348) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    ... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
    at org.objectweb.asm.ClassReader.readShort(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.<init>(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.<init>(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.findAndMergeSuperMaps(FMLDeobfuscatingRemapper.java:345) ~[forge-1.7.10-10.13.4.1558-1.7.10.jar:?]
    at cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.getMethodMap(FMLDeobfuscatingRemapper.java:322) ~[forge-1.7.10-10.13.4.1558-1.7.10.jar:?]
    at cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.mapMethodName(FMLDeobfuscatingRemapper.java:295) ~[forge-1.7.10-10.13.4.1558-1.7.10.jar:?]
    at org.objectweb.asm.commons.RemappingMethodAdapter.doVisitMethodInsn(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.commons.RemappingMethodAdapter.visitMethodInsn(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.a(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.b(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at cpw.mods.fml.common.asm.transformers.DeobfuscationTransformer.transform(DeobfuscationTransformer.java:37) ~[forge-1.7.10-10.13.4.1558-1.7.10.jar:?]
    at makamys.coretweaks.optimization.transformerproxy.TransformerProxy.invokeNextHandler(TransformerProxy.java:44) ~[4669844567600698124@2@8.jar:?]
    at makamys.coretweaks.optimization.transformercache.lite.CachedTransformerWrapper.wrapTransform(CachedTransformerWrapper.java:24) ~[4669844567600698124@2@8.jar:?]
    at makamys.coretweaks.optimization.transformerproxy.TransformerProxy.invokeNextHandler(TransformerProxy.java:46) ~[4669844567600698124@2@8.jar:?]
    at makamys.coretweaks.optimization.transformerproxy.TransformerProxy.transform(TransformerProxy.java:27) ~[4669844567600698124@2@8.jar:?]
    at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:438) ~[launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:300) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    ... 9 more

And Crash Report.

// Hey, that tickles! Hehehe!

Time: 24-3-3 下午11:18
Description: Unexpected error

java.lang.NoClassDefFoundError: makamys/coretweaks/util/GLUtil
    at makamys.coretweaks.tweak.crashhandler.CrashHandler.resetState(CrashHandler.java:40)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:3036)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:148)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.ClassNotFoundException: makamys.coretweaks.util.GLUtil
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:348)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
    at org.objectweb.asm.ClassReader.readShort(Unknown Source)
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.findAndMergeSuperMaps(FMLDeobfuscatingRemapper.java:345)
    at cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.getMethodMap(FMLDeobfuscatingRemapper.java:322)
    at cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.mapMethodName(FMLDeobfuscatingRemapper.java:295)
    at org.objectweb.asm.commons.RemappingMethodAdapter.doVisitMethodInsn(Unknown Source)
    at org.objectweb.asm.commons.RemappingMethodAdapter.visitMethodInsn(Unknown Source)
    at org.objectweb.asm.ClassReader.a(Unknown Source)
    at org.objectweb.asm.ClassReader.b(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at cpw.mods.fml.common.asm.transformers.DeobfuscationTransformer.transform(DeobfuscationTransformer.java:37)
    at makamys.coretweaks.optimization.transformerproxy.TransformerProxy.invokeNextHandler(TransformerProxy.java:44)
    at makamys.coretweaks.optimization.transformercache.lite.CachedTransformerWrapper.wrapTransform(CachedTransformerWrapper.java:24)
    at makamys.coretweaks.optimization.transformerproxy.TransformerProxy.invokeNextHandler(TransformerProxy.java:46)
    at makamys.coretweaks.optimization.transformerproxy.TransformerProxy.transform(TransformerProxy.java:27)
    at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:438)
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:300)
    ... 11 more

I hope this problem can be fixed, thank you very much!

makamys commented 8 months ago

Can you post the full log (should be called fml-client-latest.log)? Given that the crash happens in the crash handler, what probably happened is the game crashed for an unrelated reason, then CoreTweaks failed to recover from the crash. (Meaning a crash would have happened here even without CoreTweaks.)

Also this may not be related to this issue, but you're using a very old version of Java 8. I recommend grabbing a newer one here if your launcher permits using it. This is bound to improve stability in general. https://adoptium.net/temurin/releases/?version=8&package=jre

louloumc commented 8 months ago

Sorry to provide this brief information. I have tried to find that the problem is caused by some memory leaks on the client. Directly causes the client to flash back. It will not appear if the game memory is less than 3G. It's possible that CoreTweaks detects the game's memory, and the game stall causing the client to crash. Thank you for your questions. I will contact you later if I have any other questions.

makamys commented 8 months ago

I see. I'll close this because it sounds like an issue CoreTweaks is not responsible for. When the heap is full, the game is going to crash either way. And I can't expect the crash handler to work reliably when there's no memory left to allocate.

Edit: After some more research, the most likely explanation is this: