angr / angr-management

The official angr GUI.
BSD 2-Clause "Simplified" License
873 stars 110 forks source link

Error creating simulation manager #182

Closed mxms0 closed 2 years ago

mxms0 commented 4 years ago

(Let me know if I'm jumping the gun here..)

I'm getting an error trying to create a simulation manager. The steps I have to reproduce:

  1. Open a binary
  2. Go to the states view, right click, make a new state
  3. Right click on the state to make a New Simulation Manager

Debug info

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/angr_dev/angr-management/angrmanagement/ui/widgets/qsimulation_managers.py in _on_simgr_selection(self)
    193         if simgr != self.simgr.am_obj:
    194             self.simgr.am_obj = simgr
--> 195             self.simgr.am_event(src='clicked')
    196
    197     def _on_state_selection(self):

~/angr_dev/angr-management/angrmanagement/data/object_container.py in am_event(self, **kwargs)
     17     def am_event(self, **kwargs):
     18         for listener in self.am_subscribers:
---> 19             listener(**kwargs)
     20
     21

~/angr_dev/angr-management/angrmanagement/ui/widgets/qpathtree.py in _watch_simgr(self, **kwargs)
    142
    143     def _watch_simgr(self, **kwargs):
--> 144         self.reload()

~/angr_dev/angr-management/angrmanagement/ui/widgets/qpathtree.py in reload(self)
     42         graph = self._generate_graph([state.history for state in states], hierarchy, self.symexec_view)
     43
---> 44         self._graph.graph = graph
     45
     46     #

~/angr_dev/angr-management/angrmanagement/ui/widgets/qsymexec_graph.py in graph(self, v)
     37         if v is not self._graph:
     38             self._graph = v
---> 39             self.reload()
     40
     41     def reload(self):

~/angr_dev/angr-management/angrmanagement/ui/widgets/qsymexec_graph.py in reload(self)
     40
     41     def reload(self):
---> 42         self.request_relayout()
     43
     44     def request_relayout(self):

~/angr_dev/angr-management/angrmanagement/ui/widgets/qsymexec_graph.py in request_relayout(self)
     61             self.blocks.add(node)
     62             node_sizes[node] = (node.width, node.height)
---> 63         gl = GraphLayouter(self.graph, node_sizes, node_compare_key=lambda n: 0)
     64
     65         self._edges = gl.edges

~/angr_dev/angr-management/angrmanagement/utils/graph_layouter.py in __init__(self, graph, node_sizes, node_compare_key)
    313         self.node_coordinates = { }
    314
--> 315         self._layout()
    316
    317     def _layout(self):

~/angr_dev/angr-management/angrmanagement/utils/graph_layouter.py in _layout(self)
    326
    327         # assign row and column to each node
--> 328         self._assign_grid_locations(self.graph, acyclic_graph, ordered_nodes=ordered_nodes)
    329
    330         # edge routing

~/angr_dev/angr-management/angrmanagement/utils/graph_layouter.py in _assign_grid_locations(self, graph, acyclic_graph, ordered_nodes)
    389
    390         self._assign_rows(graph, acyclic_graph, ordered_nodes)
--> 391         self._assign_columns(acyclic_graph)
    392
    393     def _assign_rows(self, graph, acyclic_graph, ordered_nodes):

~/angr_dev/angr-management/angrmanagement/utils/graph_layouter.py in _assign_columns(self, acyclic_graph)
    463         for row_idx in reversed(list(self._row_to_nodes.keys())):
    464             from IPython import embed; embed()
--> 465             row_nodes = sorted(self._row_to_nodes[row_idx], key=lambda n: n.addr)
    466
    467             next_min_col, next_max_col = 1, 2

~/angr_dev/angr-management/angrmanagement/utils/graph_layouter.py in <lambda>(n)
    463         for row_idx in reversed(list(self._row_to_nodes.keys())):
    464             from IPython import embed; embed()
--> 465             row_nodes = sorted(self._row_to_nodes[row_idx], key=lambda n: n.addr)
    466
    467             next_min_col, next_max_col = 1, 2

AttributeError: 'QStateBlock' object has no attribute 'addr'
Python 3.7.7 (default, Mar 10 2020, 15:43:33)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.15.0 -- An enhanced Interactive Python. Type '?' for help.

[ins] In [1]: self._row_to_nodes[row_idx]
Out[1]: [<angrmanagement.ui.widgets.qstate_block.QStateBlock(0x7fb6af3efa20, pos=0,0) at 0x12b11caf0>]

(P.S There's a different issue that happens before this about _edge_paths not being defined QSymExecGraph)

ltfish commented 4 years ago

I noticed both of your issues and have fixed them in another branch. I will merge the other branch into master soon.

Kyle-Kyle commented 4 years ago

Oh. It looks like you already have a fix. Please ignore #183 then.

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

github-actions[bot] commented 2 years ago

This issue has been closed due to inactivity.