Problem with mod_fastcgi and multithread app.

Fernando Schapachnik <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi,

I'm developing a multithreaded app under fastcgi. After issuing a few 
requests it dumps core with signal 11. Examining the core, the problem is here:

#0 0x8048a3e in do_something2(parameters here)
133      FCGX_FPrintF(request->err, "The address is %x", &var);
(gdb) l
{
130      char a[40974];
131      char *p1, *p2;
132      u_long var;
133      FCGX_FPrintF(request->err, "The address is %x", &var);
(gdb) print var
Cannot access memory at address 0xbfac8e60.

I've trimmed the app down to it's most basic form (it looks a little 
bit more complex than the example threaded.c) with only 130 lines of C code, 
doing nothing useful and compiled like this:

gcc -Wall -D_THREAD_SAFE -o app.fcgi app.o -L/usr/local/lib -lfcgi -pthread

It consistently dies in the same way after two or three requests. It seems like 
something is corrupting the process itself. If I remove line 130, the symptom 
dissaprears, although the program start to behave randomly. The size was select 
to mimic the stack shape the first time I saw the problem (is the size of the 
DB's variables that used to be there - the current version does not use or link 
against the DB libraries any more).

The platform is FreeBSD 4.8-4.10, Apache 1.3.29-1.3.33, mod_fastcgi-2.4.2 and 
fcgi-devkit-2.4.0, with FreeBSD's stock gcc.

I can send a sample program if needed.

Does anyone have a suggestion or pointer?

Kind regards and thanks in advance.


Fernando.

___________________________________
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.