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

            No builds found.
            rowen Russell Owen created issue -
            rowen Russell Owen made changes -
            Field Original Value New Value
            Epic Link DM-8450 [ 28066 ]
            rowen Russell Owen made changes -
            Link This issue relates to DM-8417 [ DM-8417 ]
            rowen Russell Owen made changes -
            Labels SciencePipelines
            pschella Pim Schellart [X] (Inactive) made changes -
            Epic Link DM-8450 [ 28066 ] DM-7717 [ 26925 ]
            pschella Pim Schellart [X] (Inactive) made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            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.
            pschella Pim Schellart [X] (Inactive) made changes -
            Reviewers Russell Owen [ rowen ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            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!
            rowen Russell Owen made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            pschella Pim Schellart [X] (Inactive) made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]

              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:

                  CI Builds

                  No builds found.