Colvars / colvars

Collective variables library for molecular simulation and analysis programs
http://colvars.github.io/
GNU Lesser General Public License v3.0
196 stars 57 forks source link

VMD seg fault on syntax error in cv definition #38

Closed cmayne closed 8 years ago

cmayne commented 9 years ago

This bug refers to the implementation of Colvars in VMD. When configuring the colvar, any error in syntax causes a seg fault that terminates VMD. As a simple example, the following code results in a seg fault when entered into tkcon console (VMD console dump is given below):

mol new 1GWR
set sel1 [atomselect top "noh chain A and resid 533 to 536"]
set sel2 [atomselect top "noh chain A and resid 339 to 351"]
cv molid top
cv config \
"colvar {
    name cn
    coordNum {
        group1 { atomNumbers [$sel1 get serial] }
        group2 { atomNumbers [$sel2 get serial] }
    }}"

The error is that the closing braces are on the same line, i.e., the following code is the corrected version:

mol new 1GWR
set sel1 [atomselect top "noh chain A and resid 533 to 536"]
set sel2 [atomselect top "noh chain A and resid 339 to 351"]
cv molid top
cv config \
"colvar {
    name cn
    coordNum {
        group1 { atomNumbers [$sel1 get serial] }
        group2 { atomNumbers [$sel2 get serial] }
    }
}"

In my experience, this occurs with any syntactical error provided either directly within VMD, as shown above, or by providing a config file. Here is the console data from VMD demonstrating the seg fault, including the Version of VMD (I can reproduce this on Mac OS X version of VMD as well):

Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014) Info) http://www.ks.uiuc.edu/Research/vmd/
Info) Email questions and bug reports to vmd@ks.uiuc.edu
Info) Please include this reference in published work using VMD:
Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38. Info) ------------------------------------------------------------- Info) Multithreading available, 8 CPUs detected. Info) Free system memory: 23441MB (97%) Info) Creating CUDA device pool and initializing hardware... Info) Detected 1 available CUDA accelerator: Info) [0] GeForce GTX 570 15 SM_2.0 @ 1.46 GHz, 1.2GB RAM, KTO, AE1, ZCP Info) Detected 1 available TachyonL/OptiX ray tracing accelerator Warning) Detected X11 'Composite' extension: if incorrect display occurs Warning) try disabling this X server option. Most OpenGL drivers Warning) disable stereoscopic display when 'Composite' is enabled. Info) OpenGL renderer: GeForce GTX 570/PCIe/SSE2 Info) Features: STENCIL MSAA(4) MDE CVA MTX NPOT PP PS GLSL(OVFGS) Info) Full GLSL rendering mode is available. Info) Textures: 2-D (16384x16384), 3-D (2048x2048x2048), Multitexture (4) Info) Dynamically loaded 2 plugins in directory: Info) /Projects/vmd/pub/linux64/lib/vmd192/plugins/LINUXAMD64/molfile after#0 vmd > source setupCV_broken.tcl The PDB is supported by RCSB, the NSF, US PHS, NIH, NCRP, NIGMS, NLM, and US DoE, who are not liable for the data. PDB files shall not be sold. See ftp://ftp.rcsb.org/advisory.doc for full details. Info) Using plugin webpdb for structure file 1GWR Info) Using plugin webpdb for coordinates from file 1GWR Info) Determining bond structure from distance search ... Info) Analyzing structure ... Info) Atoms: 3987 Info) Bonds: 4016 Info) Angles: 0 Dihedrals: 0 Impropers: 0 Cross-terms: 0 Info) Bondtypes: 0 Angletypes: 0 Dihedraltypes: 0 Impropertypes: 0 Info) Residues: 542 Info) Waters: 45 Info) Segments: 1 Info) Fragments: 55 Protein: 8 Nucleic: 0 colvars: ---------------------------------------------------------------------- colvars: Initializing the collective variables module, version 2014-10-13. colvars: ---------------------------------------------------------------------- colvars: Reading new configuration: colvars: # indexFile = "" [default] colvars: # analysis = off [default] colvars: # colvarsTrajFrequency = 0 [default] colvars: # colvarsRestartFrequency = 0 [default] colvars: # colvarsTrajAppend = off [default] colvars: ---------------------------------------------------------------------- colvars: Initializing a new collective variable. colvars: # name = "colvar1" [default] colvars: Error: no valid components were provided for this collective variable. colvars: All components initialized. Segmentation fault (core dumped)

giacomofiorin commented 9 years ago

Hi Chris, John recently included in the VMD base code numerous fixes for the VMD implementation ot the colvars module.

On Fri, Apr 17, 2015 at 6:49 PM, cmayne notifications@github.com wrote:

This bug refers to the implementation of Colvars in VMD. When configuring the colvar, any error in syntax causes a seg fault that terminates VMD. As a simple example, the following code results in a seg fault when entered into tkcon console (VMD console dump is given below):

mol new 1GWR set sel1 [atomselect top "noh chain A and resid 533 to 536"] set sel2 [atomselect top "noh chain A and resid 339 to 351"] cv molid top cv config \ "colvar { name cn coordNum { group1 { atomNumbers [$sel1 get serial] } group2 { atomNumbers [$sel2 get serial] } }}"

The error is that the closing braces are on the same line, i.e., the following code is the corrected version:

mol new 1GWR set sel1 [atomselect top "noh chain A and resid 533 to 536"] set sel2 [atomselect top "noh chain A and resid 339 to 351"] cv molid top cv config \ "colvar { name cn coordNum { group1 { atomNumbers [$sel1 get serial] } group2 { atomNumbers [$sel2 get serial] } } }"

In my experience, this occurs with any syntactical error provided either directly within VMD, as shown above, or by providing a config file. Here is the console data from VMD demonstrating the seg fault, including the Version of VMD (I can reproduce this on Mac OS X version of VMD as well):

Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014) Info) http://www.ks.uiuc.edu/Research/vmd/

Info) Email questions and bug reports to vmd@ks.uiuc.edu

Info) Please include this reference in published work using VMD:

Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual

Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38. Info) ------------------------------------------------------------- Info) Multithreading available, 8 CPUs detected. Info) Free system memory: 23441MB (97%) Info) Creating CUDA device pool and initializing hardware... Info) Detected 1 available CUDA accelerator: Info) [0] GeForce GTX 570 15 SM_2.0 @ 1.46 GHz, 1.2GB RAM, KTO, AE1, ZCP Info) Detected 1 available TachyonL/OptiX ray tracing accelerator Warning) Detected X11 'Composite' extension: if incorrect display occurs Warning) try disabling this X server option. Most OpenGL drivers Warning) disable stereoscopic display when 'Composite' is enabled. Info) OpenGL renderer: GeForce GTX 570/PCIe/SSE2 Info) Features: STENCIL MSAA(4) MDE CVA MTX NPOT PP PS GLSL(OVFGS) Info) Full GLSL rendering mode is available. Info) Textures: 2-D (16384x16384), 3-D (2048x2048x2048), Multitexture (4) Info) Dynamically loaded 2 plugins in directory: Info) /Projects/vmd/pub/linux64/lib/vmd192/plugins/LINUXAMD64/molfile after#0 vmd > source setupCV_broken.tcl The PDB is supported by RCSB, the NSF, US PHS, NIH, NCRP, NIGMS, NLM, and US DoE, who are not liable for the data. PDB files shall not be sold. See ftp://ftp.rcsb.org/advisory.doc for full details. Info) Using plugin webpdb for structure file 1GWR Info) Using plugin webpdb for coordinates from file 1GWR Info) Determining bond structure from distance search ... Info) Analyzing structure ... Info) Atoms: 3987 Info) Bonds: 4016 Info) Angles: 0 Dihedrals: 0 Impropers: 0 Cross-terms: 0 Info) Bondtypes: 0 Angletypes: 0 Dihedraltypes: 0 Impropertypes: 0 Info) Residues: 542 Info) Waters: 45 Info) Segments: 1 Info) Fragments: 55 Protein: 8 Nucleic: 0

colvars:

colvars: Initializing the collective variables module, version 2014-10-13.

colvars:

colvars: Reading new configuration: colvars: # indexFile = "" [default] colvars: # analysis = off [default] colvars: # colvarsTrajFrequency = 0 [default] colvars: # colvarsRestartFrequency = 0 [default] colvars: # colvarsTrajAppend = off [default]

colvars:

colvars: Initializing a new collective variable. colvars: # name = "colvar1" [default] colvars: Error: no valid components were provided for this collective variable. colvars: All components initialized. Segmentation fault (core dumped)

— Reply to this email directly or view it on GitHub https://github.com/colvars/colvars/issues/38.

Giacomo Fiorin Assistant Professor of Research Institute for Computational Molecular Science (ICMS) College of Science and Technology, Temple University 1925 North 12th Street (035-07), Room 704D Philadelphia, PA 19122-1801 Phone: +1-215-204-4213 https://icms.cst.temple.edu/members.html http://giacomofiorin.github.io/