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

Bug#203095: Please compile apache with -pthread



rm@fabula.de writes:

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

Right.

> 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 :-/

I'm not quite sure offhand what mallopt is.

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

pthread affects a lot of things, I think...

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

Oops - if you'd read my original bug report, you would have also seen
that LD_PRELOAD=/lib/libpthread.... seems to work as well, because it
loads pthreads with the main program.

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

If Daniel says it's not possible, I trust him:-)  I agree that it's a
pain in the neck.  Maybe it would be possible to write an apache start
script that checks the modules for the presence of pthreads, and
depending on that, does the LD_PRELOAD line.

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



Reply to: