Fix Numpy 1.20.0 by initializing PyArray_Descr portably
Merged
requested to merge leo-singer/lalsuite:numpy-1.20.0-compatible-dtype-initialization into master
Compare changes
Files
3+ 0
− 1
Maintenance will be performed on git.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 1 April 2025 starting at approximately 9am PDT. It is expected to take around 30 minutes and there will be several periods of downtime throughout the maintenance. Please address any comments, concerns, or questions to the helpdesk.
According to the Numpy documentation:
To ensure compatibility:
- Never declare a non-pointer instance of the struct
- Never perform pointer arithmatic
- Never use
sizof(PyArray_Descr)
The SWIG bindings broke the first of these rules. Improper order of initialization led to a null pointer that was causing a segfault.
Fixes #414 (closed). (We shall see!)
If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.
N/A