<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<h3>
Ben Gamari pushed to branch wip/tsan-ghc-8.10
at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/70ac4ed84f4e95f3b3772242368582cf911e50c4">70ac4ed8</a></strong>
<div>
<span>by Moritz Angermann</span>
<i>at 2020-11-25T10:41:34+08:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">CmmToLlvm: Declare signature for memcmp

Otherwise `opt` fails with:

    error: use of undefined value '@memcmp$def'
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7b8856f6bc2764d7ab42dc49fc9422747d88a817">7b8856f6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">SMP.h: Add C11-style atomic operations
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/15116c245b936d9c8c48af6b710de2ce00aa724e">15116c24</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Infrastructure for testing with ThreadSanitizer
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/6f51dabf5ec53a5a9c6f99806d5b3bfbc7466f64">6f51dabf</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/CNF: Initialize all bdescrs in group

It seems wise and cheap to ensure that the whole bdescr of all blocks of
a compact group is valid, even if most cases only look at the flags
field.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/d1b8cb4fcf56de411148010bcdf067d6ddb72a6d">d1b8cb4f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Capability: Intialize interrupt field

Previously this was left uninitialized.

Also clarify some comments.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/88eb3e6790ad8dc831619b9a331d6a5c7a8bfbb2">88eb3e67</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Task: Make comments proper Notes
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a4e20e6dac2c9da0a328113c59fce5511d1bd695">a4e20e6d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/SpinLock: Move to proper atomics

This is fairly straightforward; we just needed to use relaxed operations
for the PROF_SPIN counters and a release store instead of a write
barrier.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3e979160582ca9a37e09962d78848f28976d86eb">3e979160</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/OSThreads: Fix data race

Previously we would race on the cached processor count. Avoiding this is
straightforward; just use relaxed operations.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/70d00e090697dd5693014ef681250e5c292f890f">70d00e09</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/ClosureMaros: Use relaxed atomics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f065898aa70e3069299ae6832694d745921af0c0">f065898a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Fix thread leak in hs_try_putmvar00[13]
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/51f48fd241de420dfa2b32d73ad2f4f5e8c0bcec">51f48fd2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Introduce SET_HDR_RELEASE

Also ensure that we also store the info table pointer last to ensure
that the synchronization covers all stores.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9316c4a4566ed739c301da87df7bcc6f000c9fcd">9316c4a4</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Factor out logic to identify a good capability for running a task

Not only does this make the control flow a bit clearer but it also
allows us to add a TSAN suppression on this logic, which requires
(harmless) data races.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/53f24b8ad59dca67307f82965ace91343899ada9">53f24b8a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Annotate benign race in waitForCapability
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/4a3597b4363a302cb45c8815b8e4f48929919d02">4a3597b4</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Clarify locking behavior of releaseCapability_
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/1de8c69102f7ae55614824f5e09bc2d6f3e168d3">1de8c691</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Add assertions for task ownership of capabilities
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/b7d9eb41ca7025215c9e83a4d5aa1d8add7692a8">b7d9eb41</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:35-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed atomics on n_returning_tasks

This mitigates the warning of a benign race on n_returning_tasks in
shouldYieldCapability.

See #17261.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/47423a5dec6878371ce930061dfba080f72a9f3c">47423a5d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Mitigate races in capability interruption logic
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c858edad9792b5e7793e893e2d414d5e823b56ba">c858edad</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Capability: Use relaxed operations for last_free_capability
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c2a64f7743d6a42fe78dd37de8953f21253f503d">c2a64f77</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed operations for cap->running_task (TODO)

This shouldn't be necessary since only the owning thread of the capability
should be touching this.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/86598ea5ca4faf343e637aa142c01fa8c5ce1963">86598ea5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Schedule: Use relaxed operations for sched_state
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7111ed98918dcb93f3deab4fa8164ea901ffaae6">7111ed98</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Accept data race in work-stealing implementation

This race is okay since the task is owned by the capability pushing it.
By Note [Ownership of Task] this means that the capability is free to
write to `task->cap` without taking `task->lock`.

Fixes #17276.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/d1667414449eb899ab7f03d8647ccc6bc75e6042">d1667414</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Eliminate data races on pending_sync
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c7085820307afd3e71c9cc9e76efb2911f6acba9">c7085820</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Schedule: Eliminate data races on recent_activity

We cannot safely use relaxed atomics here.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7b479a3626b1204bdfc4b1f1f3c8dfa88cbbf88c">7b479a36</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Avoid data races in message handling
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/367df8523b1732b96c55ac62ea9a385b8ac8ed1d">367df852</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Messages: Drop incredibly fishy write barrier

executeMessage previously had a write barrier at the beginning of its
loop apparently in an attempt to synchronize with another thread's
writes to the Message. I would guess that the author had intended to use
a load barrier here given that there are no globally-visible writes done
in executeMessage.

I've removed the redundant barrier since the necessary load barrier is
now provided by the ACQUIRE_LOAD.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2e3c82f390ea6cd391f094657d8dc1b36533aea0">2e3c82f3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/ThreadPaused: Avoid data races
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/fae4a32deb0ac5e32f750ff3a6cbc8a654742a9f">fae4a32d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Schedule: Eliminate data races in run queue management
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/4f3ad1880e970ef3fdac7db5e91816babd67cbe8">4f3ad188</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Eliminate shutdown data race on task counters
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3e595d5a28c95fb935714743e7de3fc44b2545ee">3e595d5a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Threads: Avoid data races (TODO)

Replace barriers with appropriate ordering. Drop redundant barrier in
tryWakeupThread (the RELEASE barrier will be provided by sendMessage's
mutex release).

We use relaxed operations on why_blocked and the stack although it's not
clear to me why this is necessary.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/5099274d685ee834fa55e62efb9065101ae1bef0">5099274d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Messages: Annotate benign race
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/1236fbe0101d81c0e41b1c5425ec81be3f3e0343">1236fbe0</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/RaiseAsync: Synchronize what_next read
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/476c4a8ac5db8ed62745c975f84128c2f6a18288">476c4a8a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Task: Move debugTrace to avoid data race

Specifically, we need to hold all_tasks_mutex to read taskCount.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8e8c7adf349c6446a3fbec646bb91178295fd6d1">8e8c7adf</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Disable flawed assertion
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3eebe524d97dc7e10b6d9c0aec73b0f6653d873a">3eebe524</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Document schedulePushWork race
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/cb1eb0e894ebb4e1f3a6f90141575a6bd94ea740">cb1eb0e8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Capabiliity: Properly fix data race on n_returning_tasks

There is a real data race but can be made safe by using proper atomic
(but relaxed) accesses.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9863350a2be6c6f7ce41b5de1c65e97798d71d57">9863350a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Make write of to_cap->inbox atomic

This is necessary since emptyInbox may read from to_cap->inbox without
taking cap->lock.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f81c1b02cb780069cf33d8f2d1f3799b22482b2a">f81c1b02</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">gitlab-ci: Add nightly-x86_64-linux-deb9-tsan job
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/b5855f96e64c3f90e06fcf643f858edc17a06ec6">b5855f96</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark setnumcapabilities001 as broken with TSAN

Due to #18808.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/211305202c24c4aef560f2b64f9ecf80a5b26b99">21130520</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Skip divbyzero and derefnull under TSAN

ThreadSanitizer changes the output of these tests.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/227dc381e5dcc2fa4e75b527460f68342fe13ed6">227dc381</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Skip high memory usage tests with TSAN

ThreadSanitizer significantly increases the memory footprint of tests,
so much so that it can send machines into OOM.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3930c9fe3f75f7fc46483fbf61facb351df2438a">3930c9fe</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark hie002 as high_memory_usage

This test has a peak residency of 1GByte; this is large enough to
classify as "high" in my book.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c7424362416c5a529f5b610e8310d4afb10dae66">c7424362</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark T9872[abc] as high_memory_usage

These all have a maximum residency of over 2 GB.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8b418d394fc025ec55f355574abd4806f995d9fb">8b418d39</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">gitlab-ci: Disable documentation in TSAN build

Haddock chews through enough memory to cause the CI builders to OOM and
there's frankly no reason to build documentation in this job anyways.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/cd0e033ba2a7871128f694e27c95fd6bb12960ee">cd0e033b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">TSANUtils: Ensure that C11 atomics are supported
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/12bf63a7b5b2ba7790480e6975d1a11c97b406ae">12bf63a7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:21:36-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark T3807 as broken with TSAN

Due to #18883.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f70cab90aecd70462dfa45a105026c7f41892015">f70cab90</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark T13702 as broken with TSAN due to #18884
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/398f1ea9697b8820bb3f069367a3b47853e8539b">398f1ea9</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/BlockAlloc: Use relaxed operations
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a3d1f39b3e65097d17e0d42f6c3dfcce7d379c7d">a3d1f39b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Rework handling of mutlist scavenging statistics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e352656575090a77b677b479d5bcaf6022377b69">e3526565</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Avoid data races in StablePtr implementation

This fixes two potentially problematic data races in the StablePtr
implementation:

 * We would fail to RELEASE the stable pointer table when enlarging it,
   causing other cores to potentially see uninitialized memory.

 * We would fail to ACQUIRE when dereferencing a stable pointer.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e1c1552f5735b7aada174f935f48fa36ed6b5da0">e1c1552f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Storage: Use atomics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/5182aac54ab1970aa32bdbc285c5ab95b755fcda">5182aac5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Updates: Use proper atomic operations
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/72481992afbf0ed00d69dd134d085d9c35b28c51">72481992</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:05-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Weak: Eliminate data races

By taking all_tasks_mutex in stat_exit. Also better-document the fact
that the task statistics are protected by all_tasks_mutex.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/199419f6419db53162510e52f93dbb48b6d42fc0">199419f6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/GC: Use atomics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/d7cd64b95ca372709a787ec982f11d96de722615">d7cd64b9</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use RELEASE ordering in unlockClosure
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/26638062e7d78b5ec1824c6c40e8f557470a1895">26638062</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Storage: Accept races on heap size counters
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/5d82ecd1b907b2d1fa0a5f9b1ecc4e4952a6ce27">5d82ecd1</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Join to concurrent mark thread during shutdown

Previously we would take all capabilities but fail to join on the thread
itself, potentially resulting in a leaked thread.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3f519f3feea4de568849acbd276b80d6ee5bdeee">3f519f3f</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Fix race in GC CPU time accounting

Ensure that the GC leader synchronizes with workers before calling
stat_endGC.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a69387321493325a6da445f6aafefa2450aa7f88">a6938732</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/SpinLock: Separate out slow path

Not only is this in general a good idea, but it turns out that GCC
unrolls the retry loop, resulting is massive code bloat in critical
parts of the RTS (e.g. `evacuate`).
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/120a1fbaee0ea2de3ecf4227fb6428dc2a0032dd">120a1fba</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed ordering on spinlock counters
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/dcc0916a4509acdd6d515a0dd576b7142ba7c46d">dcc0916a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Annotate hopefully "benign" races in freeGroup
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2131a9616a9e2191c2552434f9f23d9639197a49">2131a961</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Strengthen ordering in releaseGCThreads
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e90d9cfa000668146a9a51c14087a4fe0c1ce0bd">e90d9cfa</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/WSDeque: Rewrite with proper atomics

After a few attempts at shoring up the previous implementation, I ended
up turning to the literature and now use the proven implementation,

> N.M. Lê, A. Pop, A.Cohen, and F.Z. Nardelli. "Correct and Efficient
> Work-Stealing for Weak Memory Models". PPoPP'13, February 2013,
> ACM 978-1-4503-1922/13/02.

Note only is this approach formally proven correct under C11 semantics
but it is also proved to be a bit faster in practice.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e52ab4faa4ac3892b352bb5f677416a88f7f66a2">e52ab4fa</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed atomics for whitehole spin stats
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e8705f29399cd942b5d580034c6f540194ee6735">e8705f29</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Avoid lock order inversion during fork

Fixes #17275.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2af2f0be60e8a227aae38b1b86bc8aac3af4bcb3">2af2f0be</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use proper relaxe operations in getCurrentThreadCPUTime

Here we are doing lazy initialization; it's okay if we do the check more
than once, hence relaxed operation is fine.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/469872ecd0e1da6f788fe720aa6d10f2a2cf6bb7">469872ec</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/STM: Use atomics

This fixes a potentially harmful race where we failed to synchronize
before looking at a TVar's current_value.

Also did a bit of refactoring to avoid abstract over management of
max_commits.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/5948bc76580cc3b2a2338ebd43f190cb2a83a777">5948bc76</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/stm: Strengthen orderings to SEQ_CST instead of volatile

Previously the `current_value`, `first_watch_queue_entry`, and
`num_updates` fields of `StgTVar` were marked as `volatile` in an
attempt to provide strong ordering. Of course, this isn't sufficient.

We now use proper atomic operations. In most of these cases I strengthen
the ordering all the way to SEQ_CST although it's possible that some
could be weakened with some thought.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/311b0184ca7920e5daf74f4b45336f54b4bc8ded">311b0184</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Mitigate data races in event manager startup/shutdown
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/513e9fe6cff6cf48179e3fc700de692a8ae47777">513e9fe6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Suppress data race due to close

This suppresses the other side of a race during shutdown.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/899c985c82e7c235c53cf08f1c8722f2e8ad6402">899c985c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Accept benign races in Proftimer
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/270ad47f075c2851690bad106375be62341d846b">270ad47f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Pause timer while changing capability count

This avoids #17289.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/37601b97d55d02ca30049ed95dfd36410381ffef">37601b97</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fix #17289
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/4718c285f541d3b72f3435eeaabc4abe5b10b188">4718c285</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">suppress #17289 (ticker) race
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/982993ad879cdd0bf60e82e6e95d8030c1952a87">982993ad</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Fix timer initialization

Previously `initScheduler` would attempt to pause the ticker and in so
doing acquire the ticker mutex. However, initTicker, which is
responsible for initializing said mutex, hadn't been called
yet.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/95a8bd7691eba43b77d1d94acec915ac3c067369">95a8bd76</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Fix races in Pthread timer backend shudown

We can generally be pretty relaxed in the barriers here since the timer
thread is a loop.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/4b5f37645c7370797184e4da6eaf52b469c21d8a">4b5f3764</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Stats: Hide a few unused unnecessarily global functions
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e7b0b74f8ec8025466b188da035d50536c2384de">e7b0b74f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Stats: Protect with mutex

While on face value this seems a bit heavy, I think it's far better than
enforcing ordering on every access.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/1fed9ab532b8257e9b1de3cf2a083c2d96b025d1">1fed9ab5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Tear down stats_mutex after exitHeapProfiling

Since the latter wants to call getRTSStats.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f6f0343bd8dc1ea5d8085ed551bcb3400b72b694">f6f0343b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-30T12:27:06-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Stats: Reintroduce mut_user_time

Fix the previous backport; this function was dead code in master but is
still needed due to ProfHeap.c in ghc-8.10.
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#587d266bb27a4dc3022bbed44dfa19849df3044c">
.gitlab-ci.yml
</a>
</li>
<li class="file-stats">
<a href="#cacd8cbc59c36ab8a39258a3a1dd6c44ad547d49">
compiler/llvmGen/LlvmCodeGen/Base.hs
</a>
</li>
<li class="file-stats">
<a href="#2eeb40f0acd6cb433ebe65e34262040b618908a7">
hadrian/hadrian.cabal
</a>
</li>
<li class="file-stats">
<a href="#1655041cfd1add79e4c335c656405ee3eb3bd0dd">
hadrian/src/Flavour.hs
</a>
</li>
<li class="file-stats">
<a href="#704958036ebddd9058fb1367e440b2ea1abb53e9">
hadrian/src/Settings.hs
</a>
</li>
<li class="file-stats">
<a href="#fbf853844dc48d850085cbef14c0af1e474cb087">
<span class="new-file">
+
hadrian/src/Settings/Flavours/ThreadSanitizer.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#40f83a2cddcbc1f8190b0551eb572ccf4ea88cc9">
includes/Rts.h
</a>
</li>
<li class="file-stats">
<a href="#452d5ee18aa2b91b6486a157ecf550dc84081872">
includes/rts/OSThreads.h
</a>
</li>
<li class="file-stats">
<a href="#397950c6118f4b5a74a10249b6bcc322ab8e2e25">
includes/rts/SpinLock.h
</a>
</li>
<li class="file-stats">
<a href="#0e9120c800f0c7864f3631f8fb8d7035a4778f97">
includes/rts/StablePtr.h
</a>
</li>
<li class="file-stats">
<a href="#32b24c17e385bd15c4751ab0da5f55876fd57f51">
<span class="new-file">
+
includes/rts/TSANUtils.h
</span>
</a>
</li>
<li class="file-stats">
<a href="#aa19e824b3a8c24a7bf37f8352997022b14a5a0c">
includes/rts/storage/ClosureMacros.h
</a>
</li>
<li class="file-stats">
<a href="#0ea78c0eb38d298692960f63f47248f6464a0479">
includes/rts/storage/Closures.h
</a>
</li>
<li class="file-stats">
<a href="#94ca41c5afbb3d932bd6f37ee16458322988fb69">
includes/rts/storage/GC.h
</a>
</li>
<li class="file-stats">
<a href="#fbe566a2918ba0562be9aceeb5d07448bf2f9ed0">
includes/stg/SMP.h
</a>
</li>
<li class="file-stats">
<a href="#e5d5c3eb2ba69f9a4ab3f56a8e9dab426c012963">
libraries/base/GHC/Event/Control.hs
</a>
</li>
<li class="file-stats">
<a href="#46661d25ba83700d4344aaa428308c552e201be8">
<span class="new-file">
+
rts/.tsan-suppressions
</span>
</a>
</li>
<li class="file-stats">
<a href="#33249795fee267712d5c3a7ecfa9f2edea260401">
rts/Capability.c
</a>
</li>
<li class="file-stats">
<a href="#62ec5569a8af1e443ae952b393d15b9dd1cea199">
rts/Capability.h
</a>
</li>
<li class="file-stats">
<a href="#63bb2dcb45bf7982130b0b95ecf366bf1a617e82">
rts/Messages.c
</a>
</li>
<li class="file-stats">
<a href="#a3b0919403d8f328f07cda7c4a7f9817c369357c">
rts/Proftimer.c
</a>
</li>
<li class="file-stats">
<a href="#515f190a948b1d6c490c96f75a3f909580e927b0">
rts/RaiseAsync.c
</a>
</li>
<li class="file-stats">
<a href="#9ed11d0519762dae04656481b089dbb5b05acf98">
rts/RtsStartup.c
</a>
</li>
<li class="file-stats">
<a href="#632a1fac336e62e26d0af2de3f023c11a62c927a">
rts/SMPClosureOps.h
</a>
</li>
<li class="file-stats">
<a href="#e137645f8a9be9fa32cc764e19cea2b492e33d9c">
rts/STM.c
</a>
</li>
<li class="file-stats">
<a href="#7d6961cb073b9fe3df3a81f0ad5cf36eed293c42">
rts/Schedule.c
</a>
</li>
<li class="file-stats">
<a href="#52526efc348b52718c69d51f8df6e5425ff68d48">
rts/Schedule.h
</a>
</li>
<li class="file-stats">
<a href="#b1247567bf64d38ef0ee9a14575ac22983232204">
rts/Sparks.c
</a>
</li>
<li class="file-stats">
<a href="#6b4f3c89a36017ba0c8ca6c6bd086631c47406df">
<span class="new-file">
+
rts/SpinLock.c
</span>
</a>
</li>
<li class="file-stats">
<a href="#264b041893a19041ac2281341c74847243da87e3">
rts/StablePtr.c
</a>
</li>
</ul>
<h5>The diff was not included because it is too large.</h5>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/a3152aa057644dac7b8df4c30c3034d3ab180748...f6f0343bd8dc1ea5d8085ed551bcb3400b72b694">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.haskell.org.
If you'd like to receive fewer emails, you can
adjust your notification settings.



</p>
</div>
</body>
</html>