The pybind11 wrapper for CoaddInputs added in
DM-8417 has a serious problem: any attempt to read the visits field causes a segfault: "pointer being freed was not allocated".
To see this run afw/tests/testExposureTable.py after enabling testCoaddInputs by commenting out the skip decorator.
The code uses def_readwrite to wrap these fields. However, I have also tried:
- Adding new getter and setter methods in CoaddInputs.h and wrapping those using def_property in coaddInputs.cc
- Specifying other return value policies such as reference_internal (the default, and desired policy) and reference (not very desirable, but emulates what SWIG did and if it worked then the unit test should have run correctly).
The final commit of
DM-8417 includes some temporary extra code in CoaddInputs.h and coaddInputs.cc that helped me perform the above tests. You may find it useful for experimentation.