Repository navigation
astropy.test() has error Segmentation fault (core dumped) #5497
Description
Activity
@katehuseva - could you post the full output for astropy.test(), which will include e.g. the python and dependency versions?
@astrofrog yes, sure. The full output for astropy.test()
>>> import astropy >>> astropy.test() ========================================== test session starts =========================================== platform linux2 -- Python 2.7.12, pytest-2.8.3, py-1.4.30, pluggy-0.3.1 Running tests with Astropy version 1.3.dev16418. Running tests in /usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy. Date: 2016-11-23T15:14:33 Platform: Linux-3.19.0-25-generic-i686-with-Ubuntu-14.04-trusty Executable: /usr/bin/python Full Python Version: 2.7.12 (default, Jul 18 2016, 15:04:44) [GCC 4.8.4] encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 20 byteorder: little float info: dig: 15, mant_dig: 15 Numpy: 1.11.2 Scipy: not available Matplotlib: not available h5py: not available Pandas: not available rootdir: /usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy, inifile: collected 11234 items ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/_erfa/tests/test_erfa.py ....... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/analytic_functions/tests/test_blackbody.py s.... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/config/tests/test_configs.py ............... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/constants/tests/test_constant.py ................ ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/constants/tests/test_pickle.py xxxxxxxxx ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_convolve.py ............................................................................................................... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_convolve_fft.py ................................................................................................................................................................................................................................................................................................................................................... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_convolve_kernels.py .............................................................................. ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_discretize.py ...s...........s........ss..... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_kernel_class.py ssssssss................................ssss....................................ssss................................................................................ssss................ ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_pickle.py .xx.xx.xx ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_angles.py .................................................................................... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_angular_separation.py .... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_api_ape5.py ....s ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_arrays.py .......................... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_atc_replacements.py ........ ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_celestial_transformations.py .............. ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_distance.py .s....... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_earth.py ..............s..............s ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_formatting.py .................... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_frames.py ........................... ../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_funcs.py ..Segmentation fault (core dumped)Perhaps
gdbwill give a more useful segfault diagnostic. See https://wiki.python.org/moin/DebuggingWithGdbI'm seeing the same failure in https://circleci.com/gh/astrofrog/astropy/30?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link - debugging
@pllim Running with gdb:
(gdb) run astro.py
Starting program: /usr/bin/python astro.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[New Thread 0xb60beb40 (LWP 8107)]
[New Thread 0xb58bdb40 (LWP 8108)]
[New Thread 0xb40bcb40 (LWP 8109)]
========================================== test session starts ===========================================
platform linux2 -- Python 2.7.12, pytest-2.8.3, py-1.4.30, pluggy-0.3.1
[Thread 0xb60beb40 (LWP 8107) exited]
[Thread 0xb40bcb40 (LWP 8109) exited]
[Thread 0xb58bdb40 (LWP 8108) exited]Running tests with Astropy version 1.3.dev16418.
Running tests in /usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy.Date: 2016-11-23T16:46:06
Platform: Linux-3.19.0-25-generic-i686-with-Ubuntu-14.04-trusty
Executable: /usr/bin/python
Full Python Version:
2.7.12 (default, Jul 18 2016, 15:04:44)
[GCC 4.8.4]encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 20
byteorder: little
float info: dig: 15, mant_dig: 15Numpy: 1.11.2
Scipy: not available
Matplotlib: not available
h5py: not available
Pandas: not availablerootdir: /usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy, inifile:
collected 11234 items../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/_erfa/tests/test_erfa.py .......
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/analytic_functions/tests/test_blackbody.py s....
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/config/tests/test_configs.py ...............
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/constants/tests/test_constant.py ................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/constants/tests/test_pickle.py xxxxxxxxx
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_convolve.py ...............................................................................................................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_convolve_fft.py ...................................................................................................................................................................................................................................................................................................................................................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_convolve_kernels.py ..............................................................................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_discretize.py ...s...........s........ss.....
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_kernel_class.py ssssssss................................ssss....................................ssss................................................................................ssss................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/convolution/tests/test_pickle.py .xx.xx.xx
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_angles.py ....................................................................................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_angular_separation.py ....
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_api_ape5.py ....s
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_arrays.py ..........................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_atc_replacements.py ........
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_celestial_transformations.py ........[New Thread 0xb40bcb40 (LWP 8148)]
[New Thread 0xb58bdb40 (LWP 8149)]
[New Thread 0xb60beb40 (LWP 8150)]
......
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_distance.py .s.......
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_earth.py ..............s..............s
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_formatting.py ....................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_frames.py ...........................
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_funcs.py ..
Program received signal SIGSEGV, Segmentation fault.
__pyx_pf_7astropy_2io_5ascii_7cparser_7CParser_6read_header (__pyx_v_self=0xad117984)
at astropy/io/ascii/cparser.c:5128
5128 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->tokenizer->output_len[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = LINE; goto __pyx_L1_error;}
(gdb)astropy/io/ascii/cparser.c:5128 5128 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->tokenizer->output_len[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = LINE; goto __pyx_L1_error;}Looks like that comes from https://github.com/astropy/astropy/blob/master/astropy/io/ascii/cparser.pyx#L315
Would be good to know if the error is also present in the latest stable release (1.2.1).
@saimn - I think this is likely due to #5319 - could you investigate? (I'll confirm by bisecting soon)
Note that we also see this error on CircleCi which I've now enabled for Astropy. So you should be able to reproduce the issue by doing:
docker run -i -t astropy/astropy-32bit-test-env:1.7 bash apt-get install git git clone git://github.com/astropy/astropy cd astropy python setup.py test -P coordinates@mhvk - unlikely to be 1.2.1 since I think CircleCI didn't see this error before a few weeks ago, but it'd be great if someone could try.
- addedAffects-devPRs and issues that do not impact an existing Astropy releasePRs and issues that do not impact an existing Astropy release
on Nov 23, 2016 @pllim - if it only affects dev, then the right milestone is 1.3 - did you check if it affects 1.2.1?
@astrofrog , #5319 is marked for 1.0.x. Anyways, feel free to retag as needed.
Ah sorry my bad! You're right :)
You need another tag "affects-backported-but-not-released-change" 😄
Reacted by Thomas Robitaille, P. L. Lim and Brigitta SipőczBisecting in the 32-bit docker image gives:
135ec565025514e105135a9c5112e01ecc026907 is the first bad commit commit 135ec565025514e105135a9c5112e01ecc026907 Author: Simon Conseil <[email protected]> Date: Mon Sep 19 14:30:31 2016 +0200 Use off_t instead of unsigned long for file indexingso as suspected, this is due to #5319.
cc @saimn
Reacted by P. L. LimI'll have a look !
Reacted by Thomas Robitaille@saimn - note my comment higher up if you want to use the docker image to debug, since it will save a lot of time setting up a 32-bit system :)
@astrofrog - yep, I already have the docker image running the tests, great to have this !
Ok, this is the minimum code to reproduce:
>>> from astropy.io import ascii >>> cdata = 'astropy/coordinates/data/constellation_data_roman87.dat' >>> ascii.read(cdata, names=['ral', 'rau', 'decl', 'name']) Segmentation fault (core dumped)But debugging seems tricky inside the docker image. Core dumps are generated on the host and I cannot get gdb to generate a proper backtrace ...
After adding a few prints and without a working gdb, I have no idea: the code that crashes is not related to 135ec56 , the output_len array is initialiazed, I don't know !
I didn't find the root of the issue with
off_t, but if I replace its use with other types (size_t,long,unsigned long, ...) it no more crashes. So, I will make a PR to replace it (which also makes #5501 useless).- added 2 commits that reference this issue
on Nov 24, 2016 @katehuseva - this should be fixed in the latest developer version of Astropy, but please let us know if not!
Hi guys,
After running astropy.test() have the error:
../../usr/local/lib/python2.7/dist-packages/astropy-1.3.dev16418-py2.7-linux-i686.egg/astropy/coordinates/tests/test_funcs.py ..Segmentation fault (core dumped)
Could you recommend something?