You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/05/26 11:48:01 UTC

DO NOT REPLY [Bug 45076] New: pre_config hooks not called in order

https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

           Summary: pre_config hooks not called in order
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: maxmeneault@free.fr


Created an attachment (id=22000)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22000)
pre_config hooks patch for trunk

Apparently pre_config hooks are not ordered when ap_run_pre_config is called.
I noticed and verified one issue and I noticed another one (syntactically only)
while reading through the code.

First issue (verified):
While during the first configuration pass pre_config hooks seem to be ordered
for prelinked modules during the second one hooks are not ordered (i.e. not in
the order specified by APR_HOOK_FIRST...defines).
Fix:
apr_hook_sort_all is called too late during second and further configuration
passes.
It needs to be called before ap_run_pre_config (l.734 of server/main.c).

Second issue (only noticed while reading the code):
pre_config hooks might not be ordered for dynamically loaded modules even
during first configuration pass.
Fix:
apr_hook_sort_all needs to be called before ap_run_pre_config (l.656 of
server/main.c)

I was working on 2.2.3 which suffer from these issues. I checked 2.2.8 and
trunk which still suffer these issues.

Please see attached a patch for trunk to fix these issues.

I compiled the server and checked that my patch correct the first issue (I
don't use dynamically loaded modules).

My patch shouldn't provoke any regression however I don't know why
apr_hook_sort_all was called so late. Was there any reason for that?

The only assumption I make is that hooks have to be hooked during register
hooks during module initialization or otherwise apr_hook_sort_all should be
manually called after registering a hook (as mod_cgid does).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

MENEAULT <ma...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from MENEAULT <ma...@free.fr> 2011-06-16 06:56:58 UTC ---
I checked trunk revision 1032002; the patch to server/main.c is the same as
mine so it should effectively be fixed in trunk.

Thanks.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

--- Comment #7 from Stefan Fritsch <sf...@sfritsch.de> 2011-10-08 07:16:58 UTC ---
committed in trunk as r1180325

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076





--- Comment #2 from MENEAULT <ma...@free.fr>  2008-11-08 12:47:08 PST ---
Created an attachment (id=22844)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22844)
pre_config hooks patch for 2.2.10

Adding patch for 2.2.10 as requested by Bruce Mills (Apache dev mailing list,
thread: ap_run_pre_config issue).
Note: I didn't test it but it should work as well as older patches.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

Torsten F <to...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #5 from Torsten F <to...@gmx.net> 2011-10-07 18:01:29 UTC ---
Reopen the bug because the fix introduces a very similar bug.

Modperl allows to write modules in Perl. Those modules can also register 
hooks. The earliest point in time when that may happen is in 
ap_process_config_tree() because there are config statements that 
influence certain parameters of the perl interpreter. So, we have to 
process those statements prior to starting the interpreter. But only the 
perl interpreter knows which modules to load. Those modules then can 
install hooks. But with revision 1162854 these hooks are called out of 
order.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

Stefan Fritsch <sf...@sfritsch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Stefan Fritsch <sf...@sfritsch.de> 2012-02-04 20:55:27 UTC ---
fixed in 2.2.22

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

--- Comment #6 from Torsten F <to...@gmx.net> 2011-10-07 18:07:58 UTC ---
Created attachment 27730
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27730
fix order for pre_config hooks as well as hooks that are registered later

The patch is to be applied on top of revision 1162854 which has MENEAULT's
patch applied. In addition to calling apr_hook_sort_all() at the new location
it calls it again when ap_process_config_tree() is done.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

Stefan Fritsch <sf...@sfritsch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #3 from Stefan Fritsch <sf...@sfritsch.de> 2011-06-15 22:32:29 UTC ---
This is already fixed in trunk and has been proposed for 2.2.20

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076


MENEAULT <ma...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|maxmeneault@free.fr         |




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076


MENEAULT <ma...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxmeneault@free.fr




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45076] pre_config hooks not called in order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076





--- Comment #1 from MENEAULT <ma...@free.fr>  2008-05-26 03:23:00 PST ---
Created an attachment (id=22001)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22001)
pre_config hooks patch for 2.2.8

Patch for the 2.2.8 version (just in case)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org