question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Abort trap 6 with FITS files. Sometimes.

See original GitHub issue

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.

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:closed
  • Created 7 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
keflavichcommented, Sep 9, 2016

Full traceback:

Thread 1 received signal SIGABRT, Aborted.
0x00007fff884d1866 in ?? () from /usr/lib/system/libsystem_kernel.dylib
(gdb) bt
#0  0x00007fff884d1866 in ?? () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff8deba35c in pthread_kill () from /usr/lib/system/libsystem_pthread.dylib
#2  0x00007fff8d5beb1a in abort () from /usr/lib/system/libsystem_c.dylib
#3  0x00007fff8d5bec91 in abort_report_np () from /usr/lib/system/libsystem_c.dylib
#4  0x00007fff8d5e2860 in __chk_fail () from /usr/lib/system/libsystem_c.dylib
#5  0x00007fff8d5e2830 in __chk_fail_overflow () from /usr/lib/system/libsystem_c.dylib
#6  0x00007fff8d5e2d5a in __sprintf_chk () from /usr/lib/system/libsystem_c.dylib
#7  0x0000000105baec0e in wcshdo_util.constprop () from /Users/adam/repos/astropy/astropy/wcs/_wcs.cpython-35m-darwin.so
#8  0x0000000105bb537f in wcshdo () from /Users/adam/repos/astropy/astropy/wcs/_wcs.cpython-35m-darwin.so
#9  0x0000000105bc128b in PyWcsprm_to_header () from /Users/adam/repos/astropy/astropy/wcs/_wcs.cpython-35m-darwin.so
#10 0x000000010004fe5c in PyCFunction_Call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#11 0x00000001000bd2df in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#12 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#13 0x00000001000c19ae in fast_function () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#14 0x00000001000bd434 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#15 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#16 0x00000001000b7b1e in PyEval_EvalCodeEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#17 0x000000010003430f in function_call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#18 0x000000010000fd73 in PyObject_Call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#19 0x00000001000bdec8 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#20 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#21 0x00000001000b7b1e in PyEval_EvalCodeEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#22 0x000000010003430f in function_call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#23 0x000000010000fd73 in PyObject_Call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#24 0x00000001000bdec8 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#25 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#26 0x00000001000b7b1e in PyEval_EvalCodeEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#27 0x000000010003430f in function_call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#28 0x000000010000fd73 in PyObject_Call () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#29 0x00000001000bdec8 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#30 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#31 0x00000001000c19ae in fast_function () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#32 0x00000001000bd434 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#33 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#34 0x00000001000c19ae in fast_function () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#35 0x00000001000bd434 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#36 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#37 0x00000001000c19ae in fast_function () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#38 0x00000001000bd434 in PyEval_EvalFrameEx () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
---Type <return> to continue, or q <return> to quit---
#39 0x00000001000c10c3 in _PyEval_EvalCodeWithName () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#40 0x00000001000b7ac1 in PyEval_EvalCode () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#41 0x00000001000e6937 in PyRun_FileExFlags () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#42 0x00000001000e60ea in PyRun_SimpleFileExFlags () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#43 0x00000001000fcc5b in Py_Main () from /Users/adam/anaconda/envs/astropy35/lib/libpython3.5m.dylib
#44 0x0000000100000dc7 in main ()
0reactions
astrofrogcommented, Oct 21, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GNU Make "Abort trap: 6" after gcc call however call is valid ...
This message tells you that the command make executed (gcc in this case) exited with a non-success result. In this case, "Abort trap:...
Read more >
Xcode error: Abort Trap 6 | Apple Developer Forums
Solution 1: go to Build settings an choose compilation mode 'Whole Module' instead of 'Incremental' - I'm not sure if this solution is...
Read more >
What does Biber's Abort Trap 6 mean? - LaTeX Stack Exchange
1) First, identify the entries which are causing the problem. As Paul suggested above, the best way to do this is to split...
Read more >
What does it mean when your C program outputs 'Abort trap: 6'?
abort () is often called when an assertion fails; that is, when the expression passed to the assert(EXPR) macro evaluates to false. Some...
Read more >
I got the error msg: "Abort trap: 6" - Facebook
I got the error msg: "Abort trap: 6". I have no idea what does this mean. Anyone experienced the same problem? I am...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found