It was recently brought to my attention by Judy Klein that the commandline version of CMask sometimes crashes depending on the commandline arguments that are provided. I tracked down the problem to a very small buffer size for the input and output filenames/pathnames. So if you are experiencing a "Segmentation fault" with CMask, it may be because you are specifying paths on the commandline that are longer than 32 characters.
The fix is to patch several lines in the CMask code and recompile. I hope to post a patched source code archive for CMask to my website soon, but if it is not there yet, try changing these lines yourself by replacing "32" or "33" with a larger number such as "2048":
In cmask.cpp, lines 34-35:
inname = new char ;
outname = new char ;
In fileio.cpp, lines 143-145:
char *dummy1, dummy2;
for (i=0; i<32; dummy2[i]='\0', i++);
In fileio.h, lines 16 & 39:
In parser.h, lines 73 & 96:
After you make the above changes, open a Terminal window and "cd" to the source directory. Then type "make" to recompile CMask.
And check my website for new versions of CMask in the future: