You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Yves Arrouye <yv...@apple.com> on 1998/08/19 03:49:43 UTC

config/2870: After a module has been removed from the modules list, it can't be put back in it.

>Number:         2870
>Category:       config
>Synopsis:       After a module has been removed from the modules list, it can't be put back in it.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Aug 18 18:50:01 PDT 1998
>Last-Modified:
>Originator:     yves@apple.com
>Organization:
apache
>Release:        1.3.1
>Environment:
Rhapsody yves 5.2 Kernel Release 5.2: Sun Aug  2 15:52:18 PDT 1998; root(rcbuilder):Objects/kernel-120.obj~4/RELEASE_PPC Copyright (c) 1988-1995,1997-1998 Apple Computer, Inc. All Rights Reserved.  Power Macintosh
>Description:
[DISCLAIMER: this could be a side-effect of the MacOS X Server port, but I doubt it as the code concerned is http_config.c, which was not touched.]

When Apache with DSO modules is launched, it gets DSO modules, then call unload on them, then loads them again and adds them at this point to the modules list. Unfortunately, a module is only chained in the list if its next pointer is 0, but this pointer is not cleared when the module is unchained. So Apache complains the second time and doesn't chain the module back :-(

[Tue Aug 18 18:36:28 1998] [error] Cannot remove module mod_rewrite.c: not found in module list
>How-To-Repeat:
Have a module be dynamically loaded. Start Apache, then stop it. In the log, there is a message about the module not being able to be removed.
>Fix:
Here it is.

--- src/main/http_config.c.orig Tue Aug 18 18:37:47 1998
+++ src/main/http_config.c      Tue Aug 18 18:37:43 1998
@@ -621,6 +621,8 @@
        }
        /* Eliminate us from the module list */
        modp->next = modp->next->next;
+       /* And set our next module to null so we can be added back */
+       m->next = 0;
     }
 
     m->module_index = -1;      /* simulate being unloaded, should
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[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!         ]