angr / angr/angr-management

`SimulationManager` `explore` fails with _ReferenceError: weakly-referenced object no longer exists_

Đang mở
#1,156 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug needs-triage
Ngôn ngữ chính
Python
Star
1.2k
Fork
131
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
14

Mô tả

### Description

No exploration solutions can be found because `weakrefs` to needed objects allow the `gc` to remove them too early.
```
ERROR | 2024-01-09 11:58:05,299 | angrmanagement.data.object_container | Error raised from event of (container: Active simulation manager)(container: phony monster)
Traceback (most recent call last):
File "/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angrmanagement/data/object_container.py", line 32, in am_event
listener(**kwargs)
File "/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angrmanagement/ui/widgets/qpathtree.py", line 139, in _watch_simgr
self.reload()
File "/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angrmanagement/ui/widgets/qpathtree.py", line 40, in reload
graph = self._generate_graph([state.history for state in states], hierarchy, self.symexec_view)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angrmanagement/ui/widgets/qpathtree.py", line 131, in _generate_graph
history_to_block[src] = QStateBlock(False, symexec_view, history=src)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angrmanagement/ui/widgets/qstate_block.py", line 39, in __init__
self._init_widgets()
File "/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angrmanagement/ui/widgets/qstate_block.py", line 52, in _init_widgets
if self.state.regs._ip.symbolic:
^^^^^^^^^^^^^^^
ReferenceError: weakly-referenced object no longer exists
```

### Steps to reproduce the bug

1. Load binary https://github.com/angr/angr-examples/blob/master/examples/defcamp_r100/r100
2. Configure a new simulation manager as per https://github.com/angr/angr-examples/blob/master/examples/defcamp_r100/solve.py
3. Click Explore
4. Note that nothing is found and errors are generated

### Environment

```
$ python -m angr.misc.bug_report
angr environment report
=============================
Date: 2024-01-09 12:13:58.770735
Running in virtual environment at /home/rick/Python/venvs/_angr
/home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angr/misc/bug_report.py:88: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources # pylint:disable=import-outside-toplevel
Platform: linux-x86_64
Python version: 3.11.7 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231011 (Red Hat 13.2.1-4)]
######## angr #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/angr/__init__.py
Pip version angr 9.2.83
Couldn't find git info
######## ailment #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/ailment/__init__.py
Pip version ailment 9.2.83
Couldn't find git info
######## cle #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/cle/__init__.py
Pip version cle 9.2.83
Couldn't find git info
######## pyvex #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/pyvex/__init__.py
Pip version pyvex 9.2.83
Couldn't find git info
######## claripy #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/claripy/__init__.py
Pip version claripy 9.2.83
Couldn't find git info
######## archinfo #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/archinfo/__init__.py
Pip version archinfo 9.2.83
Couldn't find git info
######## z3 #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/z3/__init__.py
Pip version z3-solver 4.10.2.0
Couldn't find git info
######## unicorn #########
Python found it in /home/rick/Python/venvs/_angr/lib64/python3.11/site-packages/unicorn/__init__.py
Pip version unicorn 2.0.1.post1
Couldn't find git info
######### Native Module Info ##########
angr:
unicorn:
pyvex: .FFILibrary object at 0x7ff35d096450>
z3:
```

### Additional context

Running `python solve.py` works fine and completes in a few seconds.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.