uxmal / reko

Reko is a binary decompiler.
https://uxmal.github.io/reko
GNU General Public License v2.0
2.16k stars 253 forks source link

Common decompiler problems (0.7.0) #468

Open rfalke opened 7 years ago

rfalke commented 7 years ago

Please note that I'm not familiar with the Exception formatting in .NET.

Running https://github.com/rfalke/decompiler-subjects/blob/master/scripts/summarize_reko_problems.sh results in the attached file. The Top-5 Items are: reko-0.7.0-problems.txt

9194 times
    The given key was not present in the dictionary.
    at System.ThrowHelper.ThrowKeyNotFoundException ()
    at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key)
    at Reko.Analysis.ExpressionPropagator.GetStackDepthBeforeCall ()
2843 times
    Expected stack depth to be negative.
    at Reko.Analysis.ExpressionPropagator.GetStackDepthBeforeCall ()
    at Reko.Analysis.ExpressionPropagator.VisitCallInstruction (Reko.Core.Code.CallInstruction ci)
    at Reko.Core.Code.CallInstruction.Accept[T] (InstructionVisitor`1 visitor)
2051 times
    The method or operation is not implemented.
    at Reko.Structure.RegionFactory.VisitDefInstruction (Reko.Core.Code.DefInstruction def)
    at Reko.Core.Code.DefInstruction.Accept[T] (InstructionVisitor`1 visitor)
    at Reko.Structure.RegionFactory.Create (Reko.Core.Block b)
1637 times
    The given key was not present in the dictionary.
    at System.ThrowHelper.ThrowKeyNotFoundException ()
    at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key)
    at Reko.Analysis.SsaIdentifierCollection.get_Item (Reko.Core.Expressions.Identifier id)
 943 times
    The method or operation is not implemented.
    at Reko.Structure.StructureAnalysis.DetermineFollowLatch (Reko.Structure.Region head, ISet`1 loopNodes)
    at Reko.Structure.StructureAnalysis.RefineLoop (Reko.Structure.Region head, ISet`1 loopNodes)
    at Reko.Structure.StructureAnalysis.ProcessUnresolvedRegions ()
smx-smx commented 7 years ago

As far as I remember most of those exceptions are known, for example the stack depth one, and are part of an ongoing rewrite/refactoring in the "analysis-development" branch

uxmal commented 7 years ago

Indeed; I have added a tag to track this.

rfalke commented 1 year ago

Summary for version 0.11.4.0-931ca7d

==== 6053 times
    Specified argument was out of the range of valid values. (Parameter 'bitSize')
    at Reko.Core.Types.PrimitiveType.CreateWord(Int32 bitSize) in /home/runner/work/reko/reko/src/Core/Types/PrimitiveType.cs:line 141
    at Reko.Core.Expressions.ExpressionTypeAscenderBase.VisitBinaryExpression(BinaryExpression binExp) in /home/runner/work/reko/reko/src/Core/Expressions/ExpressionTypeAscenderBase.cs:line 186
    at Reko.Core.Expressions.ExpressionTypeAscenderBase.VisitConditionOf(ConditionOf cof) in /home/runner/work/reko/reko/src/Core/Expressions/ExpressionTypeAscenderBase.cs:line 333

==== 2632 times
    The method or operation is not implemented.
    at Reko.Core.Output.GlobalDataWriter.VisitTypeVariable(TypeVariable tv) in /home/runner/work/reko/reko/src/Core/Output/GlobalDataWriter.cs:line 420
    at Reko.Core.Types.TypeVariable.Accept[T](IDataTypeVisitor`1 v) in /home/runner/work/reko/reko/src/Core/Types/TypeVariable.cs:line 53
    at Reko.Core.Output.GlobalDataWriter.WriteGlobalVariable(Address address, DataType dataType, String name) in /home/runner/work/reko/reko/src/Core/Output/GlobalDataWriter.cs:line 154

==== 1114 times
    Specified argument was out of the range of valid values. (Parameter 'bitSize')
    at Reko.Core.Types.PrimitiveType.CreateWord(Int32 bitSize) in /home/runner/work/reko/reko/src/Core/Types/PrimitiveType.cs:line 141
    at Reko.Core.Expressions.ExpressionTypeAscenderBase.VisitBinaryExpression(BinaryExpression binExp) in /home/runner/work/reko/reko/src/Core/Expressions/ExpressionTypeAscenderBase.cs:line 186
    at Reko.Typing.TypeCollector.VisitAssignment(Assignment ass) in /home/runner/work/reko/reko/src/Decompiler/Typing/TypeCollector.cs:line 194

====  732 times
    Specified argument was out of the range of valid values. (Parameter 'bitSize')
    at Reko.Core.Types.PrimitiveType.CreateWord(Int32 bitSize) in /home/runner/work/reko/reko/src/Core/Types/PrimitiveType.cs:line 141
    at Reko.Typing.ExpressionTypeDescender.VisitBinaryExpression(BinaryExpression binExp, TypeVariable tv) in /home/runner/work/reko/reko/src/Decompiler/Typing/ExpressionTypeDescender.cs:line 399
    at Reko.Typing.TypeCollector.VisitAssignment(Assignment ass) in /home/runner/work/reko/reko/src/Decompiler/Typing/TypeCollector.cs:line 194

====  498 times
    The method or operation is not implemented.
    at Reko.Core.Output.GlobalObjectTracer.VisitTypeVariable(TypeVariable tv) in /home/runner/work/reko/reko/src/Core/Output/GlobalObjectTracer.cs:line 209
    at Reko.Core.Types.TypeVariable.Accept[T](IDataTypeVisitor`1 v) in /home/runner/work/reko/reko/src/Core/Types/TypeVariable.cs:line 53
    at Reko.Core.Output.GlobalObjectTracer.TraceObject(DataType dataType, Address addr) in /home/runner/work/reko/reko/src/Core/Output/GlobalObjectTracer.cs:line 74

====  395 times
    Specified argument was out of the range of valid values. (Parameter 'bitSize')
    at Reko.Core.Types.PrimitiveType.CreateWord(Int32 bitSize) in /home/runner/work/reko/reko/src/Core/Types/PrimitiveType.cs:line 141
    at Reko.Typing.ExpressionTypeDescender.VisitBinaryExpression(BinaryExpression binExp, TypeVariable tv) in /home/runner/work/reko/reko/src/Decompiler/Typing/ExpressionTypeDescender.cs:line 399
    at Reko.Typing.ExpressionTypeDescender.VisitArrayAccess(ArrayAccess acc, TypeVariable tv) in /home/runner/work/reko/reko/src/Decompiler/Typing/ExpressionTypeDescender.cs:line 193