{"action":"opened","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/5297","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/5297/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/5297/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/5297/events","html_url":"https://github.com/astropy/astropy/issues/5297","id":174628194,"number":5297,"title":"Abort trap 6 with FITS files.  Sometimes.","user":{"login":"keflavich","id":143715,"avatar_url":"https://avatars.githubusercontent.com/u/143715?v=3","gravatar_id":"","url":"https://api.github.com/users/keflavich","html_url":"https://github.com/keflavich","followers_url":"https://api.github.com/users/keflavich/followers","following_url":"https://api.github.com/users/keflavich/following{/other_user}","gists_url":"https://api.github.com/users/keflavich/gists{/gist_id}","starred_url":"https://api.github.com/users/keflavich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keflavich/subscriptions","organizations_url":"https://api.github.com/users/keflavich/orgs","repos_url":"https://api.github.com/users/keflavich/repos","events_url":"https://api.github.com/users/keflavich/events{/privacy}","received_events_url":"https://api.github.com/users/keflavich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-01T21:17:00Z","updated_at":"2016-09-01T21:17:00Z","closed_at":null,"body":"I 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.\r\n\r\nThe problem is perverse.  I have a variable, `m0_full`, that is read using `fits.getdata`.  This line:\r\n`stddev = mad_std(m0_full[np.isfinite(m0_full)]) * jtok`\r\nis 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.\r\n\r\nI'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.\r\n\r\nSo, can anyone offer tips on how to track down a bug of this variety?  All of my usual tools are failing."}}
{"actor":{"display_login":"keflavich"}}