Open TheElementalOfDestruction opened 5 years ago
Thank you for the report. Would it be possible to provide the input file that you are trying to decompile so we can try to reproduce the issue? Either publicly here or privately via email.
What email should I send it to?
You can send it to e.g. the email that is in my profile.
Thank you for the input binary. I have tried decompiling it with the current master
build and the decompilation has successfully passed through Conditional branch optimization
. However, it has consumed around 140 GB of RAM. @PeterMatula, could you please verify what is taking that much memory?
Here is an output from valgrind --tool=massif
(heap profiler), taken during the Conditional branch optimization
. It can be opened in e.g. massif-visualizer. Below is also a screenshot from the tool:
@PeterMatula please take a look on the output. There are some data structures that take a lot of memory.
@s3rvac Would it be possible for you to send me the final output? I can't get my machine to accept using that much memory even through paging files.
Unfortunately, I do not have it (AFAIK I have not run the whole decompilation; I have only checked that the decompilation can pass the Conditional branch optimization
phase). Let's wait until @PeterMatula analyzes the memory requirements from my report above.
So I finally managed to get one of my machines to accept a 200 gb paging file and have now run the program. Unfortunately, it's been stuck on the conditional branch part for the past 16 hours. I'm going to let it keep running overnight and see what happens, but now I'm concerned that it may not ever finish...
I really suggest waiting until @PeterMatula analyzes the memory requirements. A decompilation taking that much time won't probably produce any meaningful results.
@s3rvac So I've stopped that decompilation after a few days of it remaining at that step. I then started modifying the command to not do certain things. First I removed Conditional branch optimization
. Then the program started using massive amounts of memory (and then took so long that I stopped it manually) on Stack optimization
. I've now also taken that out just to see what the rest of the process is like in terms of memory and time. Perhaps the excessive memory usage at later steps is caused by Conditional branch optimization
and Stack optimization
not running, but they are also using massive amounts of memory and time. Here is the current output from he console (I ended up forgetting to stop it and just looked at it now):
C:\Users\Elemental Creation\Desktop\install\bin>"C:\Users\Elemental Creation\Desktop\install\bin\retdec-bin2llvmir" -provider-init -decoder -verify -x87-fpu -main-detection -idioms-libgcc -inst-opt -syscalls -constants -param-return -local-vars -inst-opt -simple-types -generate-dsm -remove-asm-instrs -class-hierarchy -select-fncs -unreachable-funcs -inst-opt -x86-addr-spaces -value-protect -instcombine -tbaa -targetlibinfo -basicaa -domtree -simplifycfg -domtree -early-cse -lower-expect -targetlibinfo -tbaa -basicaa -globalopt -mem2reg -instcombine -simplifycfg -basiccg -domtree -early-cse -lazy-value-info -jump-threading -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -instcombine -scalar-evolution -loop-simplifycfg -loop-simplify -aa -loop-accesses -loop-load-elim -lcssa -indvars -loop-idiom -loop-deletion -memdep -gvn -memdep -sccp -instcombine -lazy-value-info -jump-threading -correlated-propagation -domtree -memdep -dse -dce -bdce -adce -die -simplifycfg -instcombine -strip-dead-prototypes -globaldce -constmerge -constprop -instnamer -domtree -instcombine -instcombine -tbaa -targetlibinfo -basicaa -domtree -simplifycfg -domtree -early-cse -lower-expect -targetlibinfo -tbaa -basicaa -globalopt -mem2reg -instcombine -simplifycfg -basiccg -domtree -early-cse -lazy-value-info -jump-threading -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -instcombine -scalar-evolution -loop-simplifycfg -loop-simplify -aa -loop-accesses -loop-load-elim -lcssa -indvars -loop-idiom -loop-deletion -memdep -gvn -memdep -sccp -instcombine -lazy-value-info -jump-threading -correlated-propagation -domtree -memdep -dse -dce -bdce -adce -die -simplifycfg -instcombine -strip-dead-prototypes -globaldce -constmerge -constprop -instnamer -domtree -instcombine -inst-opt -simple-types -stack-ptr-op-remove -idioms -global-to-local -dead-global-assign -instcombine -inst-opt -idioms -phi2seq -value-protect -disable-inlining -disable-simplify-libcalls -config-path "C:\Users\Elemental Creation\Desktop\libchoicesapp.so.json" -o "C:\Users\Elemental Creation\Desktop\libchoicesapp.so.bc"
Running phase: Initialization ( 0.40s )
Running phase: LLVM ( 0.62s )
Running phase: Providers initialization ( 0.62s )
Running phase: Input binary to LLVM IR decoding ( 7.02s )
Running phase: LLVM ( 636.25s )
Running phase: x87 fpu register analysis ( 642.74s )
Running phase: Main function identification optimization ( 642.74s )
Running phase: Libgcc idioms optimization ( 642.81s )
Running phase: LLVM instruction optimization ( 644.59s )
Running phase: Syscalls optimization ( 647.71s )
Running phase: Constants optimization ( 648.64s )
Running phase: Function parameters and returns optimization ( 50079.44s )
Running phase: Register localization optimization ( 150145.98s )
(EDIT: Quick note: I did the math and 50079 seconds is about 14 hours and 150145 seconds is about 42 hours. Therfore, Function parameters and returns optimization
took nearly 28 hours.)
Perhaps @PeterMatula should look into this as well?
Also, @s3rvac, in other decompiled files I have gotten a JSON file that has a huge amount of information, most of which is information I would want to look through for this specific file. Is there a way I can just get the JSON file without having to go through all the hassle that is occurring during the execution of retdec-bin2llvmir
?
Is there a way I can just get the JSON file without having to go through all the hassle that is occurring during the execution of
retdec-bin2llvmir
?
Unfortunately, there is not. The JSON file is a configuration file that tools which are part of the RetDec toolchain use to communicate with each other. The reason is that representing some pieces of information via LLVM IR is really cumbersome, which is why we have decided to use a separate config file.
@s3rvac ah I was hoping I might be able to see some of the class hierarchies in this one like I have in other projects. Being able to do so would be extremely useful for what I am trying to do.
Command Line Output:
My dump file: retdec-bin2llvmir.exe-2c8ddd.dmp.zip