Received: (qmail 83418 invoked by uid 501); 22 Dec 2000 10:09:33 -0000 Message-Id: <20001222100933.83417.qmail@locus.apache.org> Date: 22 Dec 2000 10:09:33 -0000 From: Gopi Krishna Bhavaraju Reply-To: gopi@pspl.co.in To: submit@bugz.apache.org Subject: Hard-coded dlopen flags (RTLD_GLOBAL) Ref: mod_so.c and unix.c X-Send-Pr-Version: 3.110 >Number: 7008 >Category: mod_so >Synopsis: Hard-coded dlopen flags (RTLD_GLOBAL) Ref: mod_so.c and unix.c >Confidential: no >Severity: critical >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Dec 22 02:10:01 PST 2000 >Closed-Date: Wed Jan 03 21:19:56 PST 2001 >Last-Modified: Thu Jan 4 10:10:01 PST 2001 >Originator: gopi@pspl.co.in >Release: 1.3.12 and 1.3.14 >Organization: >Environment: SunOS ultra 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-5_10 >Description: If two modules are have same function name define in them the Solaris operationg system always uses the first definition available at run-time as these modules are loaded using RTLD_GLOBAL flag, which leads to core dump. However it works fine if I load them using RTLD_LOCAL flag in ap_dso_load() function in file src/os/unix/os.c. That means each module code space is not protected by Apache web-server at run-time, unless I modify the Apache source code itself, which I can not do as my modules will be used for proprietory purposes. >How-To-Repeat: Load two modules using DSO mechanism which have a same function defined in them with different body or use dlopen function in one of them. And get a happy core dump. >Fix: Parameterize the dlopen flags for "LoadModule" directive to specify the scope(RTLD_GLOBAL or RTLD_LOCALE) of the module to be loaded in the httpd.conf file. >Release-Note: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: fanf State-Changed-When: Wed Jan 3 21:19:56 PST 2001 State-Changed-Why: Using RTLD_GLOBAL is necessary to support some features of modules like mod_perl. Work-arounds include declaring the functions in your module static, or choosing properly unique names for the functions. Thanks for using Apache! From: Gopi Krishna Bhavaraju To: fanf@apache.org Cc: apbugs@Apache.Org Subject: Re: mod_so/7008: Hard-coded dlopen flags (RTLD_GLOBAL) Ref: mod_so.c and unix.c Date: Thu, 04 Jan 2001 12:21:21 +0530 Hi, Thanks for the reply. What I meant was NOT to hard code that flag to RTLD_GLOBAL or something. Let the user specify(RTTD_GLOBAL/RTLD_LOCAL) what he wants in the httpd.conf file. And pass this value as a parameter to ap_dso_load() function. You can always keep the default value to RTTD_GLOBAL so that existing modules will work. Right! --Gopi. fanf@apache.org wrote: > [In order for any reply to be added to the PR database, you need] > [to include in the Cc line and make sure the] > [subject line starts with the report component and number, with ] > [or without any 'Re:' prefixes (such as "general/1098:" or ] > ["Re: general/1098:"). If the subject doesn't match this ] > [pattern, your message will be misfiled and ignored. The ] > ["apbugs" address is not added to the Cc line of messages from ] > [the database automatically because of the potential for mail ] > [loops. If you do not include this Cc, your reply may be ig- ] > [nored unless you are responding to an explicit request from a ] > [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ] > > Synopsis: Hard-coded dlopen flags (RTLD_GLOBAL) Ref: mod_so.c and unix.c > > State-Changed-From-To: open-closed > State-Changed-By: fanf > State-Changed-When: Wed Jan 3 21:19:56 PST 2001 > State-Changed-Why: > Using RTLD_GLOBAL is necessary to support some features of > modules like mod_perl. Work-arounds include declaring the > functions in your module static, or choosing properly > unique names for the functions. > Thanks for using Apache! -- Member of Technical Staff Persistent Systems Pvt. Ltd., SB Road, Pune, India. Ph: Off - +91-20-5676700, Ext 530 Res - +91-20-5881178 From: Tony Finch To: Gopi Krishna Bhavaraju Cc: apbugs@Apache.Org Subject: Re: mod_so/7008: Hard-coded dlopen flags (RTLD_GLOBAL) Ref: mod_so.c and unix.c Date: Thu, 4 Jan 2001 18:02:49 +0000 Gopi Krishna Bhavaraju wrote: > >What I meant was NOT to hard code that flag to RTLD_GLOBAL or something. Let the >user specify(RTTD_GLOBAL/RTLD_LOCAL) what he wants in the httpd.conf file. And >pass this value as a parameter to ap_dso_load() function. If you can provide a patch we may consider it. However I doubt it will go into 1.3, so providing a patch against 2.0 would be better. Tony. -- f.a.n.finch fanf@covalent.net dot@dotat.at "And remember my friend, future events such as these will affect you in the future." >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]