Closed mrcslws closed 7 years ago
In debug builds, when this code runs inside the algorithms.so module, it segfaults: https://github.com/numenta/nupic.core/blob/d33caa0bde7d643a41436558ca2531c99546b783/src/nupic/py_support/NumpyVector.hpp#L425
algorithms.so
The assertion isn't actually failing. The call to PyArray_EquivTypenums causes a bad memory access. This is a macro for
PyArray_EquivTypenums
#define PyArray_EquivTypenums \ (*(unsigned char (*)(int, int)) \ PyArray_API[191])
There's a PyArray_API array that contains a bunch of function pointers, and it's not getting properly populated.
The solution is: we need to include this line in algorithms.i: https://github.com/numenta/nupic.core/blob/d33caa0bde7d643a41436558ca2531c99546b783/src/nupic/bindings/math.i#L90
algorithms.i
In htmresearch-core we also need this line in experimental.i.
experimental.i
In debug builds, when this code runs inside the
algorithms.so
module, it segfaults: https://github.com/numenta/nupic.core/blob/d33caa0bde7d643a41436558ca2531c99546b783/src/nupic/py_support/NumpyVector.hpp#L425The assertion isn't actually failing. The call to
PyArray_EquivTypenums
causes a bad memory access. This is a macro forThere's a PyArray_API array that contains a bunch of function pointers, and it's not getting properly populated.
The solution is: we need to include this line in
algorithms.i
: https://github.com/numenta/nupic.core/blob/d33caa0bde7d643a41436558ca2531c99546b783/src/nupic/bindings/math.i#L90In htmresearch-core we also need this line in
experimental.i
.