<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi everyone,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Recently, I've been experimenting converting
MapServer 3.3.011 to FastCGI hoping to boost its performance. I'm using FastCGI
2.2.8 and have the Apache set up. I have tried other FastCGI programs and they
just worked fine. However, when I converted the mapserv.c using the code below,
I have encountered some problems that I dont know how to solve. Using the code
below, I can start mapserv without any problem. However, after one or two
requests (i.e. zooming in/out, panning, etc), the mapserv terminate itself
suddenly and I got the 'segmentation fault' error. On my gdb, it says 'program
received SIGSEGV ... and terminated' and something related to malloc.c as well.
It took me one whole week and still couldnt figure out why. I just wonder if
anyone can kindly give me some directions. Thanks!!!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>int main(int argc, char *argv[]) {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> int i,j;<BR>
char buffer[1024];</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> if (FCGX_IsCGI())
{<BR> close(STDIN_FILENO);<BR>
close(STDOUT_FILENO);<BR>
close(STDERR_FILENO);<BR> FCGX_OpenSocket(":8999",
100);<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> while(FCGI_Accept() >= 0)
{</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> ... <the usual mapserv
code><BR> <BR>
return(0);<BR> } /* End main routine */</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV><BR>Nicholas Lo<BR></DIV></FONT></BODY></HTML>