[FASTCGI] Writing to file in fcgi leads to Segmentation fault

Satish Burnwal (sburnwal) sburnwal at cisco.com
Fri Sep 17 08:38:01 EDT 2010


I have fastcgi module on my apache web server Apache/2.2.11 (Unix). My
fcgi files are written in C language. In my C programs, whenever I try
to write some output to any file to do some kind of troubleshooting or
debugging, it is leading me to Segmentation fault error (as visible from
the apache error log). I am just doing some very simple write to a file
like:

FILE* lfp = fopen("/home/sburnwal/fcgiout.log", "rw");
fprintf(lfp, "%s\n", "Testing write to a output file");
fclose(lfp);

Why is this leading to Segmentation fault ? Is there a way to avoid this
error or, anyway I can do some kind of printing somewhere to do
debugging ?

Appreciate your response,
-Satish


More information about the FastCGI-developers mailing list