From owner-freebsd-stable Sat Apr 6 18:46: 7 2002 Delivered-To: freebsd-stable@freebsd.org Received: from earth.hub.org (earth.hub.org [64.49.215.11]) by hub.freebsd.org (Postfix) with ESMTP id 53FDE37B422; Sat, 6 Apr 2002 18:45:47 -0800 (PST) Received: from localhost.localdomain (earth.hub.org [64.49.215.11]) by localhost (Postfix) with ESMTP id A24A91033B0; Sat, 6 Apr 2002 22:45:29 -0400 (AST) Received: from earth.hub.org (earth.hub.org [64.49.215.11]) by earth.hub.org (Postfix) with ESMTP id 57C50103390; Sat, 6 Apr 2002 22:45:26 -0400 (AST) Date: Sat, 6 Apr 2002 22:45:26 -0400 (AST) From: "Marc G. Fournier" To: freebsd-stable@freebsd.org Cc: jkoshy@freebsd.org, , Subject: Re: Upgraded libraries breaks aolserver port? In-Reply-To: <20020406184751.Q86558-100000@mail1.hub.org> Message-ID: <20020406223214.L86558-100000@mail1.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 6 Apr 2002, Marc G. Fournier wrote: > > Just recently upgraded my machine, and aolserver no longer starts, with an > error of: > > nsthread(20981) error: pthread_cond_timedwait failed in Ns_CondTimedWait: Invalid argument > > OS is: > > 4.5-STABLE FreeBSD 4.5-STABLE #6: Mon Mar 25 21:01:05 CST 2002 > > Has anyone else seen this? > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message > As a followup to this, the 'offending' function is in thread/pthread.cpp ... does anything look "wrong" with the function that would cause the above error in the latest FreeBSD? int Ns_CondTimedWait(Ns_Cond *condPtr, Ns_Mutex *mutexPtr, Ns_Time *timePtr) { pthread_cond_t *cond; pthread_mutex_t *lockPtr; Thread *ownerPtr; Mutex *mPtr; int err, status; struct timespec ts; if (timePtr == NULL) { Ns_CondWait(condPtr, mutexPtr); return NS_OK; } cond = GETCOND(condPtr); mPtr = GETMUTEX(mutexPtr); lockPtr = mPtr->lock; ownerPtr = mPtr->ownerPtr; mPtr->ownerPtr = NULL; /* * Convert the microsecond-based Ns_Time to a nanosecond-based * struct timespec. */ ts.tv_sec = timePtr->sec; ts.tv_nsec = timePtr->usec * 1000; /* * As documented on Linux, pthread_cond_timedwait may return * EINTR if a signal arrives. We have noticed that * EINTR can be returned on Solaris as well although this * is not documented (perhaps, as above, it's possible it * bubbles up from _lwp_cond_timedwait???). Anyway, unlike * the ETIME case above, we'll assume the wakeup is truely * spurious and simply restart the wait knowing that the * ts structure has not been modified. */ do { err = pthread_cond_timedwait(cond, lockPtr, &ts); } while (err == EINTR); #ifdef HAVE_ETIME_BUG /* * See comments above and note that here ETIME is still considered * a spurious wakeup, not an indication of timeout because we're * not making any assumptions about the nature or this bug. * While we're less certain, this should still be ok as properly * written condition code should tolerate the wakeup. */ if (err == ETIME) { err = 0; } #endif if (ERRTIMEDOUT(err)) { status = NS_TIMEOUT; } else if (err != 0) { NsThreadFatal("Ns_CondTimedWait", "pthread_cond_timedwait", err); } else { status = NS_OK; } mPtr->ownerPtr = ownerPtr; ++mPtr->nlock; return status; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message