This error showed up in my logs this morning while I was building some
ports on a uni-processor box. I'm running a version of -current from
July 7 about 1 AM PDT.

Jul  7 07:47:09 scratch kernel: lock order reversal
Jul  7 07:47:09 scratch kernel: 1st 0xcabf7980 pipe mutex (pipe mutex) @ 
Jul  7 07:47:09 scratch kernel: 2nd 0xc0474300 sigio lock (sigio lock) @ 

I don't understand all the new locking stuff in -current, but it looks
to me like maybe there should be a PIPE_UNLOCK()/PIPE_LOCK() wrapper
around the following code in sys_pipe.c since a SIGIO could happen
during the msleep().

                         * Handle non-blocking mode operation or
                         * wait for more data.
                        if (fp->f_flag & FNONBLOCK) {
                                error = EAGAIN;
                        } else {
                                rpipe->pipe_state |= PIPE_WANTR;
                                if ((error = msleep(rpipe, PIPE_MTX(rpipe),
                                    PRIBIO | PCATCH,
                                    "piperd", 0)) == 0)
                                        error = pipelock(rpipe, 1);
                        if (error)
                                goto unlocked_error;

I don't see a way for the locks to be asserted in the opposite order,
though I suppose there might be a case of PROC_LOCK() followed by
PIPE_LOCK() that would conflict with SIGIO_LOCK() followed by

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to