Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Delivered-To: mailing list new-httpd@apache.org Delivered-To: moderator for new-httpd@apache.org Received: (qmail 99535 invoked from network); 20 Feb 2000 12:00:49 -0000 Received: from 162.c200.ethome.net.tw (HELO genius.cirx.org) (@202.178.200.162) by locus.apache.org with SMTP; 20 Feb 2000 12:00:49 -0000 Received: (from clkao@localhost) by genius.cirx.org (8.9.3/8.9.1) id UAA57191 for new-httpd@apache.org; Sun, 20 Feb 2000 20:00:57 +0800 (CST) (envelope-from clkao) Date: Sun, 20 Feb 2000 20:00:57 +0800 From: Chia-liang Kao To: new-httpd@apache.org Subject: [PATCH] 2.0 builds, but dumps core on FreeBSD 3.3 (ap_lock) Message-ID: <20000220200057.A56587@genius.cirx.org> References: <5FE9B713CCCDD311A03400508B8B301303D93B@bdr-xcln.is.matchlogic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from rbb@apache.org on Thu, Feb 17, 2000 at 11:47:42AM -0500 Hi, I just played with apache-2.0 on FreeBSD 4.0-current, and it coredumped on ap_lock. This is because (in prefork mpm) setup_lock() is called in ap_initialize(), and ap_init_alloc is called before ap_initialize. The ap_lock() causing segfault missed the proper op_on setting for semop. I don't know if sysv sem strictly require implementations to follow the order in struct sembuf. If so, the follow in patch would help. Cheers, CLK On Thu, Feb 17, 2000 at 11:47:42AM -0500, rbb@apache.org wrote: > I need to know which call to ap_lock is causing the seg fault. > Unfortunately, I do not currently have access to a FreeBSD machine that I > can do any testing on. I am hoping to get access to a FreeBSD machine in > a few weeks. If you can get me either an account on a FreeBSD machine or > a complete trace of the seg fault, I will see what I can do. Index: crossproc.c =================================================================== RCS file: /cvs/apache/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v retrieving revision 1.12 diff -u -r1.12 crossproc.c --- crossproc.c 2000/01/25 23:04:27 1.12 +++ crossproc.c 2000/02/20 12:01:21 @@ -57,16 +57,10 @@ #if defined (USE_SYSVSEM_SERIALIZE) -static struct sembuf op_on; -static struct sembuf op_off; +static struct sembuf op_on = {0, -1, SEM_UNDO}; +static struct sembuf op_off = {0, 1, SEM_UNDO}; void setup_lock() { - op_on.sem_num = 0; - op_on.sem_op = -1; - op_on.sem_flg = SEM_UNDO; - op_off.sem_num = 0; - op_off.sem_op = 1; - op_off.sem_flg = SEM_UNDO; } ap_status_t lock_cleanup(void *lock_)