AMBER Archive (2009)Subject: Re: [AMBER] AMBER: segmentation fault when running parmchk
From: Mark Williamson (mjw_at_sdsc.edu)
Date: Wed Nov 04 2009 - 11:06:53 CST
Alexander Boncheff wrote:
> So I finally figured out how to debug using gdb.
>
Nearly, you also need to add debugging symbols by compiling with -g
>
> (gdb) run -i /file.pdb -f pdb -o /file.frcmod
>
> Starting program: /amber10/bin/parmchk -i /file.pdb -f pdb -o /file.frcmod -p $AMBERHOME/dat/leap/parm/parm99.dat
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000414a26 in rprepi ()
> (gdb)
>
Hi Alex,
In a nutshell, you are using this tool incorrectly and it is crashing
without telling you this. Admittely, parmchk should fail in a nicer manner.
Looking at the AmberTools manual
http://www.lulu.com/items/volume_63/2232000/2232695/2/print/AmberToolsi.pdf
(p68), you are actually using this tool incorrectly; you should be
passing it a prepi, ac or mol2 file; not a pdb file
For reference, this was debugged using the following method and the
file.pdb that you sent me offlist:
1) Change to the correct directory
cd $AMBERHOME/src
2) Add debugging symbols and turn off optimisations within the build
process.
edit config.h
change:
CFLAGS= -m64 -DBINTRAJ $(AMBERBUILDFLAGS)
OCFLAGS=-O3 -m64 -DBINTRAJ $(AMBERBUILDFLAGS)
to:
CFLAGS= -m64 -DBINTRAJ $(AMBERBUILDFLAGS) -g
OCFLAGS=-O0 -m64 -DBINTRAJ $(AMBERBUILDFLAGS) -g
3) Rebuild parmchk
cd $AMBERHOME/src/antechamber
make clean ; make ; make install
4) Run parmchk again, but via gdb
cd $AMBERHOME/exe
gdb ./parmchk
Withing gdb, execute the following command:
run -i file.pdb -f pdb -o file.frcmod
Hopefully this should crash:
(gdb) run -i /tmp/file.pdb -f pdb -o /tmp/frcmod
Starting program: /server-home/mjw/code/AMBER/amber10/bin/parmchk -i
/tmp/file.pdb -f pdb -o /tmp/frcmod
Program received signal SIGSEGV, Segmentation fault.
0x0000000000414eef in rprepi (filename=0x52cf00 "/tmp/file.pdb",
atomnum=0x52a5b8, atom=0x52e010, bondnum=0x52a5bc, bond=0x53f820,
cinfo=0x52db80, minfo=0x52d120) at prep.c:120
120 rotate0(atm[tmpint4 - 1],
atm[tmpint3 - 1],
5) Run a backtrace
(gdb) bt
#0 0x0000000000414eef in rprepi (filename=0x52cf00 "/tmp/file.pdb",
atomnum=0x52a5b8, atom=0x52e010, bondnum=0x52a5bc, bond=0x53f820,
cinfo=0x52db80, minfo=0x52d120) at prep.c:120
#1 0x0000000000426b17 in main (argc=7, argv=0x7fbfffee18) at parmchk.c:4063
(gdb)
6) Locate the regions in the source code reported by gdb:
parmchk.c:4063 is
if (format == 0)
overflow_flag = rprepi(ifilename, &atomnum, atom,
&bondnum, bond_array, &cinfo, &minfo); <--
which is calling rprepi() which then segfaults at prep.c:120
This is incorrectly attempting to parse a pdb file as a prepi file; the
"format" variable in main.c never gets incremented on from 0 when
processing the value of -f since there is no pdb option here, hence
rprepi() is called. rprepi() cannot deal with pdb files and as a result,
crashes.
--
Mark Williamson, Post Doc
Walker Molecular Dynamics Group
Room 395E
San Diego Supercomputer Center
9500 Gilman Drive
La Jolla, CA 92093-0505
Email: mjw at sdsc.edu
Office: 858-246-0827
_______________________________________________
AMBER mailing list
AMBER_at_ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
|