Package: bind9 Version: 1:9.5.0.dfsg.P2-5.1 Followup-For: Bug #512285
The cause of this bug (#512285) seems to be bug in the implementation of atomic operations for the Alpha processor. Some of the parameters to the inline assembly operations are specified to be write-only (results), when they are in fact used in a read-write fashion. This causes the current gcc (4.2.4) to allocate some of the parameters into the same physical registers, causing unintentional aliasing. At least the operation "isc_atomic_xadd" works always wrong, when trying to add 1 to 0. The buggy code yields a result of 0 instead of 1. This causes confusion in reference counting code within "libisc" packaged with bind9, and subsequently named dies of assertion failure due to an impossible object reference count after running for a while. In addition to fixing paramter modes, this patch also adds memory barrier instructions before and after atomic operation routines, in order to ensure correct memory operation sequencing on SMP systems. This patch provides a fix for the gcc version of the code only. I do not know if the Tru64 cc version needs to be fixed also. The patch is for the file lib/isc/alpha/include/isc/atomic.h in the bind9 source package. I hope you find this useful. --begin patch-------- --- atomic.h.orig 2009-01-21 21:05:09.317975272 +0200 +++ atomic.h 2009-01-21 17:43:48.134552663 +0200 @@ -114,12 +114,14 @@ __asm__ volatile( "1:" + "mb;" "ldl_l %0, %1;" /* load old value */ "mov %0, %2;" /* copy the old value */ "addl %0, %3, %0;" /* calculate new value */ "stl_c %0, %1;" /* attempt to store */ "beq %0, 1b;" /* spin if failed */ - : "=&r"(temp), "+m"(*p), "=r"(prev) + "mb;" + : "=&r"(temp), "+m"(*p), "=&r"(prev) : "r"(val) : "memory"); @@ -132,10 +134,12 @@ __asm__ volatile( "1:" + "mb;" "ldl_l %0, %1;" /* load old value */ "mov %2, %0;" /* value to store */ "stl_c %0, %1;" /* attempt to store */ "beq %0, 1b;" /* if it failed, spin */ + "mb;" : "=&r"(temp), "+m"(*p) : "r"(val) : "memory"); @@ -147,6 +151,7 @@ __asm__ volatile( "1:" + "mb;" "ldl_l %0, %1;" /* load old value */ "mov %0, %2;" /* copy the old value */ "cmpeq %0, %3, %0;" /* compare */ @@ -154,8 +159,9 @@ "mov %4, %0;" /* value to store */ "stl_c %0, %1;" /* attempt to store */ "beq %0, 1b;" /* if it failed, spin */ + "mb;" "2:" - : "=&r"(temp), "+m"(*p), "=r"(prev) + : "=&r"(temp), "+m"(*p), "=&r"(prev) : "r"(cmpval), "r"(val) : "memory"); --end patch---------- -- System Information: Debian Release: 5.0 APT prefers proposed-updates APT policy: (500, 'proposed-updates'), (500, 'testing') Architecture: alpha Kernel: Linux 2.6.26-1-alpha-smp (SMP w/1 CPU core) Locale: lang=fi...@euro, lc_ctype=fi...@euro (charmap=ISO-8859-15) Shell: /bin/sh linked to /bin/bash Versions of packages bind9 depends on: ii adduser 3.110 add and remove users and groups ii bind9utils 1:9.5.0.dfsg.P2-5.1 Utilities for BIND ii debconf [debconf-2.0 1.5.24 Debian configuration management sy ii libbind9-40 1:9.5.0.dfsg.P2-5.1 BIND9 Shared Library used by BIND ii libc6.1 2.7-18 GNU C Library: Shared libraries ii libcap2 2.11-2 support for getting/setting POSIX. ii libdb4.6 4.6.21-11 Berkeley v4.6 Database Libraries [ ii libdns43 1:9.5.0.dfsg.P2-5.1 DNS Shared Library used by BIND ii libisc44 1:9.5.0.dfsg.P2-5.1 ISC Shared Library used by BIND ii libisccc40 1:9.5.0.dfsg.P2-5.1 Command Channel Library used by BI ii libisccfg40 1:9.5.0.dfsg.P2-5.1 Config File Handling Library used ii libkrb53 1.6.dfsg.4~beta1-5 MIT Kerberos runtime libraries ii libldap-2.4-2 2.4.11-1 OpenLDAP libraries ii liblwres40 1:9.5.0.dfsg.P2-5.1 Lightweight Resolver Library used ii libssl0.9.8 0.9.8g-15 SSL shared libraries ii libxml2 2.6.32.dfsg-5 GNOME XML library ii lsb-base 3.2-20 Linux Standard Base 3.2 init scrip ii net-tools 1.60-22 The NET-3 networking toolkit ii netbase 4.34 Basic TCP/IP networking system bind9 recommends no packages. Versions of packages bind9 suggests: ii bind9-doc 1:9.5.0.dfsg.P2-5.1 Documentation for BIND ii dnsutils 1:9.5.0.dfsg.P2-5.1 Clients provided with BIND pn resolvconf <none> (no description available) pn ufw <none> (no description available) -- debconf information: * bind9/different-configuration-file: * bind9/run-resolvconf: false * bind9/start-as-user: bind -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org