Seg fault when parsing input for a uniaxialMaterial

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
denavit
Posts: 15
Joined: Mon Nov 13, 2006 1:33 pm
Location: University of Tennessee, Knoxville

Seg fault when parsing input for a uniaxialMaterial

Post by denavit »

Frank,

I am running into some unexpected behavior when parsing the input for a uniaxialMaterial that I am developing. If I try to get more arguments than there are, for example by calling OPS_GetString(…) to check if there is any optional input, it results in a segmentation fault.

In "elementAPI.cpp" there is code to check if the current argument exceeds the number of arguments. However, it looks as if "currentArg" is acting like it is zero indexed and "maxArg" is acting like it is 1 indexed (since it is set to the argument count), making the statement "currentArg > maxArg" incorrect for determining if the number of arguments has been exceeded.

Thanks,
Mark
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

thanks, your right .. i have made the fix to the code in the svn repository .. in the meantime you will have to use the OPS_GetNumRemainingInputArgs
Post Reply