Date: Wed, 28 May 2008 16:41:02 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/ia64/include atomic.h Message-ID: <200805281641.m4SGf3ix052304@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
marcel 2008-05-28 16:41:02 UTC FreeBSD src repository Modified files: sys/ia64/include atomic.h Log: 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. Revision Changes Path 1.14 +1 -1 src/sys/ia64/include/atomic.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805281641.m4SGf3ix052304>