Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-8597

The pybind11 wrapper for CoaddInputs segfaults

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Story Points:
      4
    • Sprint:
      DRP S17-1
    • Team:
      Data Release Production

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Appears to have been fixed upstream. Upgrade to latest pybind11 master makes it disappear.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Appears to have been fixed upstream. Upgrade to latest pybind11 master makes it disappear.
            Hide
            rowen Russell Owen added a comment -

            I built a new stack (through afw) and can confirm that the problem has been resolved (at least on my Mac). It is now safe to enable the skipped test in testExposureInfo.py (as you have done on this ticket branch). Thank you!

            Show
            rowen Russell Owen added a comment - I built a new stack (through afw) and can confirm that the problem has been resolved (at least on my Mac). It is now safe to enable the skipped test in testExposureInfo.py (as you have done on this ticket branch). Thank you!

              People

              Assignee:
              pschella Pim Schellart [X] (Inactive)
              Reporter:
              rowen Russell Owen
              Reviewers:
              Russell Owen
              Watchers:
              Pim Schellart [X] (Inactive), Russell Owen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.