[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 09:23:01PM +0200, David N. Welton wrote:
> 
> > The puzzling thing: mallopt _doesn't_ call mallopt, if i understand
> > the source code :-/
> 
> I'm not quite sure offhand what mallopt is.

Basically it sets allocation options for malloc (for example one can
change the threshhold for malloc to switch from allocating with
'brk' to 'mmap'ing etc.).


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

Sound's like a night with the pthread code for me ;-)

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

Yes, i was aware of that (did the same trick to provide my own version
of mallopt ...) but i wanted to stay as close as possible to the 
normal loading/unloading patterns of apache as possible.

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

Hmm, that would be an even more horrible hack (and might result in
strange bugs: imagine a user allready sets LD_PRELOAD. Would you
silently override, append or prepend to the exisitng value?).
>From the aesthetic point of view i think this is really a pthread
"feature" -- what makes pthread so special that i justifies 
special treatment? 
>From the apache side: why do modules need to use '-pthread' if 
used by a threadless apache? [that question _does_ point to 
a bug i filed against apache2-dev: one really needs a -dev package
that corresponds to the worker model. Ugly but unavoidable].

 Thanks again, it allready looks like you found the cause of
 two weeks of grieve and woundering 

    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/



Reply to: