[Git][ghc/ghc][ghc-9.0] 29 commits: nonmoving: Fix regression from TSAN work

Ben Gamari gitlab at gitlab.haskell.org
Fri Dec 4 03:22:50 UTC 2020



Ben Gamari pushed to branch ghc-9.0 at Glasgow Haskell Compiler / GHC


Commits:
c2eaeda5 by GHC GitLab CI at 2020-11-29T18:48:41-05:00
nonmoving: Fix regression from TSAN work

The TSAN rework (specifically aad1f803) introduced a subtle regression
in GC.c, swapping `g0` in place of `gen`. Whoops!

Fixes #18997.

(cherry picked from commit 21c807df67afe1aee7bf4a964a00cc78ef19e00f)

- - - - -
7629341d by GHC GitLab CI at 2020-11-29T18:48:41-05:00
rts/Messages: Add missing write barrier in THROWTO message update

After a THROWTO message has been handle the message closure is
overwritten by a NULL message. We must ensure that the original
closure's pointers continue to be visible to the nonmoving GC.

(cherry picked from commit 6c2faf158fd26fc06b03c9bd11b6d2cf8e8db572)

- - - - -
8ceec852 by GHC GitLab CI at 2020-11-29T18:48:41-05:00
nonmoving: Add missing write barrier in shrinkSmallByteArray

(cherry picked from commit 35c22991ae5c22b10ca1a81f0aa888d1939f0b3f)

- - - - -
29873608 by GHC GitLab CI at 2020-11-29T18:48:41-05:00
Updates: Don't zero slop until closure has been pushed

Ensure that the the free variables have been pushed to the update
remembered set before we zero the slop.

(cherry picked from commit 134f759926bb4163d7ab97e72ce7209ed42f98b9)

- - - - -
84684501 by GHC GitLab CI at 2020-11-29T18:48:41-05:00
OSThreads: Fix error code checking

pthread_join returns its error code and apparently doesn't set errno.

(cherry picked from commit c488ac737e8ca3813fe6db069cbeb7abba00cfb9)

- - - - -
fda49d26 by GHC GitLab CI at 2020-11-29T18:48:42-05:00
nonmoving: Don't join to mark_thread on shutdown

The mark thread is not joinable as we detach from it on creation.

(cherry picked from commit ca1ef0e758a3fb787691529a0f8149e9d10b1d00)

- - - - -
6567e49a by Ben Gamari at 2020-11-29T18:48:42-05:00
nonmoving: Add reference to Ueno 2016

(cherry picked from commit a3b8375eeb2ce9d2e30f8269f5b489c5bcacc69f)

- - - - -
cb365f51 by GHC GitLab CI at 2020-11-29T18:50:27-05:00
nonmoving: Ensure that evacuated large objects are marked

See Note [Non-moving GC: Marking evacuated objects].

(cherry picked from commit b416189e4004506b89f06f147be37e76f4cd507f)

- - - - -
824332c4 by Andreas Klebinger at 2020-11-30T18:56:35-05:00
WinIO: Small changes related to atomic request swaps.

Move the atomix exchange over the Ptr type to an internal module.

Fix a bug caused by us passing ptr-to-ptr instead of ptr to
atomic exchange.

Renamed interlockedExchange to exchangePtr.

I've also added an cas primitive. It turned out we don't need it
for WinIO but I'm leaving it in as it's useful for other things.

(cherry picked from commit 401a64b80fb210fa1b403afe5b28d16f961f21bc)

- - - - -
7cb92dec by Krzysztof Gogolewski at 2020-11-30T18:56:35-05:00
Force argument in setIdMult (#18925)

(cherry picked from commit 5506f1342e51bad71a7525ddad0650d1ac63afeb)

- - - - -
77a239ec by Moritz Angermann at 2020-11-30T18:56:35-05:00
AArch64/arm64 adjustments

This addes the necessary logic to support aarch64 on elf, as well
as aarch64 on mach-o, which Apple calls arm64.

We change architecture name to AArch64, which is the official arm
naming scheme.

(cherry picked from commit 8887102fc4ed8ed1089c1aafd19bab424ad706f3)

- - - - -
7da4e588 by Krzysztof Gogolewski at 2020-11-30T18:56:35-05:00
Export indexError from GHC.Ix (#18579)

(cherry picked from commit 165352a2d163537afb01a835bccc7cd0a667410a)

- - - - -
4b83b6a8 by Ben Gamari at 2020-11-30T18:56:35-05:00
rts/linker: Align bssSize to page size when mapping symbol extras

We place symbol_extras right after bss. We also need
to ensure that symbol_extras can be mprotect'd independently from the
rest of the image. To ensure this we round up the size of bss to a page
boundary, thus ensuring that symbol_extras is also page-aligned.

(cherry picked from commit 9f40cf6ca9fb24dbc55f7eae43e2b89aa12bf251)

- - - - -
e0d7563a by Ben Gamari at 2020-11-30T18:56:35-05:00
testsuite: Add testcase for #18733

(cherry picked from commit 787e93ae141ae0f33bc36895494d48a2a5e49e08)

- - - - -
3d59089b by Ben Gamari at 2020-11-30T18:56:35-05:00
compiler: Fix recompilation checking

In ticket #18733 we noticed a rather serious deficiency in the current
fingerprinting logic for recursive groups. I have described the old
fingerprinting story and its problems in Note [Fingerprinting recursive
groups] and have reworked the story accordingly to avoid these issues.

Fixes #18733.

(cherry picked from commit 5353fd500b1e92636cd9d45274585fd88a915ff6)

- - - - -
eaa632ba by Ben Gamari at 2020-11-30T18:56:35-05:00
rts: Allocate MBlocks with MAP_TOP_DOWN on Windows

As noted in #18991, we would previously allocate heap in low memory.
Due to this the linker, which typically *needs* low memory, would end up
competing with the heap. In longer builds we end up running out of
low memory entirely, leading to linking failures.

(cherry picked from commit a1a75aa9be2c133dd1372a08eeb6a92c31688df7)

- - - - -
0bba6516 by Ben Gamari at 2020-11-30T18:56:35-05:00
gitlab-ci: Run LLVM job on appropriately-labelled MRs

Namely, those marked with the ~"LLVM backend" label

(cherry picked from commit 7c03cc5010999d0f0f9dfc549984023b3a1f2c8d)

- - - - -
be408b86 by Ben Gamari at 2020-11-30T18:56:35-05:00
rts/linker: Ensure that .rodata is aligned to 16 bytes

Pulled out of !4310.

- - - - -
3a09acdc by Ömer Sinan Ağacan at 2020-11-30T18:56:35-05:00
Fix and enable object unloading in GHCi

Fixes #16525 by tracking dependencies between object file symbols and
marking symbol liveness during garbage collection

See Note [Object unloading] in CheckUnload.c for details.

(cherry picked from commit c34a4b98b1f09ea3096d39a839a86f2d7185c796)

- - - - -
01f5126b by Ray Shih at 2020-11-30T18:56:35-05:00
Add loadNativeObj and unloadNativeObj

(This change is originally written by niteria)

This adds two functions:
* `loadNativeObj`
* `unloadNativeObj`
and implements them for Linux.

They are useful if you want to load a shared object with Haskell code
using the system linker and have GHC call dlclose() after the
code is no longer referenced from the heap.

Using the system linker allows you to load the shared object
above outside the low-mem region. It also loads the DWARF sections
in a way that `perf` understands.

`dl_iterate_phdr` is what makes this implementation Linux specific.

(cherry picked from commit 2782487f5f6ad9df4dc8725226a47f07fec77f9f)

- - - - -
a1a0ec33 by GHC GitLab CI at 2020-11-30T18:56:35-05:00
rts: Introduce highMemDynamic

(cherry picked from commit 7a65f9e140906087273ce95f062775f18f6a708d)

- - - - -
cae06fc4 by GHC GitLab CI at 2020-11-30T18:56:35-05:00
Introduce test for dynamic library unloading

This uses the highMemDynamic flag introduced earlier to verify that
dynamic objects are properly unloaded.

(cherry picked from commit e9e1b2e75de17be47ab887a26943f5517a8463ac)

- - - - -
f72f27a3 by GHC GitLab CI at 2020-11-30T19:21:56-05:00
ThreadPaused: Don't zero slop until free vars are pushed

When threadPaused blackholes a thunk it calls `OVERWRITING_CLOSURE` to
zero the slop for the benefit of the sanity checker. Previously this was
done *before* pushing the thunk's free variables to the update
remembered set. Consequently we would pull zero'd pointers to the update
remembered set.

(cherry picked from commit 3e75b0dbaca5fbd8abc529d70c1df159f5bfbaa4)

- - - - -
43ff60b5 by Ben Gamari at 2020-12-01T00:55:55-05:00
rts: Refactor foreign export tracking

This avoids calling `libc` in the initializers which are responsible for
registering foreign exports. We believe this should avoid the corruption
observed in #18548.

See Note [Tracking foreign exports] in rts/ForeignExports.c for an
overview of the new scheme.

(cherry picked from commit c492134912e5270180881b7345ee86dc32756bdd)

- - - - -
85822a88 by Ben Gamari at 2020-12-01T00:57:01-05:00
rts: Refactor unloading of foreign export StablePtrs

Previously we would allocate a linked list cell for each foreign export.
Now we can avoid this by taking advantage of the fact that they are
already broken into groups.

(cherry picked from commit 40dc91069d15bfc1d81f1722b39e06cac8fdddd1)

- - - - -
2a622d0f by Ben Gamari at 2020-12-01T21:39:09+00:00
hadrian: Pass input file to makeindex

Strangely I find that on Alpine (and apparently only on Alpine) the
latex makeindex command expects to be given a filename, lest it reads
from stdin.

(cherry picked from commit 389a668343c0d4f5fa095112ff98d0da6998e99d)

- - - - -
553ec815 by GHC GitLab CI at 2020-12-01T22:19:04+00:00
Fix various documentation issues

- - - - -
007055cc by GHC GitLab CI at 2020-12-01T22:19:12+00:00
Fix cas_int

- - - - -
794616b6 by Ben Gamari at 2020-12-03T22:16:06-05:00
testsuite: Add missing #include on <stdlib.h>

This otherwise fails on newer Clangs, which warn
more aggressively on undeclared symbols.

(cherry picked from commit 3d7db1488c4bd7764e8b1fe3cfde4c5a548cde16)

- - - - -


30 changed files:

- .gitlab-ci.yml
- aclocal.m4
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Platform/ARM64.hs → compiler/GHC/Platform/AArch64.hs
- compiler/GHC/Platform/Regs.hs
- compiler/GHC/Runtime/Linker.hs
- compiler/GHC/Types/Var.hs
- compiler/ghc.cabal.in
- config.sub
- docs/users_guide/9.0.1-notes.rst
- docs/users_guide/ghci.rst
- docs/users_guide/runtime_control.rst
- hadrian/src/Builder.hs
- includes/CodeGen.Platform.hs
- includes/Rts.h
- includes/rts/Flags.h
- + includes/rts/ForeignExports.h
- includes/rts/Linker.h
- includes/rts/storage/ClosureMacros.h
- includes/rts/storage/GC.h


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b944fd08884527c4fee7286ac60e0a9bd6ebf424...794616b6c4ab6537304777cfb5616cd5fc031a2f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b944fd08884527c4fee7286ac60e0a9bd6ebf424...794616b6c4ab6537304777cfb5616cd5fc031a2f
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/20201203/a0ac7806/attachment-0001.html>


More information about the ghc-commits mailing list