Abort trap 6 with FITS files. Sometimes.
See original GitHub issueI sometimes get reproducibly unreproduceable Abort trap: 6
failures when using astropy.io.fits
. I had originally reported this in https://github.com/radio-astro-tools/spectral-cube/pull/221, but today I’ve finally found a case where this definitely happens using astropy.io.fits
, not spectral_cube
. Abort trap: 6
kills the python code entirely, dropping me back to the shell, preventing me from using any debugger.
The problem is perverse. I have a variable, m0_full
, that is read using fits.getdata
. This line:
stddev = mad_std(m0_full[np.isfinite(m0_full)]) * jtok
is the most likely point of failure, since it is the new line I added that caused my code to start crashing. However, if I attempt to add a print statement immediately prior to that line, print("stddev for {0}".format(fn))
(where fn
is the filename), the abort trap goes away.
I’ve noted the same behavior in SpectralCube
: when I get the abort traps, if I add print or debug statements throughout the code to try to identify where the abort trap is happening, it no longer happens.
So, can anyone offer tips on how to track down a bug of this variety? All of my usual tools are failing.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Full traceback:
I’m pretty sure this is basically the same issue as https://github.com/astropy/astropy/issues/7412 which was fixed by https://github.com/astropy/astropy/pull/7688. As a result, I’m going to close this issue, but @keflavich - please re-open if you still run into these kinds of issues with the latest versions of astropy.