Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 27332 invoked by uid 6000); 23 Mar 1999 16:30:46 -0000 Received: (qmail 27303 invoked from network); 23 Mar 1999 16:30:42 -0000 Received: from slarti.muc.de (193.149.48.10) by taz.hyperreal.org with SMTP; 23 Mar 1999 16:30:42 -0000 Received: (qmail 17559 invoked by uid 66); 23 Mar 1999 16:32:24 -0000 Received: from en by slarti with UUCP; Tue Mar 23 16:32:24 1999 -0000 Received: by en1.engelschall.com (Sendmail 8.9.3) for new-httpd@apache.org id QAA20053; Tue, 23 Mar 1999 16:58:52 +0100 (CET) Date: Tue, 23 Mar 1999 16:58:51 +0100 From: "Ralf S. Engelschall" To: new-httpd@apache.org Subject: Re: [BUG] SHARED_CORE probably broken in 1.3.5 Message-ID: <19990323165851.A18516@engelschall.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i Organization: Engelschall, Germany. X-Web-Homepage: http://www.engelschall.com/ X-PGP-Public-Key: https://www.engelschall.com/ho/rse/pgprse.asc X-PGP-Fingerprint: 00 C9 21 8E D1 AB 70 37 DD 67 A2 3A 0A 6F 8D A5 Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org In article <19990323143513.A1568@deejai.mch.sni.de> you wrote: > On Mon, Mar 22, 1999 at 03:19:26PM +0100, Ralf S. Engelschall wrote: >> Please let me understand it, Martin. You say that the environ variable isn't >> available to the mod_env DSO. Ok, this variable is usually made available by >> execve(2), so why makes it a difference whether the Apache core stays inside a >> DSO or not? I would have guessed the problem is whether mod_env is a DSO >> _ITSELF_, i.e. SHARED_MODULE. Hmmm... interesting. OTOH AFAIK the direct use >> of this variable via "extern char **environ" isn't very portable, isn't it? > > To be more precise: On my i386-sni-svr4 platform, ... > * I compiled apache_1.3.5 with -enable-shared=env > * I started apache > * I got: > Syntax error on line 13 of /etc/httpd.conf: > Cannot load /opt/apache/sbin/mod_env.so into server: > dynamic linker: src/httpd: relocation error: symbol not found: environ > > * I tested "nm libhttpd.ep" and see that "environ" is marked as a "WEAK" > reference > > * I modified src/main/http_main.c as follows: > --- http_main.c 1999/03/18 21:38:00 1.228 > +++ http_main.c 1999/03/23 13:31:56 > @@ -6016,9 +6016,12 @@ > */ > > extern int ap_main(int argc, char *argv[]); > +extern char **environ; > +char *_tmp_e = 0; > > int main(int argc, char *argv[]) > { > + _tmp_e = environ[0]; > return ap_main(argc, argv); > } > > > * I checked "nm libhttpd.ep" and saw that now "environ" is no > longer marked as a "WEAK" reference: > nm apache_1.3.5/src/libhttpd.ep | grep environ > [115] | 134530408| 4|OBJT |GLOB |0 |12 |_environ > [131] | 134530408| 4|OBJT |GLOB |0 |12 |environ > > * In spite of this, starting the server still give me: > Cannot load /opt/apache/sbin/mod_env.so into server: > dynamic linker: src/httpd: relocation error: symbol not found: environ > > Compiling --disable-shared=env should do the trick, however > (I'm going to try that now). Ok, _that's_ what I expected, of course. I expected it to fail when mod_env is a DSO. But I was sure it cannot be related to SHARED_CORE which (as it looks now) finally it isn't, right? Ralf S. Engelschall rse@engelschall.com www.engelschall.com