Project

General

Profile

Bug #459

g_confrms segfaults with -bfac and non-contiguous indexgroups

Added by Erik Marklund over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Command line:

g_confrms -f1 dump_ubi_0.pdb -f2 dump_ubi_0.pdb -o fit.pdb -bfac

Output:

Reading first structure file

WARNING: masses and atomic (Van der Waals) radii will be determined
based on residue and atom names. These numbers can deviate
from the correct mass and radius of the atom type.

frame t= 0.00000
Containing 2247 atoms in 330 residues
Select group from first structure
Group 0 ( System) has 2247 elements
Group 1 ( Protein) has 1231 elements
Group 2 ( Protein-H) has 602 elements
Group 3 ( C-alpha) has 76 elements
Group 4 ( Backbone) has 228 elements
Group 5 ( MainChain) has 305 elements
Group 6 (MainChain+Cb) has 375 elements
Group 7 ( MainChain+H) has 380 elements
Group 8 ( SideChain) has 851 elements
Group 9 ( SideChain-H) has 297 elements
Group 10 ( Prot-Masses) has 1231 elements
Group 11 ( non-Protein) has 1016 elements
Group 12 ( SOL) has 1016 elements
Group 13 ( non-SOL) has 1231 elements
Select a group: 3
Selected 3: 'C-alpha'

Reading second structure file

WARNING: masses and atomic (Van der Waals) radii will be determined
based on residue and atom names. These numbers can deviate
from the correct mass and radius of the atom type.

frame t= 0.00000
Containing 2247 atoms in 330 residues
Select group from second structure
Group 0 ( System) has 2247 elements
Group 1 ( Protein) has 1231 elements
Group 2 ( Protein-H) has 602 elements
Group 3 ( C-alpha) has 76 elements
Group 4 ( Backbone) has 228 elements
Group 5 ( MainChain) has 305 elements
Group 6 (MainChain+Cb) has 375 elements
Group 7 ( MainChain+H) has 380 elements
Group 8 ( SideChain) has 851 elements
Group 9 ( SideChain-H) has 297 elements
Group 10 ( Prot-Masses) has 1231 elements
Group 11 ( non-Protein) has 1016 elements
Group 12 ( SOL) has 1016 elements
Group 13 ( non-SOL) has 1231 elements
Select a group: 3
Selected 3: 'C-alpha'
Root mean square deviation after lsq fit = 9.74373e-08 nm
Atomic MSD's range from 1.38778e-17 to 2.98095e-14 nm^2

Back Off! I just backed up fit.pdb to ./#fit.pdb.9#
Segmentation fault

It works fine if I select 'Protein' or if I omit -bfac. Using two different pdb-files (here I used the same) doesn't help.

dump_ubi_0.pdb (173 KB) dump_ubi_0.pdb The pdb-file I used in my example Erik Marklund, 07/01/2010 06:24 PM

History

#1 Updated by Erik Marklund over 9 years ago

Created an attachment (id=484)
The pdb-file I used in my example

#2 Updated by Erik Marklund over 9 years ago

I see the problem now. Will fix it myself.

#3 Updated by David van der Spoel over 9 years ago

I can not reproduce it with yesterdays binaries.

#4 Updated by Erik Marklund over 9 years ago

(In reply to comment #3)

I can not reproduce it with yesterdays binaries.

Interesting. Did you try with my attached pdb-file too?

#5 Updated by Erik Marklund over 9 years ago

Anyway, here's the error.
...
for(i=0; i<isize2; i++) {
atoms2->pdbinfo[index2[i]].type = eptAtom;
atoms2->pdbinfo[index2[i]].bAnisotropic = FALSE;
if (bBfac)
atoms2->pdbinfo[index2[i]].bfac = (800*M_PI*M_PI/3.0)*msds[i];
if (bLabel)
atoms2->resinfo[atoms2->atom[index2[i]].resind].chain = 'B';
}

When index2 is a non-contiguous list of atomindices (e.g. the Calphas) there will be entries in atoms2->pdbinfo[].type that are uninitialized, so that later on, in write_pdb_indexed(), things will go wrong:

type  = atoms->pdbinfo[i].type;
...
fprintf(out,pdbform,pdbtp[type],(i+1)%100000,nm,resnm,ch,resnr,
(resic == '\0') ? ' ' : resic,
10*x[i][XX],10*x[i][YY],10*x[i][ZZ],occup,bfac,atoms->atom[i].elem);

type is set to something random. If you're lucky, that part of memory is zero, but I am not that lucky:

(gdb) p atoms->pdbinfo1
$3 = {type = -1098222298, atomnr = 1029165293, altloc = 0 '\0', atomnm = "\000\000\000\000\000", occup = 0, bfac = 0,
bAnisotropic = 0, uij = {0, 0, 0, 0, 0, 0}}

The same thing happens for the atoms1 structure.

I'm fixing it by setting all atoms1->pdbinfo[].type to eptAtom. I'll do similar things to relevant parts of the rest of atoms1->pdbinfo. The same goes for atoms2, of course.

#6 Updated by Erik Marklund over 9 years ago

Done.

Also available in: Atom PDF