httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xyntrix <>
Subject [users@httpd] Multiple calls to the same function from AP_INIT_TAKEX?
Date Fri, 06 Nov 2009 21:39:29 GMT

I am working on making some updates to a custom module for Apache that has been running fine
for the past year. One of my goals is to rename a directive in my config files, but attempting
to keep both the old and new directive names active.
Here's a genericized snip of the code:

static const command_rec awesome_module_cmds[] = {
        AP_INIT_TAKE1( "BlahDirective", blah_function, NULL, RSRC_CONF, "blah description"),
        AP_INIT_TAKE1( "OtherDirective", blah_function, NULL, RSRC_CONF, "blah description
(OtherDirective has been deprecated, please use BlahDirective"),

When I compile and install my module everything seems swell and the module functionally works
as intended -- until graceful restarts. Intermittently httpd will segfault when I the two
directives are linked to the same function during a graceful restart. When I install the new
module I make sure to fully stop apache, copy the module into place, then start up Apache.
 I'm using the prefork MPM with Apache 2.2.13.

Here's what I see in the error log:

[Thu Nov 05 13:07:14 2009] [notice] Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5
mod_fastcgi/2.4.7 configured -- resuming normal operations
[Thu Nov 05 13:07:30 2009] [notice] seg fault or similar nasty error detected in the parent

The parent httpd parent process has died at this point I end up with several orphans. I've
attempted to stack trace the parent process but there's nothing useful to be gleaned from

I backed out all of my code changes a few lines at a time, compiled, installed -- and gracefully
restarted Apache over and over in order to narrow down the root cause of these segfaults.
I found when I don't have two directives calling the same function, there's no issues with
graceful restarts.

I was unable to find anything in the API docs or through google that would indicate this is
a problem -- am I using AP_INIT_TAKEX incorrectly here? If it's perfectly acceptable to do
what I'm trying to do, I'll assume the issue is probably within my function somewhere. If
it's not acceptable to use AP_INIT_TAKE1 in the way I am using it, is there a preferred way
to have multiple directive names tie to the same function?

-Mike Mclane

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message