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

CoaddPsf.getWcs(i) segfaults on i=getComponentCount()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Story Points:
      0.5
    • Sprint:
      DRP S19-4
    • Team:
      Data Release Production

      Description

      CoaddPsf.getWcs( i ) segfaults on i=getComponentCount() because the range check is index > getComponentCount() instead of index >= getComponentCount().

        Attachments

          Activity

          Hide
          dtaranu Dan Taranu added a comment -

          To reproduce:

          import lsst.daf.persistence as dafPersist
          butler = dafPersist.Butler('/datasets/hsc/repo/rerun/RC/w_2019_02/DM-16110/')
          coadd = butler.get("deepCoadd_calexp", dataId=\{"tract": 9813, "patch": '2,5', 'filter': 'HSC-I'})
          psf = coadd.getPsf()
          numcomp = psf.getComponentCount()
          for comp in [0, numcomp+1, numcomp]:
          	try:
          		print(psf.getWcs(comp).getPixelScale().asArcseconds())
          	except Exception as err:
          		print(err)
          

          Output:

          0.16879569053877114
           
            File "src/CoaddPsf.cc", line 293, in lsst::afw::geom::SkyWcs lsst::meas::algorithms::CoaddPsf::getWcs(int)
              index of CoaddPsf component out of range {0}
          lsst::pex::exceptions::RangeError: 'index of CoaddPsf component out of range'
           
          Caught signal 11, backtrace follows:
          /software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/utils/16.0-18-g0a50484+1/lib/libutils.so(+0x13864) [0x7fc703b9d864]
          /usr/lib64/libc.so.6(+0x36280) [0x7fc757871280]
          ... etc ...
          

          Show
          dtaranu Dan Taranu added a comment - To reproduce: import lsst.daf.persistence as dafPersist butler = dafPersist.Butler('/datasets/hsc/repo/rerun/RC/w_2019_02/DM-16110/') coadd = butler.get("deepCoadd_calexp", dataId=\{"tract": 9813, "patch": '2,5', 'filter': 'HSC-I'}) psf = coadd.getPsf() numcomp = psf.getComponentCount() for comp in [0, numcomp+1, numcomp]: try: print(psf.getWcs(comp).getPixelScale().asArcseconds()) except Exception as err: print(err) Output: 0.16879569053877114   File "src/CoaddPsf.cc", line 293, in lsst::afw::geom::SkyWcs lsst::meas::algorithms::CoaddPsf::getWcs(int) index of CoaddPsf component out of range {0} lsst::pex::exceptions::RangeError: 'index of CoaddPsf component out of range'   Caught signal 11, backtrace follows: /software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/utils/16.0-18-g0a50484+1/lib/libutils.so(+0x13864) [0x7fc703b9d864] /usr/lib64/libc.so.6(+0x36280) [0x7fc757871280] ... etc ...
          Hide
          czw Christopher Waters added a comment -

          It's always off-by-one errors.

          Show
          czw Christopher Waters added a comment - It's always off-by-one errors.

            People

            Assignee:
            dtaranu Dan Taranu
            Reporter:
            dtaranu Dan Taranu
            Reviewers:
            Christopher Waters
            Watchers:
            Christopher Waters, Dan Taranu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.