Mailing List Archive

httpd 1.3.23 + custom module hanging at startup on RHL7.2?
Hello all,

I have a problem that has been killing me and I was wondering if anyone else
out there has seen this scenario. This note is long, but I attempted to
include as much detail as possible in one shot. Thanks in advance for any
info.

Pete

Scenario:
We have written an Apache module in C++ (modified Makefiles and
apxs-generated goods per web instructions). This module has registered a
"module initializer" and then an array of five dispatch handlers. This
module worked fine on RedHat Linux 6.2 (under Apache 1.3.20) and on Solaris
7 (not sure which Apache version, but 19 < v < 23?).

When we moved the module to RedHat 7.2, we began to experience this hanging
behavior.

System Configuration:
-------------------------------------
Hardware: 2x1.26GHz x86, 2GB RAM
OS: Linux fdac1 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001
i686 unknown
Tool: gcc-2.95.3
AP Build: configure --prefix=/usr/local --enable-shared=max
AP Config: Stripped down => mod_mime, mod_log_config, mod_so +
<OUR-MODULE>
Running with MaxClients=1 for debugging (this has no effect
on behavior)
Other: ldd for our module yielded
libxerces-c1_5_1.so => /usr/local/src/XMLLIB/lib/libxerces-c1_5_1.so
(0x400c0000)
libstdc++-libc6.2-2.so.3 => /usr/local/lib/libstdc++-libc6.2-2.so.3
(0x40348000)
libm.so.6 => /lib/libm.so.6 (0x4039e000)
libc.so.6 => /lib/libc.so.6 (0x403c0000)
libpthread.so.0 => /lib/libpthread.so.0 (0x404f6000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
-------------------------------------

Here is what happens (to the best of my limited knowledge-- i am the manager
of the team, not a developer):

1. we start httpd normally "apachectl start"
2. first httpd calls its init() twice?
3. httpd hangs, and ps -ef returns this:

140 S root 29834 1 0 70 0 - 1613 rt_sig 21:03 ? 00:00:00
/usr/local/apache/bin/httpd

we tried moving our "module initializer" procedure to "child_init" in the
module struct, but this only deferred the problem through two forks. i
straced this with

strace -f -ff -o /tmp/httpd

and found three files. here are the tails:

file: httpd (the original from "apachectl start")
------------------------------------------------
fcntl64(0x3, 0, 0xf, 0x40015e6c) = 15
close(3) = 0
fcntl64(0xf, 0x3, 0x40015e6c, 0x3) = 1025
fstat64(15, {st_mode=S_IFREG|0644, st_size=5194, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40017000
_llseek(15, 0, [0], SEEK_CUR) = 0
dup2(15, 2) = 2
chdir("/") = 0
fork() = 19312
_exit(0) = ?
------------------------------------------------


file: tail /tmp/httpd.19312
------------------------------------------------
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
time(NULL) = 1013639297
wait4(-1, 0xbffff81c, WNOHANG, NULL) = -1 ECHILD (No child processes)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
time(NULL) = 1013639298
wait4(-1, 0xbffff81c, WNOHANG, NULL) = -1 ECHILD (No child processes)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
time(NULL) = 1013639299
wait4(-1, 0xbffff81c, WNOHANG, NULL) = -1 ECHILD (No child processes)
select(0, NULL, NULL, NULL, {1, 0}
------------------------------------------------
(note this file stopped tracing right where it was [no \n was added])


file: httpd.19313
------------------------------------------------
fstat64(7, {st_mode=S_IFREG|0664, st_size=829, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40024000
read(7, "<autocoder-config host=\"fdac1\" d"..., 102400) = 829
read(7, "", 98304) = 0
close(7) = 0
munmap(0x40024000, 4096) = 0
brk(0x80ca000) = 0x80ca000
brk(0x80cb000) = 0x80cb000
brk(0x80cc000) = 0x80cc000
brk(0x80cd000) = 0x80cd000
brk(0x80ce000) = 0x80ce000
brk(0x80cf000) = 0x80cf000
brk(0x80e8000) = 0x80e8000
brk(0x80e9000) = 0x80e9000
brk(0x80ea000) = 0x80ea000
brk(0x80eb000) = 0x80eb000
time([1013638123]) = 1013638123
rt_sigprocmask(SIG_SETMASK, NULL, [32], 8) = 0
rt_sigsuspend([]
------------------------------------------------
(note this file stopped tracing right where it was [no \n was added])

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: httpd 1.3.23 + custom module hanging at startup on RHL7.2? [ In reply to ]
On Wed, 2002-02-13 at 18:25, Cipollone, Peter (Factiva) wrote:
> Scenario:
> We have written an Apache module in C++ (modified Makefiles and
> apxs-generated goods per web instructions). This module has registered a
> "module initializer" and then an array of five dispatch handlers. This
> module worked fine on RedHat Linux 6.2 (under Apache 1.3.20) and on Solaris
> 7 (not sure which Apache version, but 19 < v < 23?).
>
> When we moved the module to RedHat 7.2, we began to experience this hanging
> behavior.
>

Redhat's c++ libs can be flakey. With RH7.2, you can either:

1) install the compatability libraries, and use an old binary from 6.2,

or

2) try it with gcc3, which fixes alot of the odd gcc 2.9.x bugs in
redhat, especially w/r/t stl.

-jon

--
jon@divisionbyzero.com || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing."
RE: httpd 1.3.23 + custom module hanging at startup on RHL7.2? [ In reply to ]
jon,

thanks. we'll see if we can give that a shot.

pete



-----Original Message-----
From: jon schatz [mailto:jon@divisionbyzero.com]
Sent: Wednesday, February 13, 2002 9:36 PM
To: users@httpd.apache.org
Subject: Re: httpd 1.3.23 + custom module hanging at startup on RHL7.2?


On Wed, 2002-02-13 at 18:25, Cipollone, Peter (Factiva) wrote:
> Scenario:
> We have written an Apache module in C++ (modified Makefiles and
> apxs-generated goods per web instructions). This module has registered a
> "module initializer" and then an array of five dispatch handlers. This
> module worked fine on RedHat Linux 6.2 (under Apache 1.3.20) and on
Solaris
> 7 (not sure which Apache version, but 19 < v < 23?).
>
> When we moved the module to RedHat 7.2, we began to experience this
hanging
> behavior.
>

Redhat's c++ libs can be flakey. With RH7.2, you can either:

1) install the compatability libraries, and use an old binary from 6.2,

or

2) try it with gcc3, which fixes alot of the odd gcc 2.9.x bugs in
redhat, especially w/r/t stl.

-jon

--
jon@divisionbyzero.com || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing."

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org