Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 59812 invoked by uid 500); 20 Apr 2001 12:10:31 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 59683 invoked from network); 20 Apr 2001 12:10:26 -0000 Sender: jfclere@vtxrm2.bcn.fsc.net Message-ID: <3AE02A0B.9BE893C@fujitsu-siemens.com> Date: Fri, 20 Apr 2001 14:22:35 +0200 From: jean-frederic clere X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.4.0 i586) X-Accept-Language: en MIME-Version: 1.0 To: "new-httpd@apache.org" Subject: [PATCH] mod_log_config.c Content-Type: multipart/mixed; boundary="------------28DB3AC08F90E2FB5CFAB7D4" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------28DB3AC08F90E2FB5CFAB7D4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have detected that the variable log_hash of mod_log_config is not initialized correctly. It causes a core on Solaris... Find enclosed the patch I have used to fix the problem. Cheers Jean-frederic --------------28DB3AC08F90E2FB5CFAB7D4 Content-Type: text/plain; charset=us-ascii; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" Index: mod_log_config.c =================================================================== RCS file: /home/cvs/apache/httpd-2.0/modules/loggers/mod_log_config.c,v retrieving revision 1.54 diff -u -r1.54 mod_log_config.c --- mod_log_config.c 2001/04/18 21:06:07 1.54 +++ mod_log_config.c 2001/04/20 11:59:58 @@ -209,7 +209,7 @@ static int xfer_flags = (APR_WRITE | APR_APPEND | APR_CREATE); static apr_fileperms_t xfer_perms = APR_OS_DEFAULT; -static apr_hash_t *log_hash; +static apr_hash_t *log_hash=NULL; /* POSIX.1 defines PIPE_BUF as the maximum number of bytes that is * guaranteed to be atomic when writing a pipe. And PIPE_BUF >= 512 @@ -1148,6 +1148,8 @@ log_struct->func = handler; log_struct->want_orig_default = def; + if (log_hash==NULL) + log_hash = apr_hash_make(p); apr_hash_set(log_hash, tag, 1, (const void *)log_struct); } @@ -1155,7 +1157,8 @@ { static APR_OPTIONAL_FN_TYPE(ap_register_log_handler) *log_pfn_register; - log_hash = apr_hash_make(p); + if (log_hash==NULL) + log_hash = apr_hash_make(p); log_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_log_handler); if (log_pfn_register) { --------------28DB3AC08F90E2FB5CFAB7D4--