[Git][ghc/ghc][ghc-9.6] 33 commits: Don't consider large byte arrays/compact regions pinned.

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Fri Jan 6 19:32:58 UTC 2023



Matthew Pickering pushed to branch ghc-9.6 at Glasgow Haskell Compiler / GHC


Commits:
611e686b by Andreas Klebinger at 2023-01-06T15:12:40+00:00
Don't consider large byte arrays/compact regions pinned.

Workaround for #22255 which showed how treating large/compact regions
as pinned could cause segfaults.

(cherry picked from commit 914f7fe3756734714a6795fc4bbca96442b01f92)

- - - - -
d98db93c by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Fix race in marking of blackholes

We must use an acquire-fence when marking to ensure that the indirectee
is visible.

(cherry picked from commit 18d2acd2791a751c0b1894fd72dd0317583619cd)

- - - - -
a169f7a8 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Fix segment list races

(cherry picked from commit 11241efa3422fae97aed0abb1857baab2f9018fb)

- - - - -
d276bb54 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Use atomic when looking at bd->gen

Since it may have been mutated by a moving GC.

(cherry picked from commit 602455c9ae6e5a2746f43b1811bb3c54efb0a6f5)

- - - - -
63525f89 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Eliminate race in bump_static_flag

To ensure that we don't race with a mutator entering a new CAF we take
the SM mutex before touching static_flag. The other option here would be
to instead modify newCAF to use a CAS but the present approach is a bit
safer.

(cherry picked from commit 9d63b160287eb8edfe7ab0b1715f21c1b831bfa5)

- - - - -
e91352e2 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Ensure that mutable fields have acquire barrier

(cherry picked from commit 26837523f5a9cdb33a206f8b22eea88ef75c874b)

- - - - -
84bb3747 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Fix races in collector status tracking

Mark a number of accesses to do with tracking of the status of the
concurrent collection thread as atomic. No interesting races here,
merely necessary to satisfy TSAN.

(cherry picked from commit 8093264a448940133fc2f1899bab8757eabe4b85)

- - - - -
5922a583 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Make segment state updates atomic

(cherry picked from commit 387d4fcc29441098d41340c12e56d9693b5e4c94)

- - - - -
d6eb8ba1 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Refactor update remembered set initialization

This avoids a lock inversion between the storage manager mutex and
the stable pointer table mutex by not dropping the SM_MUTEX in
nonmovingCollect. This requires quite a bit of rejiggering but it
does seem like a better strategy.

(cherry picked from commit 543cae0084a72ca767a443d857f9e65a5a79f71d)

- - - - -
40317135 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Ensure that we aren't holding locks when closing them

TSAN complains about this sort of thing.

(cherry picked from commit c99367180e49d903f8be649bfdc11e95649c7d1a)

- - - - -
d86a40bc by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Make bitmap accesses atomic

This is a benign race on any sensible hard since these are byte
accesses. Nevertheless, atomic accesses are necessary to satisfy
TSAN.

(cherry picked from commit 0cd31f7d2c8baea0489770c765a7b8dd5c79679f)

- - - - -
ce02950d by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Fix benign race in update remembered set check

Relaxed load is fine here since we will take the lock before looking at
the list.

(cherry picked from commit d3fe110aaf7c40c5a4b2ff460abe33ee7fac6d93)

- - - - -
98ec2167 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Fix race in shortcutting

We must use an acquire load to read the info table pointer since if we
find an indirection we must be certain that we see the indirectee.

(cherry picked from commit ab6cf893037f073fd3daf619579c84e58362b499)

- - - - -
61f96bb4 by Ben Gamari at 2023-01-06T15:21:48+00:00
nonmoving: Make free list counter accesses atomic

Since these may race with the allocator(s).

(cherry picked from commit 36c9f23c9dc52928b5d2971f38f6e0b15e38528e)

- - - - -
4af109cf by Ben Gamari at 2023-01-06T15:25:59+00:00
compiler: Ensure that GHC toolchain is first in search path

As noted in #22561, it is important that GHC's toolchain look
first for its own headers and libraries to ensure that the
system's are not found instead. If this happens things can
break in surprising ways (e.g. see #22561).

- - - - -
a5118fc5 by Ben Gamari at 2023-01-06T15:28:08+00:00
Bump libffi-tarballs submodule

We will now use libffi-3.4.4.

(cherry picked from commit b2c7523d8987bedf13a7dd682d836ffb76cbe09d)

- - - - -
42ea9cea by Sylvain Henry at 2023-01-06T15:28:38+00:00
JS: fix support for -outputdir (#22641)

The `-outputdir` option wasn't correctly handled with the JS backend
because the same code path was used to handle both objects produced by
the JS backend and foreign .js files. Now we clearly distinguish the
two in the pipeline, fixing the bug.

(cherry picked from commit 99757ce8e32d9809c71b09583aa881943a450086)

- - - - -
b11a4111 by Matthew Pickering at 2023-01-06T15:29:29+00:00
Revert "configure: Drop uses of AC_PROG_CC_C99"

This reverts commit 7c6de18dd3151ead954c210336728e8686c91de6.

Centos7 using a very old version of the toolchain (autotools-2.69) where
the behaviour of these macros has not yet changed. I am reverting this
without haste as it is blocking the 9.6 branch.

Fixes #22704

(cherry picked from commit b2a2db04b24a4654261db8e0db6ad7bac1b3d7cf)

- - - - -
246176a0 by Ben Gamari at 2023-01-06T15:32:27+00:00
hadrian: Ensure that linker scripts are used when merging objects

In #22527 @rui314 inadvertantly pointed out a glaring bug in Hadrian's
implementation of the object merging rules: unlike the old `make` build
system we utterly failed to pass the needed linker scripts. Fix this.

(cherry picked from commit 6d7d4393e15a6d0a2b42ec986ec6bd3df27baaa7)

- - - - -
15014bce by Matthew Pickering at 2023-01-06T15:32:32+00:00
compiler: Add -f[no-]split-sections flags

Here we add a `-fsplit-sections` flag which may some day replace
`-split-sections`. This has the advantage of automatically providing a
`-fno-split-sections` flag, which is useful for our packaging because we
enable `-split-sections` by default but want to disable it in certain
configurations.

(cherry picked from commit 32255d055b768d51deb9d1f49681164cf7492011)

- - - - -
0561d8f2 by Matthew Pickering at 2023-01-06T15:32:32+00:00
hadrian: Fix computation of tables_next_to_code for outOfTreeCompiler

This copy-pasto was introduced in de5fb3489f2a9bd6dc75d0cb8925a27fe9b9084b

(cherry picked from commit e640940c55a88d10537682baf530f3772e55459a)

- - - - -
c45ce0f1 by Matthew Pickering at 2023-01-06T15:32:32+00:00
hadrian: Add test:all_deps to build just testsuite dependencies

Fixes #22534

(cherry picked from commit 15bee1239877a4629a245fe457f06e5f96668423)

- - - - -
123adfba by Matthew Pickering at 2023-01-06T15:32:32+00:00
hadrian: Add no_split_sections tranformer

This transformer reverts the effect of `split_sections`, which we intend
to use for platforms which don't support split sections.

In order to achieve this we have to modify the implemntation of the
split_sections transformer to store whether we are enabling
split_sections directly in the `Flavour` definition. This is because
otherwise there's no convenient way to turn off split_sections due to
having to pass additional linker scripts when merging objects.

(cherry picked from commit fec6638e2468c78f136f2363d8b3239a9bfd4f91)

- - - - -
6fad57b3 by Matthew Pickering at 2023-01-06T15:32:32+00:00
check-exact: Fix build with -Werror

(cherry picked from commit 3dc05726dca7e38ca8de8e1175c8f1489b96653e)

- - - - -
2bfb6270 by Matthew Pickering at 2023-01-06T15:32:32+00:00
ci: Build all test dependencies with in-tree compiler

This means that these executables will honour flavour transformers such
as "werror".

Fixes #22555

(cherry picked from commit 53a6ae7a8f819d1105aa190dc9cce215cdbcc6dc)

- - - - -
a9bcd226 by Matthew Pickering at 2023-01-06T15:32:32+00:00
hadrian: Document using GHC environment variable to select boot compiler

Fixes #22340

(cherry picked from commit 32e264c1a11e6356bb045371b87a3736df19e792)

- - - - -
be78e321 by Matthew Pickering at 2023-01-06T15:36:14+00:00
packaging: Build perf builds with -split-sections

In 8f71d958 the make build system was made to use split-sections on
linux systems but it appears this logic never made it to hadrian.
There is the split_sections flavour transformer but this doesn't appear
to be used for perf builds on linux.

This is disbled on deb9 and windows due to #21670

Closes #21135

(cherry picked from commit be9dd9b03479070ba6387c251541f4569392c4bb)

- - - - -
81e37370 by Matthew Pickering at 2023-01-06T15:38:30+00:00
sphinx: Use modern syntax for extlinks

This fixes the following build error:

```
  Command line: /opt/homebrew/opt/sphinx-doc/bin/sphinx-build -b man -d /private/tmp/extra-dir-55768274273/.doctrees-man -n -w /private/tmp/extra-dir-55768274273/.log docs/users_guide /private/tmp/extra-dir-55768274273
  ===> Command failed with error code: 2

  Exception occurred:
    File "/opt/homebrew/Cellar/sphinx-doc/6.0.0/libexec/lib/python3.11/site-packages/sphinx/ext/extlinks.py", line 101, in role
      title = caption % part
              ~~~~~~~~^~~~~~
  TypeError: not all arguments converted during string formatting
```

I tested on Sphinx-5.1.1 and Sphinx-6.0.0

Thanks for sterni for providing instructions about how to test using
sphinx-6.0.0.

Fixes #22690

(cherry picked from commit 00dc51060881df81258ba3b3bdf447294618a4de)

- - - - -
a7d72a7c by Zubin Duggal at 2023-01-06T15:38:42+00:00
Force the Docs structure to prevent leaks in GHCi with -haddock without -fwrite-interface

Involves adding many new NFData instances.

Without forcing Docs, references to the TcGblEnv for each module are retained
by the Docs structure. Usually these are forced when the ModIface is serialised
but not when we aren't writing the interface.

(cherry picked from commit 62b9a7b23b20f5cf0a2de14251c2096098009f10)

- - - - -
86133736 by Matthew Pickering at 2023-01-06T15:39:01+00:00
Store RdrName rather than OccName in Holes

In #20472 it was pointed out that you couldn't defer out of scope but
the implementation collapsed a RdrName into an OccName to stuff it into
a Hole. This leads to the error message for a deferred qualified name
dropping the qualification which affects the quality of the error
message.

This commit adds a bit more structure to a hole, so a hole can replace a
RdrName without losing information about what that RdrName was. This is
important when printing error messages.

I also added a test which checks the Template Haskell deferral of out of
scope qualified names works properly.

Fixes #22130

(cherry picked from commit 6d62f6bfbb5a86131e7cbc30993f3fa510d8b3ab)

- - - - -
fd285b98 by Simon Peyton Jones at 2023-01-06T15:40:45+00:00
Fix unifier bug: failing to decompose over-saturated type family

This simple patch fixes #22647

(cherry picked from commit 317f45c154f6fe25d50ef2f3febcc5883ff1b1ca)

- - - - -
6378106a by Simon Peyton Jones at 2023-01-06T15:40:56+00:00
Refactor mkRuntimeError

This patch fixes #22634.  Because we don't have TYPE/CONSTRAINT
polymorphism, we need two error functions rather than one.

I took the opportunity to rname runtimeError to impossibleError,
to line up with mkImpossibleExpr, and avoid confusion with the
genuine runtime-error-constructing functions.

(cherry picked from commit 02ed7d783244bd95ee897825650426de6f5fb3e2)

- - - - -
d5985060 by Matthew Pickering at 2023-01-06T15:41:20+00:00
hadrian bindist: Install manpages to share/man/man1/ghc.1

When the installation makefile was copied over the manpages were no
longer installed in the correct place. Now we install it into share/man/man1/ghc.1
as the make build system did.

Fixes #22371

(cherry picked from commit 32b32d7fbc5544ad6c435a1ea26e6353ec567a9b)

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Data/EnumSet.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Errors.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ad8f5f60407b57747c66c59643dd714e52617020...d5985060ed1c136073ae82e98261b47ff6a48bc1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ad8f5f60407b57747c66c59643dd714e52617020...d5985060ed1c136073ae82e98261b47ff6a48bc1
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/20230106/52951d32/attachment-0001.html>


More information about the ghc-commits mailing list