[Git][ghc/ghc][wip/tsan/fixes] 37 commits: Extend documentation for Data.IORef

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Tue Nov 22 03:22:56 UTC 2022



Ben Gamari pushed to branch wip/tsan/fixes at Glasgow Haskell Compiler / GHC


Commits:
f2f9ef07 by Bodigrim at 2022-11-20T18:39:30-05:00
Extend documentation for Data.IORef

- - - - -
ef511b23 by Simon Peyton Jones at 2022-11-20T18:40:05-05:00
Buglet in GHC.Tc.Module.checkBootTyCon

This lurking bug used the wrong function to compare two
types in GHC.Tc.Module.checkBootTyCon

It's hard to trigger the bug, which only came up during
!9343, so there's no regression test in this MR.

- - - - -
451aeac3 by Bodigrim at 2022-11-20T18:40:44-05:00
Add since pragmas for c_interruptible_open and hostIsThreaded

- - - - -
e38d6d99 by Ben Gamari at 2022-11-21T13:30:23-05:00
hadrian: Don't enable TSAN in stage0 build

- - - - -
32a5ab8d by Ben Gamari at 2022-11-21T13:30:23-05:00
cmm: Introduce blockConcat

- - - - -
32a88875 by Ben Gamari at 2022-11-21T13:30:23-05:00
cmm: Introduce MemoryOrderings

- - - - -
6ed62022 by Ben Gamari at 2022-11-21T13:30:23-05:00
llvm: Respect memory specified orderings

- - - - -
64dd0684 by Ben Gamari at 2022-11-21T13:30:23-05:00
Codegen/x86: Eliminate barrier for relaxed accesses

- - - - -
ae9e0ba7 by Ben Gamari at 2022-11-21T13:30:23-05:00
cmm/Parser: Reduce some repetition

- - - - -
d1a0cfff by Ben Gamari at 2022-11-21T13:30:23-05:00
cmm/Parser: Add syntax for ordered loads and stores

- - - - -
1672d2ff by Ben Gamari at 2022-11-21T13:30:23-05:00
cmm/Parser: Atomic load syntax

Originally I had thought I would just use the `prim` call syntax instead
of introducing new syntax for atomic loads. However, it turns out that
`prim` call syntax tends to make things quite unreadable. This new
syntax seems quite natural.

- - - - -
9f545dc8 by Ben Gamari at 2022-11-21T13:53:15-05:00
codeGen: Introduce ThreadSanitizer instrumentation

This introduces a new Cmm pass which instruments the program with
ThreadSanitizer annotations, allowing full tracking of mutator memory
accesses via TSAN.

- - - - -
dbbc382f by Ben Gamari at 2022-11-21T15:51:48-05:00
Hadrian: Drop TSAN_ENABLED define from flavour

This is redundant since the TSANUtils.h already defines it.

- - - - -
45ee055e by Ben Gamari at 2022-11-21T15:55:50-05:00
gitlab-ci: Don't

- - - - -
d0110b08 by Ben Gamari at 2022-11-21T16:14:33-05:00
hadrian: Enable Cmm instrumentation in TSAN flavour

- - - - -
d1562caa by Ben Gamari at 2022-11-21T16:14:55-05:00
rts/Messages: Refactor

This doesn't change behavior but makes the code a bit easier to follow.

- - - - -
f95eb02e by Ben Gamari at 2022-11-21T16:14:55-05:00
rts/ThreadPaused: Ordering fixes

- - - - -
1ee4b50c by Ben Gamari at 2022-11-21T16:14:55-05:00
eventlog: Silence spurious data race

- - - - -
ac31d987 by Ben Gamari at 2022-11-21T16:14:55-05:00
Introduce SET_INFO_RELEASE for Cmm

- - - - -
a5c50d25 by Ben Gamari at 2022-11-21T16:14:55-05:00
rts: Use fences instead of explicit barriers

- - - - -
9546714c by Ben Gamari at 2022-11-21T16:14:55-05:00
rts/stm: Fix memory ordering in readTVarIO#

See #22421.

- - - - -
86ac2577 by Ben Gamari at 2022-11-21T16:14:55-05:00
Improve heap memory barrier Note

Also introduce MUT_FIELD marker in Closures.h to document mutable
fields.

- - - - -
d33e218a by Ben Gamari at 2022-11-21T22:22:51-05:00
rts: Introduce getNumCapabilities

And ensure accesses to n_capabilities are atomic (although with relaxed
ordering). This is necessary as RTS API callers may concurrently call
into the RTS without holding a capability.

- - - - -
c6da2d6a by Ben Gamari at 2022-11-21T22:22:51-05:00
ghc: Fix data race in dump file handling

Previously the dump filename cache would use a non-atomic update which
could potentially result in lost dump contents. Note that this is still
a bit racy since the first writer may lag behind a later appending
writer.

- - - - -
7c677ed9 by Ben Gamari at 2022-11-21T22:22:51-05:00
rts: Always use atomics for context_switch and interrupt

Since these are modified by the timer handler.

- - - - -
9c79928e by Ben Gamari at 2022-11-21T22:22:51-05:00
rts/Timer: Always use atomic operations

As noted in #22447, the existence of the pthread-based ITimer
implementation means that we cannot assume that the program is
single-threaded.

- - - - -
dc1d92a1 by Ben Gamari at 2022-11-21T22:22:51-05:00
rts: Encapsulate recent_activity access

This makes it easier to ensure that it is accessed using the necessary
atomic operations.

- - - - -
018b4138 by Ben Gamari at 2022-11-21T22:22:51-05:00
rts: Encapsulate access to capabilities array

- - - - -
5ad05189 by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Encapsulate sched_state

- - - - -
87cfe838 by Ben Gamari at 2022-11-21T22:22:52-05:00
PrimOps: Fix benign MutVar race

Relaxed ordering is fine here since the later CAS implies a release.

- - - - -
41b6b56e by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Style fix

- - - - -
5118ea62 by Ben Gamari at 2022-11-21T22:22:52-05:00
compiler: Use release store in eager blackholing

- - - - -
e719dd28 by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Fix ordering of makeStableName

- - - - -
4803b9c3 by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Use ordered accesses instead of explicit barriers

- - - - -
176cdf8f by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Statically allocate capabilities

This is a rather simplistic way of solving #17289.

- - - - -
9a1a3f8a by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Ensure that all accesses to pending_sync are atomic

- - - - -
d4f3ea04 by Ben Gamari at 2022-11-21T22:22:52-05:00
rts: Note race with wakeBlockingQueue

- - - - -


30 changed files:

- .gitlab/gen_ci.hs
- compiler/GHC/Cmm/Config.hs
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow/Block.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Pipeline.hs
- + compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Driver/Config/Cmm.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/ExtCode.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Utils/Logger.hs
- compiler/ghc.cabal.in
- docs/users_guide/debugging.rst
- hadrian/src/Flavour.hs
- libraries/base/Data/IORef.hs
- libraries/base/GHC/IORef.hs
- libraries/base/System/Posix/Internals.hs
- rts/Apply.cmm


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/06c8fefbd9f9b18fc3586b4c63f1629d9c41b57e...d4f3ea04bca4978203b2b366298d0a8edbe6975f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/06c8fefbd9f9b18fc3586b4c63f1629d9c41b57e...d4f3ea04bca4978203b2b366298d0a8edbe6975f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221121/0b33952d/attachment-0001.html>


More information about the ghc-commits mailing list