Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 1999 02:16:12 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        dillon@apollo.backplane.com (Matthew Dillon)
Cc:        tlambert@primenet.com, kuku@gilberto.physik.RWTH-Aachen.DE, hackers@FreeBSD.ORG
Subject:   Re: portability of shm, mmap, pipes and socket IPC
Message-ID:  <199902110216.TAA08700@usr06.primenet.com>
In-Reply-To: <199902110114.RAA87339@apollo.backplane.com> from "Matthew Dillon" at Feb 10, 99 05:14:58 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> :FreeBSD must maintain and correctly apply at process exit the value of
> :sem_adj.  See the referenced Solaris man pages for semantic details.
> 
>     In other words, you have no idea whether there's a bug or not.  This
>     is more second hand ( or worse ) information.

No.

It is a bug.

SVR4, per SVID III, tracks sem_adj.  Those were just the man pages I
had handy that you could read.


>     Look, I don't have a problem with second hand information - but
>     I do have a problem with it being put out as solid fact when it
>     isn't.  It's one thing to say that there might be a bug, quite
>     another to start crying wolf over unproven and unresearched
>     reports.    It doesn't do anyone any good to condemn a system
>     for having a 'bug' when you can't even describe what the bug is!

You must be referring th the INN stuff here, since the sem_adj failure
when a process core dumps *is* a bug, right?  See kern/sysv_sem.c,
~line 689:

                        if (sopptr->sem_op < 0) {
                                if (semptr->semval + sopptr->sem_op < 0) {
#ifdef SEM_DEBUG 
                                        printf("semop:  can't do it now\n");
#endif  
                                        break;
                                } else {


And from the man page:

      sem_op is a negative integer; {ALTER}

      .  If semval is less than the absolute value of sem_op and
          (sem_flg&IPC_NOWAIT) is false, semop()  increments  the
          semncnt  associated  with  the  specified semaphore and
          suspends execution of the calling process until one  of
          the following conditions occur:

          .  semval becomes greater than or equal to the absolute
             value of sem_op.  When this  occurs,  the  value  of
             semncnt  associated  with the specified semaphore is
             decremented, the absolute value of  sem_op  is  sub­
             tracted  from  semval  and, if (sem_flg&SEM_UNDO) is
             true, the absolute value of sem_op is added  to  the
             calling  process's  semadj  value  for the specified
             semaphore.

          .  The semid for which the calling process is  awaiting
             action  is  removed from the system (see semctl(2)).
             When this occurs, errno is set equal to EIDRM, and a
             value of -1 is returned.

          .  The  calling process receives a signal that is to be
             caught.  When this  occurs,  the  value  of  semncnt
             associated  with  the  specified semaphore is decre­
             mented, and the calling process resumes execution in
             the manner prescribed in signal(3C).

i.e.: "semop: can't do it now" doesn't cut it.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902110216.TAA08700>