Subject: Re: Problem with gcore and permissions
To: None <christos@zoulas.com>
From: D'Arcy J.M. Cain <darcy@NetBSD.org>
List: tech-kern
Date: 01/17/2005 17:22:47
On Tue, 11 Jan 2005 17:30:44 -0500
"D'Arcy J.M. Cain" <darcy@NetBSD.org> wrote:
> > | Note that gcore fails on -current as well.  The gdb attach works
> > | fine though.  Unfortunately, so does PostgreSQL (it doesn't get
> > | into a busy loop) so I can't use that to track down my PostgreSQL
> > | problem.
> > 
> > So the problem is fixed :-)
> 
> In -current, yes.  But we can't leave our release in that state, can
> we?
>  That's why I am trying to debug this with the 2.0 branch instead of
>  the
> release.  I am hoping we can fix this for 2.0.1 or at least 2.1.

It's possible that I have identified the change that fixes this.  In
src/sys/kern/sysv_sem.c the following was pulled up in ticket #903. 
Could this be the critical change?  I am testing this now and so is
Andreas Wrede (he was discussing this in the -help mailing list) so we
should be pretty sure.  Unfortunately I have made other changes and have
to wait to assure myself that the problem still exists and Andreas can't
reboot until later tonight but I expect that we shall both be able to
report on this by tomorrow.  In the meantime does anyone have any idea
if this could fix an infinite looping issue
in certain cases?

Index: sysv_sem.c
===================================================================
RCS file: /cvsroot/src/sys/kern/sysv_sem.c,v
retrieving revision 1.53.4.1
retrieving revision 1.53
diff -u -r1.53.4.1 -r1.53
--- sysv_sem.c  12 Jan 2005 22:38:07 -0000      1.53.4.1
+++ sysv_sem.c  23 Mar 2004 13:22:04 -0000      1.53
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysv_sem.c,v 1.53.4.1 2005/01/12 22:38:07 he Exp $    
*/
+/*     $NetBSD: sysv_sem.c,v 1.53 2004/03/23 13:22:04 junyoung Exp $  
*/

 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  */

 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysv_sem.c,v 1.53.4.1 2005/01/12 22:38:07
he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_sem.c,v 1.53 2004/03/23 13:22:04
junyoung Exp$");

 #define SYSVSEM

@@ -797,9 +797,6 @@
                semptr->sempid = p->p_pid;
        }

-       /* Update sem_otime */
-       semaptr->sem_otime = time.tv_sec;
-
        /* Do a wakeup if any semaphore was up'd. */
        if (do_wakeup) {
                SEM_PRINTF(("semop:  doing wakeup\n"));

-- 
D'Arcy J.M. Cain <darcy@NetBSD.org>
http://www.NetBSD.org/