Report information
The Basics
Id:
40668
Status:
resolved
Priority:
Medium/Medium
Queue:

People
Owner:
Nobody in particular
Cc:
AdminCc:

BugTracker
Version Fixed:
9.12.0, 9.11.3, 9.10.7, 9.9.12
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
(no value)
Priority:
P2 Normal
Severity:
S2 Normal
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
BIND Server
Area:
feature

Dates
Created:Thu, 10 Sep 2015 13:40:03 -0400
Updated:Tue, 19 Sep 2017 06:39:07 -0400
Closed:Tue, 19 Sep 2017 06:39:07 -0400



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

Subject: [edmonds@mycre.ws: ISO C11's stdatomic.h]
Date: Thu, 10 Sep 2015 17:40:02 +0000
To: bind-suggest@isc.org
From: "Evan Hunt" <each@isc.org>
----- Forwarded message from Robert Edmonds <edmonds@mycre.ws> ----- Date: Mon, 7 Sep 2015 21:25:07 -0400 From: Robert Edmonds <edmonds@mycre.ws> To: bind-workers@lists.isc.org Subject: ISO C11's stdatomic.h Hi, Standard C now supports architecture-independent atomic operations via the stdatomic.h header, no inline assembly required. This is supported by gcc >= 4.9: ISO C11 atomics (the _Atomic type specifier and qualifier and the <stdatomic.h> header) are now supported. (https://gcc.gnu.org/gcc-4.9/changes.html) and also by clang >= 3.6: Clang now provides an implementation of the standard C11 header <stdatomic.h>. (http://llvm.org/releases/3.6.0/tools/clang/docs/ReleaseNotes.html) If I understand correctly, the isc_atomic_* functions could be implemented in terms of the atomic_* functions as: #include <stdatomic.h> static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, int val) { return atomic_fetch_add(p, val); } static inline isc_int64_t isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) { return atomic_fetch_add(p, val); } static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { atomic_store(p, val); } static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, int cmpval, int val) { atomic_compare_exchange_strong(p, &cmpval, val); return cmpval; } (This was originally suggested by James Cowgill on the debian-mips mailing list.) There are a number of CPU architectures that are capable of atomic operations that are not supported by the existing lib/isc/*/include/isc/atomic.h implementation (e.g., arm*, ppc64el, s390x). It would be nice to support these architectures, as well as future architectures, preferably without anyone having to write any more assembly code. Bugs in atomic implementations tend to be critical, see e.g. ISC-Bugs #19227, #23469, #25181. It would be nice to avoid these kinds of bugs by relying on intrinsics provided by the compiler where possible. -- Robert Edmonds _______________________________________________ bind-workers mailing list bind-workers@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-workers ----- End forwarded message -----
Looks good. Confirmed non std atomics still builds and runs by commenting out #defines. Good to merge.
Subject: Re: [ISC-Bugs #40668] Use ISO C11's stdatomic.h instead of isc_atomic where available
From: "Mukund Sivaraman" <muks@isc.org>
Date: Tue, 19 Sep 2017 16:03:05 +0530
To: "Mark Andrews via RT" <bind9-public@isc.org>
Merged to master, v9_11, v9_10, v9_9 branches: 4728. [func] Use C11's stdatomic.h instead of isc_atomic where available. [RT #40668] Mukund