CFR heap overflow
Boobies opened this issue · comments
I think there's either a problem with cfr or you're not giving it a big enough heap:
Decompiling using official mojang mappings...
Do you want to clean up some leftovers? (y/n): y
Please input you decompiler choice: fernflower (f) or cfr (default: cfr) :
Please input a valid version starting from 19w36a and 1.14.4 : 20w20b
Please select either client or server side (c/s) : c
Downloading versions/version_manifest.json...
Downloading versions/20w20b/version.json...
Auto Mode? (y/n): y
Found 20w20b.json
Downloading the mappings for 20w20b...
Downloading mappings/20w20b/client.txt...
Done !
Downloading versions/20w20b/client.jar...
Done !
=== Remapping jar using SpecialSource ====
Loading mappings
Loading mappings... 0%
Loading mappings... 10%
Loading mappings... 20%
Loading mappings... 30%
Loading mappings... 40%
Loading mappings... 50%
0 packages, 5673 classes, 20412 fields, 45063 methods
Remapping final jar
Remapping jar... 0%
Remapping jar... 10%
Remapping jar... 20%
Remapping jar... 30%
Remapping jar... 40%
Remapping jar... 50%
Remapping jar... 60%
Remapping jar... 70%
Remapping jar... 80%
Remapping jar... 90%
- New -> 20w20b-client-temp.jar
Done in 40.5s
=== Decompiling using CFR (silent) ===
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at org.benf.cfr.reader.state.DCCommonState.getClassFile(DCCommonState.java:156)
at org.benf.cfr.reader.bytecode.analysis.types.JavaRefTypeInstance.getClassFile(JavaRefTypeInstance.java:416)
at org.benf.cfr.reader.bytecode.analysis.parse.lvalue.AbstractFieldVariable.getFieldType(AbstractFieldVariable.java:141)
at org.benf.cfr.reader.bytecode.analysis.parse.lvalue.AbstractFieldVariable.<init>(AbstractFieldVariable.java:28)
at org.benf.cfr.reader.bytecode.analysis.parse.lvalue.StaticVariable.<init>(StaticVariable.java:22)
at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.createStatement(Op02WithProcessedDataAndRefs.java:1295)
at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.access$100(Op02WithProcessedDataAndRefs.java:56)
at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs$11.call(Op02WithProcessedDataAndRefs.java:2065)
at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs$11.call(Op02WithProcessedDataAndRefs.java:2062)
at org.benf.cfr.reader.util.graph.AbstractGraphVisitorFI.process(AbstractGraphVisitorFI.java:60)
at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.convertToOp03List(Op02WithProcessedDataAndRefs.java:2074)
at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:346)
at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:188)
at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:126)
at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:96)
at org.benf.cfr.reader.entities.Method.analyse(Method.java:397)
at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:906)
at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:797)
at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:225)
at org.benf.cfr.reader.Driver.doJar(Driver.java:109)
at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:65)
at org.benf.cfr.reader.Main.main(Main.java:48)
Traceback (most recent call last):
File "main.py", line 382, in <module>
File "main.py", line 345, in main
File "main.py", line 196, in decompile_cfr
File "subprocess.py", line 418, in run
subprocess.CalledProcessError: Command '['java', '-jar', '<CENSORED_PATH>\\lib\\cfr-0.146.jar', '<CENSORED_PATH>\\src\\20w20b-client-temp.jar', '--outputdir', './src/20w20b/client', '--caseinsensitivefs', 'true', '--silent', 'true']' returned non-zero exit status 1.
[8316] Failed to execute script main
CFR is run with 1GB of ram which should be enough, but it could be that the new snapshot is a bit larger than the usual, i will test that.
After careful review, we do go slightly over the 1GB limit (about 1.2 on a test bench), however Java has built-in mechanisms for those kind of stuff, so my guess is that you system didn't have 1.2GB available.
If it is not that, then i will increase the limit to 2GB
I went ahead and increased the limit to 2