Skip to content

astropy.test() has error Segmentation fault (core dumped) #5497

Description

@katehuseva

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?

Activity

  1. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member

    @katehuseva - could you post the full output for astropy.test(), which will include e.g. the python and dependency versions?

  2. katehuseva commented on Nov 23, 2016

    @katehuseva
    Author

    @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)
    
  3. pllim commented on Nov 23, 2016

    @pllim
    Member

    Perhaps gdb will give a more useful segfault diagnostic. See https://wiki.python.org/moin/DebuggingWithGdb

  4. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member
  5. katehuseva commented on Nov 23, 2016

    @katehuseva
    Author

    @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: 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 ........[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)

  6. pllim commented on Nov 23, 2016

    @pllim
    Member

    @taldcroft ?

     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;}
    
  7. pllim commented on Nov 23, 2016

    @pllim
    Member
  8. MSeifert04 commented on Nov 23, 2016

    @MSeifert04
    Contributor

    Would be good to know if the error is also present in the latest stable release (1.2.1).

  9. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member

    @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.

  10. added
    Affects-devPRs and issues that do not impact an existing Astropy release
    on Nov 23, 2016
  11. added this to the v1.0.11 milestone on Nov 23, 2016
  12. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member

    @pllim - if it only affects dev, then the right milestone is 1.3 - did you check if it affects 1.2.1?

  13. pllim commented on Nov 23, 2016

    @pllim
    Member

    @astrofrog , #5319 is marked for 1.0.x. Anyways, feel free to retag as needed.

  14. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member

    Ah sorry my bad! You're right :)

  15. MSeifert04 commented on Nov 23, 2016

    @MSeifert04
    Contributor

    You need another tag "affects-backported-but-not-released-change" 😄

  16. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member

    Bisecting 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 indexing
    
    

    so as suspected, this is due to #5319.

    cc @saimn

  17. saimn commented on Nov 23, 2016

    @saimn
    Contributor

    I'll have a look !

  18. astrofrog commented on Nov 23, 2016

    @astrofrog
    Member

    @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 :)

  19. saimn commented on Nov 23, 2016

    @saimn
    Contributor

    @astrofrog - yep, I already have the docker image running the tests, great to have this !

  20. saimn commented on Nov 23, 2016

    @saimn
    Contributor

    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 ...

  21. saimn commented on Nov 23, 2016

    @saimn
    Contributor

    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 !

  22. saimn commented on Nov 24, 2016

    @saimn
    Contributor

    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).

  23. added 2 commits that reference this issue on Nov 24, 2016
    20d52c6
    102e58c
  24. astrofrog commented on Nov 24, 2016

    @astrofrog
    Member

    @katehuseva - this should be fixed in the latest developer version of Astropy, but please let us know if not!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions