I would recommend reviewing your C code. It seems that segmentation faults are common pitfalls when using the perlapi. Write tests against the functions to be certain that they perform correctly. If your program uses standard C library functions - make sure to read the perlclib man page. Good luck!
-mm