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

Exceptions when running against PuzzlesLib #35

Open
pointydev opened this issue Jul 29, 2023 · 5 comments
Open

Exceptions when running against PuzzlesLib #35

pointydev opened this issue Jul 29, 2023 · 5 comments
Labels
bug Something isn't working lljzip Issue is caused by LL-Java-Zip

Comments

@pointydev
Copy link

pointydev commented Jul 29, 2023

Running this command resulted in the below output for me: java -verbose -jar ./jneedle-cli-0.1.0-SNAPSHOT-all.jar -f "/home/pointy/.local/share/PrismLauncher/" (also present without -verbose). I tested using the artifact from this build, however using the current release build on the same directory also throws exceptions including IllegalStateException, IndexOutOfBoundsException, IOException and IllegalArgumentException.

20:09:42.235 [DefaultDispatcher-worker-13] DEBUG dev.kosmx.needle.scanner.JarScanner -- Start scanning nested jar: META-INF/jars/mixinextras-fabric-0.2.0-beta.7.jar
[12.421s][info][class,load] kotlinx.coroutines.IncompleteStateBox source: file:/home/pointy/Downloads/jneedle-cli-0.1.0-SNAPSHOT-all.jar
Exception in thread "main" [12.422s][info][class,load] java.lang.Throwable$PrintStreamOrWriter source: jrt:/java.base
[12.422s][info][class,load] java.lang.Throwable$WrappedPrintStream source: jrt:/java.base
java.lang.IllegalArgumentException: 4219845755
	at software.coley.lljzip.util.BufferData.validate(BufferData.java:132)
	at software.coley.lljzip.util.BufferData.getInt(BufferData.java:27)
	at software.coley.lljzip.format.read.JvmZipReader.read(JvmZipReader.java:140)
	at software.coley.lljzip.ZipIO.read(ZipIO.java:227)
	at software.coley.lljzip.ZipIO.read(ZipIO.java:202)
	at software.coley.lljzip.ZipIO.readJvm(ZipIO.java:166)
	at dev.kosmx.needle.scanner.ScanConfig.checkJar(ScanConfig.kt:61)
	at dev.kosmx.needle.scanner.ScanConfig$checkPath$3$4.invokeSuspend(ScanConfig.kt:144)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
[12.423s][info][class,load] java.lang.Shutdown source: shared objects file
[12.423s][info][class,load] java.lang.Shutdown$Lock source: shared objects file

The tool seemed to work fine for me when run on individual modpack directories.

[pointy@pointy Downloads]$ java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7, mixed mode, sharing)

Thanks,
pointy

@KosmX KosmX added the bug Something isn't working label Jul 29, 2023
@KosmX
Copy link
Owner

KosmX commented Jul 29, 2023

Oh, great. Another nested jar issue with LL-Java-Zip
Please download this configuration file: logback-debug.xml and run the program with the following arguments:
java -Dlogback.configurationFile=logback-debug.xml -jar ./jneedle-cli-0.1.0-SNAPSHOT-all.jar --threads 1 -f "/home/pointy/.local/share/PrismLauncher/"

This will log every single file, so it will generate a huge amount of logs.
If it crashes on something, please send me the last file contained in the log. (that file is causing the trouble)

@KosmX
Copy link
Owner

KosmX commented Jul 29, 2023

@Col-E, can you help with this? It was a nested jar scan but I don't know more than that.

@Col-E
Copy link

Col-E commented Jul 29, 2023

I can't really help much without a sample unfortunately. Most I can say is the data index is out of bounds of the file. So since its embedded, maybe there was an extract issue?

That being said, you really only need to use readJvm for the root jar. The embedded jars can be read with standard or naive.

@pointydev
Copy link
Author

pointydev commented Jul 29, 2023

java -verbose -Dlogback.configurationFile=logback-debug.xml -jar ./jneedle-cli-0.1.0-SNAPSHOT-all.jar --threads 1 -f "/home/pointy/.local/share/PrismLauncher/" >stdout.log 2>&1
jNeedle.log
stdout.log
PuzzlesLib-v8.0.12-1.20.1-Fabric.jar (zipped because GitHub)

Seems to throw when scanning the attached mod by itself, updated issue title accordingly.

@pointydev pointydev changed the title Exceptions when running against PrismLauncher root directory Exceptions when running against PuzzlesLib Jul 29, 2023
@KosmX KosmX added the lljzip Issue is caused by LL-Java-Zip label Jul 29, 2023
@KosmX
Copy link
Owner

KosmX commented Jul 31, 2023

Should be a temporary workaround in the current pre-release tho the root cause is not yet fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lljzip Issue is caused by LL-Java-Zip
Projects
None yet
Development

No branches or pull requests

3 participants