af.features.Features crashes when its __del__ method is called
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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:
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!
- Dominant language
- Python
- Stars
- 422
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arrayfire/arrayfire-python
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
arrayfire/arrayfire-python#271 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
arrayfire/arrayfire-python#270 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
arrayfire/arrayfire-python#269 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
arrayfire/arrayfire-python#267 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
arrayfire/arrayfire-python#266 ·
All issues in arrayfire/arrayfire-python
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·