httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: [BUG] SHARED_CORE probably broken in 1.3.5
Date Tue, 23 Mar 1999 15:58:51 GMT

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

Mime
View raw message