[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#199001: Bug#203095: Please compile apache with -pthread



On Mon, Jul 28, 2003 at 08:48:44PM +0200, David N. Welton wrote:
> Jeff Bailey <jbailey@nisa.net> writes:
> 
> > > Does omniorb use threads?  At what point in the Apache lifecycle
> > > is it loaded?
> 
> > Yes - Specifically, I'm using omniorb in mod_python.  I don't know
> > enough about Apache's module handling to know when the various DSOs
> > are loaded.  However, the actual invocation happens after the client
> > is connected.

If it's a normal module it gets loaded twice: once during the 
configuration parsing (whenever the 'LoadModule' directive is 
encountered) to initiate module specific configuration readers and
then again for the actual child servers.

Thanks for this bugreport -- we encounter rather mysterious 
"hanging" children on our (high-load) production server: the only
one thing these processes have in common is a rather peculiar
top of the stack (t least that's what gdb thinks the top of
the stack is):

 0 mallopt from libc.so.6
 1 mallopt from libc.so.6
 2 malloc  from libc.so.6
 ... after that the stack varies ...

The puzzling thing: mallopt _doesn't_ call mallopt, if i understand
the source code :-/

The "hanging" processes eat CPU cycles like crazy without ever
recovering. Invocing a simple 'return 0' and a 'detach' from
gdb will rescue them.
The processes _do_ hang in calls from modules that link with
'-pthread', so this might be the problem. Does pthread try to
patch 'mallopt' as well? Thinking of it, it probably needs to
since mallopt needs to fiddle with structures and better do
that in an 'atomic' way.


> For the record: I talked with Daniel Jacobowitz some, and he says that
> it is not possible for a non-threaded application to load modules that
> are linked with pthreads.

That's an awfully important piece of information! Thanks.
I just recompiled apache with '-pthreads' on our server and might be able 
to see the results by tomorrow.

> > I'm curious: do you see this as a linuxthreads bug?  I'm going to
> > start testing NPTL for glibc soon, and this might be an interesting
> > test case for improved functionality.
> 
> So I guess that means it is something that Apache has to deal with.

Sounds like it (even so it somehow "feels" wrong).

 Thanks 

   Ralf Mattes

> -- 
> David N. Welton
>    Consulting: http://www.dedasys.com/
>      Personal: http://www.dedasys.com/davidw/
> Free Software: http://www.dedasys.com/freesoftware/
>    Apache Tcl: http://tcl.apache.org/
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-apache-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: