You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Brauel, Bjoern" <Bj...@softwareag.com> on 2001/01/22 14:29:19 UTC

Apache 1.3.x running modules with -lpthread

Hi everyone,

I am part of a development team here at Software AG(anybody know ADABAS ?) .
We're working on an XML related project (Database)
and currently having a bit of a problem with a specific topic  in
conjunction with apache.  I hope someone might give 
a response to this mail as our "Chief Technology Architect" wants me to get
at least some response to this topic from the apache-developers;

We have an Apache module that is supposed to pass requests to a specific
database and the module needs to read port-information from
a small "directory server" in order to handle the request. The problem now
is that the code to read from the dir-server is  heavily using
threads (thus  the module is linked against pthread !) and we want to avoid
breaking the codebase in order to have a "thread-less" module 
(ie we would need to maintain two codes for one purpose).
The problem seems to be that running a module that uses threads seems to
work fine in Windows but crashes a Unix (pretty much all of them, except
Solaris, wich "sometimes" works). 

I already suggested that apache musn't use threaded modules, but the
architects want to get a statement if this is really true and if this will
change for apache 2.0.


 cheers ...

    Bjoern Brauel


Re: Apache 1.3.x running modules with -lpthread

Posted by Tony Finch <do...@dotat.at>.
"Brauel, Bjoern" <Bj...@softwareag.com> wrote:
>
>The problem seems to be that running a module that uses threads seems
>to work fine in Windows but crashes a Unix (pretty much all of them,
>except Solaris, wich "sometimes" works).

It ought to work, and indeed it does for Oracle.

Tony.
-- 
f.a.n.finch    fanf@covalent.net    dot@dotat.at
" ``Well, let's go down and find out who's grave it is.''
``How?''  ``By going down and finding out!'' "

Re: Apache 1.3.x running modules with -lpthread

Posted by rb...@covalent.net.
On Mon, 22 Jan 2001, Sascha Schumann wrote:

> > There is a bigger problem with threaded modules and apache 1.3 on
> > Linux.  Linux Glibc uses SIGUSR1 for thread management, which is the same
> > signal that Apache uses for graceful restart.  This causes HUGE problems.
> 
>     Are you sure?  From the linuxthreads-2.2 FAQ:
> 
>    On  recent  kernels (2.2 and up), more than 32 signals are provided in
>    the  form  of  realtime  signals.  When  run  on one of those kernels,
>    LinuxThreads  uses  two  reserved  realtime  signals  for its internal
>    operation,  thus leaving SIGUSR1 and SIGUSR2 free for user code. (This
>    works only with glibc, not with libc 5.)

Depends on the version of glibc.  When Manoj and I first ported Apache 2.0
to use pthreads on Linux, we hit this problem head-on, so yes, I am very
sure that this is a problem.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Apache 1.3.x running modules with -lpthread

Posted by Sascha Schumann <sa...@schumann.cx>.
> There is a bigger problem with threaded modules and apache 1.3 on
> Linux.  Linux Glibc uses SIGUSR1 for thread management, which is the same
> signal that Apache uses for graceful restart.  This causes HUGE problems.

    Are you sure?  From the linuxthreads-2.2 FAQ:

   On  recent  kernels (2.2 and up), more than 32 signals are provided in
   the  form  of  realtime  signals.  When  run  on one of those kernels,
   LinuxThreads  uses  two  reserved  realtime  signals  for its internal
   operation,  thus leaving SIGUSR1 and SIGUSR2 free for user code. (This
   works only with glibc, not with libc 5.)

    - Sascha


Re: Apache 1.3.x running modules with -lpthread

Posted by rb...@covalent.net.
> > The problem seems to be that running a module that uses threads seems to
> > work fine in Windows but crashes a Unix (pretty much all of them, except
> > Solaris, wich "sometimes" works).
> 
>     If you are running Linux and glibc 2.0.x/2.1.x, the crash is
>     caused by a defect in the dynamic linker.  To work around
>     that, either upgrade to a more recent glibc version (not
>     recommened yet) or link the httpd executable against
>     libpthread.

There is a bigger problem with threaded modules and apache 1.3 on
Linux.  Linux Glibc uses SIGUSR1 for thread management, which is the same
signal that Apache uses for graceful restart.  This causes HUGE problems.

Ryan
_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Apache 1.3.x running modules with -lpthread

Posted by Sascha Schumann <sa...@schumann.cx>.
    Hi,

> The problem seems to be that running a module that uses threads seems to
> work fine in Windows but crashes a Unix (pretty much all of them, except
> Solaris, wich "sometimes" works).

    If you are running Linux and glibc 2.0.x/2.1.x, the crash is
    caused by a defect in the dynamic linker.  To work around
    that, either upgrade to a more recent glibc version (not
    recommened yet) or link the httpd executable against
    libpthread.

> I already suggested that apache musn't use threaded modules, but the
> architects want to get a statement if this is really true and if this will
> change for apache 2.0.

    This is a defect in the operating system, not Apache.

    - Sascha