From owner-cvs-src-old@FreeBSD.ORG Mon Dec 1 17:41:06 2008 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DDF61065691 for ; Mon, 1 Dec 2008 17:41:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 49EF88FC17 for ; Mon, 1 Dec 2008 17:41:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mB1Hf3lj089866 for ; Mon, 1 Dec 2008 17:41:03 GMT (envelope-from marcel@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mB1Hf3Hj089865 for cvs-src-old@freebsd.org; Mon, 1 Dec 2008 17:41:03 GMT (envelope-from marcel@repoman.freebsd.org) Message-Id: <200812011741.mB1Hf3Hj089865@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marcel@repoman.freebsd.org using -f From: Marcel Moolenaar Date: Mon, 1 Dec 2008 17:40:57 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/ia64/include atomic.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 17:41:06 -0000 marcel 2008-12-01 17:40:57 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/ia64/include atomic.h Log: SVN rev 185526 on 2008-12-01 17:40:57Z by marcel MFC rev 179382: Work-around a compiler optimization bug, that broke libthr. Massive inlining resulted in constant propagation to the extend that cmpval was known to the compiler to be URWLOCK_WRITE_OWNER (= 0x80000000U). Unfortunately, instead of zero-extending the unsigned constant, it was sign-extended. As such, the cmpxchg instruction was comparing 0x0000000080000000LU to 0xffffffff80000000LU and obviously didn't perform the exchange. But, since the value returned by cmpxhg equalled cmpval (when zero- extended), the _thr_rtld_lock_release() function thought the exchange did happen and as such returned as if having released the lock. This was not the case. Subsequent locking requests found rw_state non-zero and the thread in question entered the kernel and block indefinitely. The work-around is to zero-extend by casting to uint64_t. Approved by: re (kensmith) Revision Changes Path 1.11.2.2 +1 -1 src/sys/ia64/include/atomic.h