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

Invalid memory access for getX/getY when slots aren't defined

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Sprint:
      AP S19-3
    • Team:
      Alert Production

      Description

      Looks like we have an out-of-range memory access error hiding in the catalog centroid getters, if the catalog does not have centroid slots defined:

      import lsst.afw.table
      schema = lsst.afw.table.SourceTable.makeMinimalSchema()
      lsst.afw.table.Point2DKey.addFields(schema, "centroid", "centroid", "pixels")
      catalog = lsst.afw.table.SourceCatalog(schema)
      record = catalog.addNew()
      record.set('centroid_x', 1)
      record.set('centroid_y', 2)
      record = catalog.addNew()
      record.set('centroid_x', 4)
      record.set('centroid_y', 5)
      # no slots defined results in nonsense!
      print(catalog.getX())
      print(catalog.getY())
      

      prints various nonsense values, like:

      [1.265e-321 2.846e-321]
      [1.265e-321 2.846e-321]
      

      We should probably check the other getters for similar bugs.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                swinbank John Swinbank
                Reporter:
                Parejkoj John Parejko
                Reviewers:
                John Parejko
                Watchers:
                Jim Bosch, John Parejko, John Swinbank, Paul Price, Russell Owen, Tim Jenness, Yusra AlSayyad
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel