Re: [AMBER-Developers] long path names

From: Scott Brozell <>
Date: Fri, 19 Mar 2010 04:48:10 -0400


On Thu, Mar 18, 2010 at 04:30:35PM -0700, Eric Pettersen wrote:
> Forget to mention that the whole MAXCHAR issue is internal to
> antechamber (defined in antechamber/define.h).

This is a known lurker. And i thought that i had long ago
bumped MAXCHAR up to my favorite int: 1069
/* The first four-digit quasiall-even-digits non-quasi-repdigit emirp ! */

> On Mar 18, 2010, at 4:27 PM, Eric Pettersen wrote:
> > I recently upgraded the version AmberTools that Chimera was using
> >to 1.3 with all patches applied (please don't ask what version it
> >was using before!). Compilation wasn't excessively difficult but I
> >found I was getting random crashes with various charge calculations
> >(e.g. bccharge() in antechamber/charge.c). Tracking down the cause
> >was a headache. It turns out that string buffers used to compose
> >commands to hand off to system() were only allocated as 256
> >characters (MAXCHAR). Now, in Chimera on a mac, the Amber
> >executables typically live in a directory like:
> >
> >/Users/pett/Applications/
> >bin/amber11/bin
> >
> >and the input/output files are in temporary system folders like:
> >
> >/var/folders/VH/VHqktDJe2RWZSE+1YwqPE+++Hpc/-Tmp-/tmp4iniru
> >
> >So you can see how an executable, a couple of input files, and an
> >output file could easily overflow 256 characters. When I recompiled
> >with MAXCHAR set to 2048 all the mysterious crashes went away.
> >
> > I guess I'm proposing that either MAXCHAR be increased to at least
> >2K (most modern shells allocate 4K or more for commands) or that
> >there be a separate macro (MAXCMD?) for strings that are supposed to
> >be handed off to system().

i guess 2048 isnt that boring an increase from 256: 2^8 * 8^1
so i'll up it to 2k.
Testing please from the cygwin-ners especially.

As far as a better fix, i've been recommending C++ as a better C
for many years to plug the never ending stream of memory related bugs.

ho hum,

AMBER-Developers mailing list
Received on Fri Mar 19 2010 - 02:00:03 PDT
Custom Search