schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.

Home Page:https://pymol.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CmdGetUnusedName GIL bug

speleo3 opened this issue · comments

Crash observed on Arch Linux with python=3.12 and schrodinger::pymol=2.5.7, and also with open-source pymol compiled from source.

pymol -ckd "cmd.get_unused_name()"
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x0000555555752c85 in _PyInterpreterState_GET () at /usr/local/src/conda/python-3.12.0/Include/internal/pycore_pystate.h:118
118     /usr/local/src/conda/python-3.12.0/Include/internal/pycore_pystate.h: No such file or directory.
#0  0x0000555555752c85 in _PyInterpreterState_GET () at /usr/local/src/conda/python-3.12.0/Include/internal/pycore_pystate.h:118
#1  get_state () at /usr/local/src/conda/python-3.12.0/Objects/obmalloc.c:866
#2  _PyObject_Malloc (nbytes=46, ctx=<optimized out>) at /usr/local/src/conda/python-3.12.0/Objects/obmalloc.c:1563
#3  PyObject_Malloc (size=<optimized out>) at /usr/local/src/conda/python-3.12.0/Objects/obmalloc.c:801
#4  PyUnicode_New (maxchar=127, size=<optimized out>) at /usr/local/src/conda/python-3.12.0/Objects/unicodeobject.c:1208
#5  unicode_decode_utf8 (s=<optimized out>, size=5, error_handler=_Py_ERROR_UNKNOWN, errors=0x0, consumed=0x0)
    at /usr/local/src/conda/python-3.12.0/Objects/unicodeobject.c:4647
#6  0x00007ffff69e1125 in CmdGetUnusedName(_object*, _object*) ()
   from /home/thomas/miniconda3/envs/ci-231206/lib/python3.12/site-packages/pymol/_cmd.cpython-312-x86_64-linux-gnu.so

Looks like a typical GIL issue and is probably an easy fix.

I compiled the last open source version with python 3.12 and got the following:
/usr/local/lib64/python3.12/site-packages/pmg_tk/skins/normal/init.py:852: SyntaxWarning: invalid escape sequence '.'
g = re.search("(.)(..)$", save_file)
/usr/local/lib64/python3.12/site-packages/pmg_tk/skins/normal/init.py:892: SyntaxWarning: invalid escape sequence '.'
if re.search(".pym*$|.PYM*$",ofile):
/usr/local/lib64/python3.12/site-packages/chempy/sdf.py:23: SyntaxWarning: invalid escape sequence '\s'
getkee = re.compile("^>\s+<([^>])>")
/usr/local/lib64/python3.12/site-packages/chempy/sdf.py:24: SyntaxWarning: invalid escape sequence '\s'
gettag = re.compile("^>\s+<[^>]
>\s+((.))")
/usr/local/lib64/python3.12/site-packages/pymol/viewing.py:939: SyntaxWarning: invalid escape sequence '.'
re_pat = re.compile("[0-9]+.")
/usr/local/lib64/python3.12/site-packages/pymol/viewing.py:952: SyntaxWarning: invalid escape sequence '.'
new_file = re.sub(".pse$",".psw",new_file,re.I)
/usr/local/lib64/python3.12/site-packages/pymol/viewing.py:954: SyntaxWarning: invalid escape sequence '.'
new_file = re.sub(".psw$",".pse",new_file,re.I)
/usr/local/lib64/python3.12/site-packages/pymol/wizard/pseudoatom.py:13: SyntaxWarning: invalid escape sequence '\8'
self.prefix = 'Label text: \888'
/usr/local/lib64/python3.12/site-packages/pymol/moving.py:733: SyntaxWarning: invalid escape sequence '\s'
input = re.sub("\s"," ",specification)
/usr/local/lib64/python3.12/site-packages/pymol/plugins/installation.py:23: SyntaxWarning: invalid escape sequence '\p'
'''
/usr/local/lib64/python3.12/site-packages/pymol/parser.py:48: SyntaxWarning: invalid escape sequence '['
remove_lists_re = re.compile("[[^\]]
]")
/usr/local/lib64/python3.12/site-packages/pymol/parser.py:408: SyntaxWarning: invalid escape sequence '.'
if re.search(".py$|.pym$",path) is not None:
/usr/local/lib64/python3.12/site-packages/pymol/internal.py:252: SyntaxWarning: invalid escape sequence '.'
if re.search("[0-9].png$",fname): # remove numbering, etc.
/usr/local/lib64/python3.12/site-packages/pymol/internal.py:253: SyntaxWarning: invalid escape sequence '.'
fname = re.sub("[0-9]
.png$","",fname)
/usr/local/lib64/python3.12/site-packages/pymol/internal.py:254: SyntaxWarning: invalid escape sequence '.'
if re.search("[0-9].ppm$",fname):
/usr/local/lib64/python3.12/site-packages/pymol/internal.py:257: SyntaxWarning: invalid escape sequence '.'
fname = re.sub("[0-9]
.ppm$","",fname)
/usr/local/lib64/python3.12/site-packages/pymol/movie.py:818: SyntaxWarning: invalid escape sequence '\W'
'''Return full path to executable or None.
/usr/lib/python3.12/site-packages/setuptools/command/sdist.py:119: SetuptoolsDeprecationWarning: build_py command does not inherit from setuptools' build_py.
!!

    ********************************************************************************
    Custom 'build_py' does not implement 'get_data_files_without_manifest'.
    Please extend command classes from setuptools instead of distutils.

    See https://peps.python.org/pep-0632/ for details.
    ********************************************************************************

!!
self._add_data_files(self._safe_data_files(build_py))
copying data -> /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/data
copying test -> /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/test
copying examples -> /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/examples

I can launch pymol...but then, as I run apbs tool I get a core dump:
PyMOL>fetch 1rmz
TITLE Crystal structure of the catalytic domain of human MMP12 complexed with the inhibitor NNGH at 1.3 A resolution
ExecutiveLoad-Detail: Detected mmCIF
CmdLoad: "./1rmz.cif" loaded as "1rmz".
/usr/local/lib64/python3.12/site-packages/pmg_tk/startup/apbsplugin.py:1459: SyntaxWarning: invalid escape sequence '\d'
"""
/usr/local/lib64/python3.12/site-packages/pmg_tk/startup/apbsplugin.py:1506: SyntaxWarning: invalid escape sequence '\d'
unassigned = re.compile('REMARK 5 (\d+) \w in').findall(f.read()) # Text contains PQR output string
Running:
prog=/usr/local/bin/apbs
args=('/usr/local/bin/apbs', '--version')
Results were:
Return value: 13
Output:
1.5


APBS -- Adaptive Poisson-Boltzmann Solver
Version 1.5

Nathan A. Baker (nathan.baker@pnnl.gov)
Pacific Northwest National Laboratory

Additional contributing authors listed in the code documentation.

Copyright (c) 2010-2014 Battelle Memorial Institute. Developed at the Pacific
Northwest National Laboratory, operated by Battelle Memorial Institute, Pacific
Northwest Division for the U.S. Department of Energy.

Portions Copyright (c) 2002-2010, Washington University in St. Louis.
Portions Copyright (c) 2002-2010, Nathan A. Baker.
Portions Copyright (c) 1999-2002, The Regents of the University of California.
Portions Copyright (c) 1995, Michael Holst.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the developer nor the names of its contributors may be
  used to endorse or promote products derived from this software without
  specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

APBS uses FETK (the Finite Element ToolKit) to solve the
Poisson-Boltzmann equation numerically.  FETK is a portable collection
of finite element modeling class libraries developed by the Michael Holst
research group and written in an object-oriented form of C.  FEtk is
designed to solve general coupled systems of nonlinear partial differential
equations using adaptive finite element methods, inexact Newton methods,
and algebraic multilevel methods.  More information about FEtk may be found
at <http://www.FEtk.ORG>.

APBS also uses Aqua to solve the Poisson-Boltzmann equation numerically.  
Aqua is a modified form of the Holst group PMG library <http://www.FEtk.ORG>
which has been modified by Patrice Koehl
<http://koehllab.genomecenter.ucdavis.edu/> for improved efficiency and
memory usage when solving the Poisson-Boltzmann equation.

Please cite your use of APBS as:

Baker NA, Sept D, Joseph S, Holst MJ, McCammon JA. Electrostatics of
nanosystems: application to microtubules and the ribosome. Proc.
Natl. Acad. Sci. USA 98, 10037-10041 2001.

This executable compiled on Apr 12 2020 at 11:49:56

trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/ext/bin/pdb2pqr.py
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/ext/bin/pdb2pqr
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/freemol/bin/pdb2pqr.py
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/freemol/bin/pdb2pqr
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/freemol/share/apbs/pdb2pqr.py
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/freemol/share/apbs/pdb2pqr
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/freemol/share/pdb2pqr/pdb2pqr.py
trying /usr/local/lib64/python3.12/site-packages/pymol/pymol_path/freemol/share/pdb2pqr/pdb2pqr
trying /sw/share/pdb2pqr/pdb2pqr.py
trying /sw/share/pdb2pqr/pdb2pqr
trying /sw/share/apbs/tools/manip/pdb2pqr.py
trying /sw/share/apbs/tools/manip/pdb2pqr
trying /sw/share/apbs-mpi-openmpi/tools/manip/pdb2pqr.py
trying /sw/share/apbs-mpi-openmpi/tools/manip/pdb2pqr
trying /sw/share/apbs-mpi-lammpi/tools/manip/pdb2pqr.py
trying /sw/share/apbs-mpi-lammpi/tools/manip/pdb2pqr
trying /usr/local/share/tools/manip/pdb2pqr.py
trying /usr/local/share/tools/manip/pdb2pqr
trying /usr/local/gromacs/bin/pdb2pqr.py
trying /usr/local/gromacs/bin/pdb2pqr
trying /usr/local/concoord_2.1.2/bin/pdb2pqr.py
trying /usr/local/concoord_2.1.2/bin/pdb2pqr
trying /usr/local/cns_solve_1.3/intel-x86_64bit-linux/bin/pdb2pqr.py
trying /usr/local/cns_solve_1.3/intel-x86_64bit-linux/bin/pdb2pqr
trying /usr/local/cns_solve_1.3/intel-x86_64bit-linux/utils/pdb2pqr.py
trying /usr/local/cns_solve_1.3/intel-x86_64bit-linux/utils/pdb2pqr
trying /usr/local/ccp4_master/arp_warp_8.0/bin/bin-x86_64-Linux/pdb2pqr.py
trying /usr/local/ccp4_master/arp_warp_8.0/bin/bin-x86_64-Linux/pdb2pqr
trying /usr/local/ccp4_master/arp_warp_8.0/bin/bin-x86_64-Linux/pdb2pqr.py
trying /usr/local/ccp4_master/arp_warp_8.0/bin/bin-x86_64-Linux/pdb2pqr
trying /usr/local/ccp4_master/ccp4-8.0/etc/pdb2pqr.py
trying /usr/local/ccp4_master/ccp4-8.0/etc/pdb2pqr
trying /usr/local/ccp4_master/ccp4-8.0/bin/pdb2pqr.py
trying /usr/local/ccp4_master/ccp4-8.0/bin/pdb2pqr
trying /usr/local/phenix-1.21rc1-5156/build/bin/pdb2pqr.py
trying /usr/local/phenix-1.21rc1-5156/build/bin/pdb2pqr
trying /usr/local/concoord_2.1.2/bin/pdb2pqr.py
trying /usr/local/concoord_2.1.2/bin/pdb2pqr
trying /usr/local/ccp4_master/arp_warp_8.0/bin/bin-x86_64-Linux/pdb2pqr.py
trying /usr/local/ccp4_master/arp_warp_8.0/bin/bin-x86_64-Linux/pdb2pqr
trying /usr/local/ccp4_master/ccp4-8.0/etc/pdb2pqr.py
trying /usr/local/ccp4_master/ccp4-8.0/etc/pdb2pqr
trying /usr/local/ccp4_master/ccp4-8.0/bin/pdb2pqr.py
trying /usr/local/ccp4_master/ccp4-8.0/bin/pdb2pqr
trying /usr/lib64/ccache/pdb2pqr.py
trying /usr/lib64/ccache/pdb2pqr
trying /usr/local/bin/pdb2pqr.py
trying /usr/local/bin/pdb2pqr
GENERATING PQR FILE via PDB2PQR
Erasing contents of /tmp/pymol-generated.pdb in order to generate new PDB file
Segmentation fault (core dumped)

Are the two things related? Anything used to be fine with python 3.11
Thanks