Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select_atoms("around 0.0 protein") produces segmentation fault. #2656

Closed
jonekoo opened this issue Apr 7, 2020 · 1 comment · Fixed by #2665
Closed

select_atoms("around 0.0 protein") produces segmentation fault. #2656

jonekoo opened this issue Apr 7, 2020 · 1 comment · Fixed by #2665

Comments

@jonekoo
Copy link

jonekoo commented Apr 7, 2020

Expected behavior

The result should be an empty AtomGroup.

Actual behavior

A segmentation fault results and the program crashes:

~$ python aroundfail.py
/home/(myusername)/anaconda3/envs/py37mdanalysis/lib/python3.7/site-packages/MDAnalysisTests/__init__.py:125: MatplotlibDeprecationWarning: The 'warn' parameter of use() is deprecated since Matplotlib 3.1 and will be removed in 3.3.  If any parameter follows 'warn', they should be pass as keyword, not positionally.
  matplotlib.use('agg', warn=False)
Segmentation fault (core dumped)

gdb backtrace:

~$ gdb -ex r --args python aroundfail.py
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...done.
Starting program: /home/jouni/anaconda3/envs/py37mdanalysis/bin/python aroundfail.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
/home/jouni/anaconda3/envs/py37mdanalysis/lib/python3.7/site-packages/MDAnalysisTests/__init__.py:125: MatplotlibDeprecationWarning: The 'warn' parameter of use() is deprecated since Matplotlib 3.1 and will be removed in 3.3.  If any parameter follows 'warn', they should be pass as keyword, not positionally.
  matplotlib.use('agg', warn=False)

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff2c225fb in __pyx_f_10MDAnalysis_3lib_6nsgrid_7_NSGrid_fill_grid(__pyx_obj_10MDAnalysis_3lib_6nsgrid__NSGrid*, __Pyx_memviewslice) ()
   from /home/jouni/anaconda3/envs/py37mdanalysis/lib/python3.7/site-packages/MDAnalysis/lib/nsgrid.cpython-37m-x86_64-linux-gnu.so
(gdb) backtrace
#0  0x00007ffff2c225fb in __pyx_f_10MDAnalysis_3lib_6nsgrid_7_NSGrid_fill_grid(__pyx_obj_10MDAnalysis_3lib_6nsgrid__NSGrid*, __Pyx_memviewslice) ()
   from /home/jouni/anaconda3/envs/py37mdanalysis/lib/python3.7/site-packages/MDAnalysis/lib/nsgrid.cpython-37m-x86_64-linux-gnu.so
#1  0x00007ffff2c2bd33 in __pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_1__init__(_object*, _object*, _object*) () from /home/jouni/anaconda3/envs/py37mdanalysis/lib/python3.7/site-packages/MDAnalysis/lib/nsgrid.cpython-37m-x86_64-linux-gnu.so
#2  0x000000000816c208 in type_call (kwds=0x7fffeed75f50, args=0x7ffff05d70f0, type=<optimized out>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/typeobject.c:971
#3  _PyObject_FastCallKeywords () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:199
#4  0x00000000081d25c6 in call_function (kwnames=0x7ffff2edfc80, oparg=<optimized out>, pp_stack=<synthetic pointer>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4619
#5  _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3139
#6  0x00000000081158f9 in _PyEval_EvalCodeWithName () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3930
#7  0x0000000008116c60 in _PyFunction_FastCallDict () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:376
#8  0x00000000081ced6a in do_call_core (kwdict=0x7fffeed75eb0, callargs=0x7fffeefda190, func=0x7ffff2cba710) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4645
#9  _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3191
#10 0x00000000081160b8 in _PyEval_EvalCodeWithName () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3930
#11 0x00000000081649e7 in _PyFunction_FastCallKeywords () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:433
#12 0x00000000081ce2e7 in call_function (kwnames=0x7ffff3296aa0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4616
#13 _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3139
#14 0x00000000081158f9 in _PyEval_EvalCodeWithName () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3930
#15 0x00000000081649e7 in _PyFunction_FastCallKeywords () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:433
#16 0x00000000081ce2e7 in call_function (kwnames=0x7ffff2b6e320, oparg=<optimized out>, pp_stack=<synthetic pointer>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4616
#17 _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3139
#18 0x000000000816475b in function_code_fastcall (globals=<optimized out>, nargs=2, args=<optimized out>, co=<optimized out>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:283
#19 _PyFunction_FastCallKeywords () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:408
#20 0x00000000081cd4a0 in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4616
#21 _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3110
#22 0x00000000081160b8 in _PyEval_EvalCodeWithName () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3930
#23 0x0000000008116a35 in _PyFunction_FastCallDict () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:376
#24 0x0000000008134e03 in _PyObject_Call_Prepend () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:908
#25 0x000000000812775e in PyObject_Call () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:245
#26 0x00000000081ced6a in do_call_core (kwdict=0x7fffef1add70, callargs=0x7ffff02f5310, func=0x7ffffe2e51e0) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4645
#27 _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3191
#28 0x00000000081158f9 in _PyEval_EvalCodeWithName () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3930
#29 0x00000000081649e7 in _PyFunction_FastCallKeywords () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Objects/call.c:433
#30 0x00000000081d1ab9 in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:4616
#31 _PyEval_EvalFrameDefault () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3093
#32 0x00000000081158f9 in _PyEval_EvalCodeWithName () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3930
#33 0x0000000008116824 in PyEval_EvalCodeEx () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:3959
#34 0x000000000811684c in PyEval_EvalCode (co=<optimized out>, globals=<optimized out>, locals=<optimized out>) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/ceval.c:524
#35 0x000000000822c684 in run_mod () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/pythonrun.c:1035
#36 0x0000000008236ab1 in PyRun_FileExFlags () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/pythonrun.c:988
#37 0x0000000008236ca3 in PyRun_SimpleFileExFlags () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Python/pythonrun.c:429
#38 0x0000000008237d95 in pymain_run_file (p_cf=0x7ffffffeda60, filename=0x8371740 L"aroundfail.py", fp=0x83b9ff0) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Modules/main.c:428
#39 pymain_run_filename (cf=0x7ffffffeda60, pymain=0x7ffffffedb70) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Modules/main.c:1607
#40 pymain_run_python (pymain=0x7ffffffedb70) at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Modules/main.c:2868
#41 pymain_main () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Modules/main.c:3029
#42 0x0000000008237ebc in _Py_UnixMain () at /home/conda/feedstock_root/build_artifacts/python_1585001848288/work/Modules/main.c:3064
#43 0x00007ffffee01b97 in __libc_start_main (main=0x80f64a0 <main>, argc=2, argv=0x7ffffffedcc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffffffedcb8) at ../csu/libc-start.c:310
#44 0x00000000081dcbd0 in _start () at ../sysdeps/x86_64/elf/start.S:103

Code to reproduce the behavior

import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PSF, DCD,  GRO, PDB, TPR, XTC, TRR,  PRMncdf, NCDF

u = mda.Universe(PSF, DCD)
failing = u.select_atoms('around 0.0 resid 1')

Current version of MDAnalysis

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)")
    0.20.1
    The problem is reproducable in multiple versions of MDAnalysis. This is what I have currently.

  • Which version of Python (python -V)?
    Python 3.7.6
    Does not seem to be specific to Python version either.

  • Which operating system?
    Ubuntu 18.04.4 LTS (Windows Subsystem for Linux)
    Found the problem originally in another Linux, so it does not seem to be OS-specific.

@orbeckst
Copy link
Member

orbeckst commented Apr 7, 2020

I can reproduce the segfault with the latest develop on macOS 10.12.6 with Python 3.7.6.

richardjgowers added a commit that referenced this issue Apr 20, 2020
segfaulting on zero box size
richardjgowers added a commit that referenced this issue Apr 20, 2020
richardjgowers added a commit that referenced this issue Apr 21, 2020
segfaulting on zero box size
richardjgowers added a commit that referenced this issue Apr 21, 2020
richardjgowers added a commit that referenced this issue Jun 6, 2020
segfaulting on zero box size
richardjgowers added a commit that referenced this issue Jun 6, 2020
richardjgowers added a commit that referenced this issue Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants