Segfault using fastcgi application

"Vishal Singh" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hello,

I am using fastcgi and it starts my application when the server is started.

The problem I am facing is :

When I run the application standalone it works perfectly all right.
When the application is started by fastcgi, it gets killed returning
Internal server error to the browser.

I tried to do gdb for the launched process, which gives the following.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 24423344 (LWP 9587)]
0x004ffcca in getenv () from /lib/tls/libc.so.6
(gdb) bt
#0  0x004ffcca in getenv () from /lib/tls/libc.so.6
#1  0x005abcaa in __res_vinit () from /lib/tls/libc.so.6
#2  0x005ade56 in __res_maybe_init () from /lib/tls/libc.so.6
#3  0x00974c8b in res_search () from /lib/libresolv.so.2
#4  0x081061f2 in server_hosts (domain=0x9ff78b0 "seoul.clic.cs.columbia.edu",
    service=0x8131fd9 "sip", type=0, port=-5060, entries=0x174a178)
    at ../libcine/servers.c:303
#5  0x08106841 in servers (domain=0x9ff78b0 "seoul.clic.cs.columbia.edu",
    service=0x8131fd9 "sip", type=0, port=-5060) at ../libcine/servers.c:414
#6  0x080b4ba4 in ClientGetLocations (uri=0x174a350, type=0)
    at ../libsip/client.c:2657
#7  0x080b1a5f in DoLocationLookup (info=0x9ff7b3c) at ../libsip/client.c:1096
#8  0x080b0fd6 in InitialClientStart (rs=0x9ff47d8) at ../libsip/client.c:799
#9  0x0810f2b2 in reactive_system_event (rs=0x9ff47d8)
    at ../libcine/reactivesystem.c:732
#10 0x0810c262 in pool_routine (arg=0x9feafe8) at ../libcine/thread_pool.c:526
#11 0x008a9371 in start_thread () from /lib/tls/libpthread.so.0
#12 0x0059d9be in clone () from /lib/tls/libc.so.6

Since, I am new to fcgi , I am not sure if I did anything wrong in the
way I integrated the fcgi.

Program code is as follows
-----------------------------------------


main( )
{

Application specific initialization..
......
Thread pool init etc..
.........

while(FCGI_Accept() >= 0){

Send Response (Using Printf())
Process the request and perform application specific tasks.

}
clean up the application specific structures..

}

Do I need to take care of anything specific when integrating the
application with fastcgi.?

I tried to compare the getenv of the shell where the program works
perfectly and for the process launched by apache and could not find
much difference, if that could be problem, I could look for specific
environment variables.

Any help/ pointers/ application guidelines on this is highly appreciated.

Thanks,
Vishal
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.