question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReachingDefinitions wrong keys inside dep_graph.

See original GitHub issue

When using the ReachingDefinitions analysis I’ve spotted an inconsistency between the keys we are trying to retrieve and the keys that are actually pushed in the dep_graph. To be more precise, while running the provided POC over the binary I’ve shared here, I have a KeyError exception while dumping the dep_graph using networkx.

KeyError: <Definition {Atom:<Reg 20<1>>, Codeloc:[External], Data:DataSet<32>: [<Param <Reg 20<1>>>]}>

This definition seems related to the definition regarding the arguments of the function under analysis The correct Definition would be:

KeyError: <Definition {Atom:<Reg 20<4>>, Codeloc:[External], Data:DataSet<32>: [<Param <Reg 20<4>>>]}>

So, maybe an incorrect definition is being pushed somewhere?

Environment Information. You will need to install the autoblob module to load the binary and reproduce this. (https://github.com/subwire/autoblob)

To Reproduce. Just do: python reach-def-bug.py You should see the KeyError exception.

Additional context. (I’m in sync with @Pamplemousse to solve this ). reach-def-bug-000.zip

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ltfishcommented, Apr 28, 2020

I git-blamed the code, and it was originally my line… it’s much easier for me to say “this is incorrect” when it was my fault.

All atoms are supposed to be 100% immutable. The correct fix is to change that line so that instead of modifying an existing atom, we create a new Register instance with the intended size. Therefore, PR #2089 is not a correct fix.

1reaction
degrigiscommented, Apr 27, 2020

So, we have discovered that there is a conversion happening here that is triggered by a <SimIROp Iop_32to8> operation. This is modifying the size parameter of the Register atom and since the __hash__ method was relying on mutable data, the hashes for these objects were mismatching later. @Pamplemousse already issued a PR to fix the hash problem, but we were wondering if this issue has been possibly caused by missing support for all the conversions of a LoadG operations.

@ltfish what do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

A reaching definition engine for binary analysis built-in in angr.
a static program analysis technique that can help us answer which are the possible definitions for a specific variable at a particular line...
Read more >
The tikz-dependency package v2.0 - CTAN
All the commands and configuration keys that you will see in this document are available within a dependency environment. Since it is an...
Read more >
Unable to find out where reflections-maven plugin comes from
I haven't found where is reflections-maven defined in any of the multi-module project structure or used. Note I use Maven 3.3.9 . My...
Read more >
Use-Before-Define: Applying Reaching Definitions Analysis to ...
In many programming languages, a use-before-define will in fact result in a run time error and crash the program:.
Read more >
(PDF) DepGraph: Localizing Performance Bottlenecks in Multi ...
DepGraph : Localizing Performance Bottlenecks in Multi-Core ... More formally, the DepGraph is defined as follows: given a.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found