FastCGI & SIGSEGV

Nicholas Lo nicklo at siliconcreation.com
Sat Oct 28 08:05:32 EDT 2000


Hi everyone,

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!!!


int main(int argc, char *argv[]) {

    int i,j;
    char buffer[1024];

    if (FCGX_IsCGI()) {
     close(STDIN_FILENO);
     close(STDOUT_FILENO);
     close(STDERR_FILENO);
     FCGX_OpenSocket(":8999", 100);
    }

    while(FCGI_Accept() >= 0) {

    ... <the usual mapserv code>

    return(0);
    } /* End main routine */


Regards,

Nicholas Lo


Nicholas Lo
Technical Director

Silicon Creation Limited
18/F, Tower II
MetroPlaza
Kwai Fong, NT
Hong Kong

Tel : 7111 9350
Fax : 2610 2225




More information about the mapserver-users mailing list