[lammps-users] nans and segmentation fault

While debugging my new EAM forcefield code in PairEAMCurve() I have been getting nans and segmentation faults. As an input file, I have been using a modified in.shear for the shear example, which uses only two atom types and reads potentials with

pair_coeff * * FeCr_eamdata 1 2

The potential file FeCr_eamdata contains:
F(rho) for Fe;
rho(r) for Fe;
F(rho) for Cr;
rho(r) for Cr;
z(r) for FeFe, i.e.V11;
z(r) for FeCr, i.e. V12;
z(r) for CrCr, i.e. V22.

I have already found and fixed two segmentation faults that resulted from separate typographical errors in the array indexing in my new code. However, I now have a bug that I am having difficulty locating. What happens now is that LAMMPS runs for a while and prints nan in the fields for

Temperature E_pair E_total and Pressure

And eventually crashes with a segmentation fault. The other fields look okay. My class function seems to be executing completely now for each iteration, although it may be doing something to cause the code to behave erroneously elsewhere.
Since I am getting frustrated trying to pinpoint the problem, perhaps you can help. I would like to know:
1. Where in the LAMMPS code the above values are calculated so I can concentrate my efforts there.
2. Could it be that my input file, in.shear.poly.FeCr is set-up inconsistently?
3. Could it be that the values in the potential file FeCr_eamdata are causing the problem? I doubt however that this is the case because Alfredo Caro generated the file for me and the code seems to read this uneventfully and proceed merrily on its way.

     -- Al