arrayfire / arrayfire/arrayfire-python
af.features.Features crashes when its __del__ method is called
- Ngôn ngữ chính
- Python
- Star
- 422
- Fork
- 63
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
When using a `Features()` object, arrayfire crashes silently when calling the object's `__del__()` method if the object's `get_xpos()` method has already been deleted (or has fallen out of scope).
Potentially due to a similar root case as mentioned in #169 (or due to the changes made as a result of this in commit a9031fb5e0db371bc88c958f0b8d43efd7fe8f45)
Running on Windows; using arrayfire 3.8.0.
Minimum working example:
```python
import arrayfire as af
def get_feature_locations(features):
# Get x and y positions of features
x_pos = features.get_xpos()
y_pos = features.get_ypos()
# If this is uncommented, the code works as intended
# return x_pos, y_pos
img = af.randn(d0=500, d1=500)
features, descriptors = af.orb(img, threshold=1, max_features=10, num_levels=1)
feature_locations = get_feature_locations(features)
print("Before delete")
del features
print("After delete")
```
Which outputs:
```
Before delete
```
Uncommenting line 10 (`return x_pos, y_pos`) outputs:
```
Before delete
After delete
```
Thanks!
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
Hướng nghiên cứu
The reported entry points are af.orb, Features.get_xpos(), Features.get_ypos(), and Features.__del__; first run the provided minimum working example on Windows with ArrayFire 3.8.0. Trace the object lifetime when the position arrays fall out of scope, then verify that deleting features no longer crashes silently and that the returned-position case still works.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100