Re: [AMBER] parmchk2 segfaults

From: Jason Swails <jason.swails.gmail.com>
Date: Thu, 24 Jul 2014 14:36:24 -0700

On Thu, Jul 24, 2014 at 7:47 AM, Hannes Loeffler <Hannes.Loeffler.stfc.ac.uk
> wrote:

> On Fri, 11 Jul 2014 08:16:55 -0700
> Jason Swails <jason.swails.gmail.com> wrote:
>
> >
> > On Jul 11, 2014, at 1:41 AM, Sushil Mishra <sushilbioinfo.gmail.com>
> > wrote:
> >
> > > Dear all,
> > >
> > > Has someone tried to debug this issue ? I have the same issue under
> > > ubuntu 12.04 in x86_64 HP workstation. It works fine on the
> > > structure dummy atoms. If someone would like to reproduce the
> > > problem, there is a structure attached herewith.
> >
> > I can confirm that parmchk2 segfaults for me as well on my Linux
> > machine. However, "parmchk" works just fine, and in this case is
> > functionally equivalent to parmchk2 (since no parameters can be
> > found, anyway). It works fine on my Mac.
> >
> > In the meantime I'll look into the segfault.
>
> I have tried to run this with gdb and gdb thinks the segfaults happens
> in line 1618 of parmchk2.c . The problem apparently is the variable
> pid used in this line for indexing which evaluates to -1 for unknown
> atom types. That's the preset value in assign_parmid() (lines
> 1404ff). I guess the numbers in parmid are bcc types.
>

​I had completely forgotten about this, apologies. Indeed, when I trigger
a core dump and print the stack trace from that using GDB I see the same
thing.

I'm not sure what the best solution is, although obviously pid cannot be
used to access array elements when it's set to -1. It seems that the
parameter determination was coded under the assumption that pid would never
be out of bounds of the parm array, so this is unlikely to be a trivial
1-line fix. Protection has to be added to basically every section
(chk_bond, chk_angle, chk_torsion, chk_improper, and the check_vdw
functions).

Thanks,
Jason

-- 
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Jul 24 2014 - 15:00:02 PDT
Custom Search