Re: How to debug a fast-cgi...

Mark Brown (mbrown@OpenMarket.com)
Wed, 28 Aug 1996 14:20:45 -0400

Message-Id: <199608281820.OAA24445@breckenridge.openmarket.com>
To: fastcgi-developers@OpenMarket.com
Subject: Re: How to debug a fast-cgi... 
In-Reply-To: <199608281629.SAA32494@digicol.com> 
Date: Wed, 28 Aug 1996 14:20:45 -0400
From: Mark Brown <mbrown@OpenMarket.com>


Thies Arntzen asks:

    could one of you tell me how i can debug a fast-cgi.
    i tried to attach with gdb, but after gdb attached
    i couldn't continue, because the FCGI_Accept would't
    work any more.... using AIX 4.1

Let's see ... I'm guessing that what's happened is that
the call to accept() on line 2117 of fcgiapp.c is returning
-1 with errno = EINTR, and the fcgiapp is not prepared to retry.

You should be able to tell if this is what's happening
by poking around with gdb.  If my guess is correct,
you could change

            reqDataPtr->socket = accept(FCGI_LISTENSOCK_FILENO,
                    (struct sockaddr *) &sa.un, &clilen);

to

            for(;;) {
                reqDataPtr->socket = accept(FCGI_LISTENSOCK_FILENO,
                        (struct sockaddr *) &sa.un, &clilen);
                if(reqDataPtr->socket != -1 || errno != EINTR) {
                    break;
                }
            }

and see if that doesn't fix it.

If my guess is wrong, please poke around with gdb and tell us
why the application won't continue after you've attached a debugger.

    --mark