You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've implemented tree traversal algorithms using rust-numpy for coniferest package (active anomaly detection based on the isolation forest). I've found that in some specific cases, CPython crashes with a memory deallocation error caused by a free() call inside _multiarray_umath.*.so. The problem reproduces on x86_64 Linux and ARM64 Mac, and reproduces each time with the same code.
I suspect this may be due to a bug in my Rust code or in PyO3/rust-numpy, since everything works fine when I run the same logic using our older Cython implementation. I also suspect it could be a reference counting issue: the memory may have already been freed by Rust or numpy.
The main problem is that when I try to debug it with GDB, it's really hard to understand which array caused the issue, because no Rust functions appear in the backtrace. Do you have any recommendations for how I can better debug this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've implemented tree traversal algorithms using
rust-numpy
for coniferest package (active anomaly detection based on the isolation forest). I've found that in some specific cases, CPython crashes with a memory deallocation error caused by afree()
call inside_multiarray_umath.*.so
. The problem reproduces on x86_64 Linux and ARM64 Mac, and reproduces each time with the same code.I suspect this may be due to a bug in my Rust code or in PyO3/
rust-numpy
, since everything works fine when I run the same logic using our older Cython implementation. I also suspect it could be a reference counting issue: the memory may have already been freed by Rust ornumpy
.The main problem is that when I try to debug it with GDB, it's really hard to understand which array caused the issue, because no Rust functions appear in the backtrace. Do you have any recommendations for how I can better debug this?
Beta Was this translation helpful? Give feedback.
All reactions