Received: by taz.hyperreal.com (8.8.3/V2.0) id QAA10013; Sun, 8 Dec 1996 16:39:56 -0800 (PST) Received: from sierra.zyzzyva.com by taz.hyperreal.com (8.8.3/V2.0) with ESMTP id QAA10002; Sun, 8 Dec 1996 16:39:50 -0800 (PST) Received: from sierra.zyzzyva.com (localhost [127.0.0.1]) by sierra.zyzzyva.com (8.8.2/8.8.2) with ESMTP id SAA19551 for ; Sun, 8 Dec 1996 18:40:57 -0600 (CST) Message-Id: <199612090040.SAA19551@sierra.zyzzyva.com> To: new-httpd@apache.org Subject: reentrant problem in log_error Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 08 Dec 1996 18:40:56 -0600 From: Randy Terbush Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com This is the only problem that I would consider show stopper. Does anyone have any further comments on the patch I submitted below. After kicking this around with Paul the other day, I concluded that perhaps we need to suspend the signal mask while in this function. Since my knowledge of signals is fresh from Stevens, could someone comment on the following addition to the patch below? Here is a current patch. This does not seem to break anything. I'll need to give this to an affected site to see if it fixes anything. Can someone here comment on the changes? *** http_log.c.orig Sun Dec 1 18:01:29 1996 --- http_log.c Sun Dec 8 18:04:14 1996 *************** *** 131,137 **** dup2(fileno(s->error_log),STDERR_FILENO); } ! void log_pid(pool *p, char *pid_fname) { FILE *pid_file; if (!pid_fname) return; --- 131,138 ---- dup2(fileno(s->error_log),STDERR_FILENO); } ! void log_pid(pool *p, char *pid_fname) ! { FILE *pid_file; if (!pid_fname) return; *************** *** 145,158 **** fclose(pid_file); } ! void log_error(char *err, server_rec *s) { ! fprintf(s->error_log, "[%s] %s\n",get_time(),err); ! fflush(s->error_log); } ! void ! log_unixerr(const char *routine, const char *file, const char *msg, ! server_rec *s) { const char *p, *q; --- 146,168 ---- fclose(pid_file); } ! void log_error(char *err, server_rec *s) ! { ! int len; ! char buf[512]; ! sigset_t clrmask, oldmask; ! ! ! sigemptyset(&clrmask); ! sigprocmask(SIG_SETMASK, &clrmask, &oldmask); ! ! len = sprintf(buf, "[%s] %s\n", get_time(), err); ! write(fileno(s->error_log), buf, len + 1); ! ! sigprocmask(SIG_SETMASK, &oldmask, NULL); } ! void log_unixerr(const char *routine, const char *file, const char *msg, server_rec *s) { const char *p, *q;