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 committed Oct 11, 2015
1 parent d37e29c commit c38cc6b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions patches/meas_astrom/adn-assertion-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- python/lsst/meas/astrom/multiindex.py 2015-10-11 18:11:18.112874539 -0500
+++ python/lsst/meas/astrom/multiindex.py 2015-10-11 18:11:03.155919495 -0500
@@ -144,7 +144,7 @@
@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()

0 comments on commit c38cc6b

Please sign in to comment.