Skip to content

Commit

Permalink
patch meas_astrom v11.0 to prevent a.d.n SIGSEVs
Browse files Browse the repository at this point in the history
W/o this patch, astrometry.net will SIGSEV under some circumstances (*) when
running the SDSS demo.

By default a.d.n is built with optimizations turned on, which (among other
things) disables checking of assert statements. That would've caught the
fact we were calling healpixDistance() with healpix=-1, which is illegal.

This patch changes the test in isWithinRange() to test for healpix == -1
(instead of nside == 0) when deciding whether it's permissible to call
healpixDistance().

(*) This bug was discovered when the stack was built on CentOS 5 and the
generated binaries were executed on CentOS 6 (with different glibc).
Running CentOS5-built binaries on CentOS 5 (and CentOS 6 binaries on CentOS
6) did not reveal it.  Demonstrates how testing in different environments
can reveal subtle bugs (**).

(**) This bug would've been caught immediately if assertions weren't turned
off in astrometry.net.  We should turn them back on for our builds.
  • Loading branch information
mjuric authored and jhoblitt committed Feb 23, 2016
1 parent aff2c51 commit 56eee04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/lsst/meas/astrom/multiindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def isWithinRange(self, coord, distance):
@param coord Coordinate to check (lsst.afw.coord.Coord)
@param distance Angular distance (lsst.afw.geom.Angle)
"""
return (self._nside == 0 or healpixDistance(self._healpix, self._nside, coord) <= distance)
return (self._healpix == -1 or healpixDistance(self._healpix, self._nside, coord) <= distance)

def __getitem__(self, i):
self.reload()
Expand Down

0 comments on commit 56eee04

Please sign in to comment.