The buglet was that prctl() was issued always when available, when goal (to be consistent with httpd 2.x) was to only issue it if admin has coded CoreDumpDirectory. The buglet was due to a misunderstanding in the use of ap_coredump_dir[].

ap_coredump_dir_configured is not considered part of the API so the declaration is not decorated with API_VAR_EXPORT and it is not in the exports file for AIX.
Index: src/include/http_conf_globals.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/http_conf_globals.h,v
retrieving revision 1.54
diff -u -r1.54 http_conf_globals.h
--- src/include/http_conf_globals.h     28 Jan 2004 21:22:21 -0000      1.54
+++ src/include/http_conf_globals.h     29 Jan 2004 20:21:04 -0000
@@ -127,6 +127,7 @@
  * is some memory corruption, so we allocate it statically.
  */
 extern API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN];
+extern int ap_coredump_dir_configured;
 
 #ifdef __cplusplus
 }
Index: src/main/http_core.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_core.c,v
retrieving revision 1.329
diff -u -r1.329 http_core.c
--- src/main/http_core.c        28 Jan 2004 21:22:21 -0000      1.329
+++ src/main/http_core.c        29 Jan 2004 20:21:09 -0000
@@ -2723,6 +2723,7 @@
                          " does not exist or is not a directory", NULL);
     }
     ap_cpystrn(ap_coredump_dir, arg, sizeof(ap_coredump_dir));
+    ap_coredump_dir_configured = 1;
     return NULL;
 }
 
Index: src/main/http_main.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.608
diff -u -r1.608 http_main.c
--- src/main/http_main.c        28 Jan 2004 21:22:21 -0000      1.608
+++ src/main/http_main.c        29 Jan 2004 20:21:15 -0000
@@ -315,8 +315,8 @@
 
 API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]="";
 API_VAR_EXPORT char ap_server_confname[MAX_STRING_LEN]="";
-#define DEFAULT_COREDUMP_DIR ""
-API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]=DEFAULT_COREDUMP_DIR;
+API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]="";
+int ap_coredump_dir_configured=0;
 
 API_VAR_EXPORT array_header *ap_server_pre_read_config=NULL;
 API_VAR_EXPORT array_header *ap_server_post_read_config=NULL;
@@ -4347,7 +4347,7 @@
 #endif
 
 #ifdef HAVE_SET_DUMPABLE
-    if (strcmp(ap_coredump_dir, DEFAULT_COREDUMP_DIR)) {
+    if (ap_coredump_dir_configured) {
         /* user set CoredumpDirectory, so they want to get core dumps
          */
         if (prctl(PR_SET_DUMPABLE, 1)) {

Reply via email to