[Git][ghc/ghc][wip/T22264] 55 commits: Hadrian: correctly detect AR at-file support

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Fri Jan 27 19:38:06 UTC 2023



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


Commits:
e987e345 by Sylvain Henry at 2023-01-25T14:47:41-05:00
Hadrian: correctly detect AR at-file support

Stage0's ar may not support at-files. Take it into account.

Found while cross-compiling from Darwin to Windows.

- - - - -
48131ee2 by Sylvain Henry at 2023-01-25T14:47:41-05:00
Hadrian: fix Windows cross-compilation

Decision to build either unix or Win32 package must be stage specific
for cross-compilation to be supported.

- - - - -
288fa017 by Sylvain Henry at 2023-01-25T14:47:41-05:00
Fix RTS build on Windows

This change fixes a cross-compilation issue from ArchLinux to Windows
because these symbols weren't found.

- - - - -
2fdf22ae by Sylvain Henry at 2023-01-25T14:47:41-05:00
configure: support "windows" as an OS

- - - - -
13a0566b by Simon Peyton Jones at 2023-01-25T14:48:16-05:00
Fix in-scope set in specImports

Nothing deep here; I had failed to bring some
floated dictionary binders into scope.

Exposed by -fspecialise-aggressively

Fixes #22715.

- - - - -
b7efdb24 by Matthew Pickering at 2023-01-25T14:48:51-05:00
ci: Disable HLint job due to excessive runtime

The HLint jobs takes much longer to run (20 minutes) after "Give the RTS it's own configure script" eb5a6b91

Now the CI job will build the stage0 compiler before it generates the necessary RTS headers.

We either need to:

* Fix the linting rules so they take much less time
* Revert the commit
* Remove the linting of base from the hlint job
* Remove the hlint job

This is highest priority as it is affecting all CI pipelines.

For now I am just disabling the job because there are many more pressing
matters at hand.

Ticket #22830

- - - - -
1bd32a35 by Sylvain Henry at 2023-01-26T12:34:21-05:00
Factorize hptModulesBelow

Create and use moduleGraphModulesBelow in GHC.Unit.Module.Graph that
doesn't need anything from the driver to be used.

- - - - -
1262d3f8 by Matthew Pickering at 2023-01-26T12:34:56-05:00
Store dehydrated data structures in CgModBreaks

This fixes a tricky leak in GHCi where we were retaining old copies of
HscEnvs when reloading. If not all modules were recompiled then these
hydrated fields in break points would retain a reference to the old
HscEnv which could double memory usage.

Fixes #22530

- - - - -
e27eb80c by Matthew Pickering at 2023-01-26T12:34:56-05:00
Force more in NFData Name instance

Doesn't force the lazy `OccName` field (#19619) which is already known
as a really bad source of leaks.

When we slam the hammer storing Names on disk (in interface files or the
like), all this should be forced as otherwise a `Name` can easily retain
an `Id` and hence the entire world.

Fixes #22833

- - - - -
3d004d5a by Matthew Pickering at 2023-01-26T12:34:56-05:00
Force OccName in tidyTopName

This occname has just been derived from an `Id`, so need to force it
promptly so we can release the Id back to the world.

Another symptom of the bug caused by #19619

- - - - -
f2a0fea0 by Matthew Pickering at 2023-01-26T12:34:56-05:00
Strict fields in ModNodeKey (otherwise retains HomeModInfo)

Towards #22530

- - - - -
5640cb1d by Sylvain Henry at 2023-01-26T12:35:36-05:00
Hadrian: fix doc generation

Was missing dependencies on files generated by templates (e.g.
ghc.cabal)

- - - - -
ecbd81f6 by Ben Gamari at 2023-01-26T16:11:55-05:00
testsuite: Introduce threaded2_sanity way

Incredibly, we previously did not have a single way which would test the
threaded RTS with multiple capabilities and the sanity-checker enabled.

- - - - -
ee5493ec by Ben Gamari at 2023-01-26T16:11:56-05:00
rts: Relax Messages assertion

`doneWithMsgThrowTo` was previously too strict in asserting that the
`Message` is locked. Specifically, it failed to consider that the
`Message` may not be locked if we are deleting all threads during RTS
shutdown.

- - - - -
0551b0c5 by Ben Gamari at 2023-01-26T16:12:14-05:00
testsuite: Fix race in UnliftedTVar2

Previously UnliftedTVar2 would fail when run with multiple capabilities
(and possibly even with one capability) as it would assume that
`killThread#` would immediately kill the "increment" thread.

Also, refactor the the executable to now succeed with no output and
fails with an exit code.

- - - - -
9b3898fd by Ben Gamari at 2023-01-26T16:12:22-05:00
testsuite: Make listThreads more robust

Previously it was sensitive to the labels of threads which it did not
create (e.g. the IO manager event loop threads). Fix this.

- - - - -
04eb0183 by Ben Gamari at 2023-01-26T16:12:34-05:00
rts: Fix non-atomic mutation of enabled_capabilities

- - - - -
7e686644 by Ben Gamari at 2023-01-26T16:23:48-05:00
rts: Fix C++ compilation issues

Make the RTS compilable with a C++ compiler by inserting necessary
casts.

- - - - -
f3a090e5 by Ben Gamari at 2023-01-26T16:23:48-05:00
rts: Fix typo

"tracingAddCapabilities" was mis-named

- - - - -
d72a0ae1 by Ben Gamari at 2023-01-26T16:23:48-05:00
rts: Drop long-dead fallback definitions for INFINITY & NAN

These are no longer necessary since we now compile as C99.

- - - - -
b642ef1d by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Fix style

- - - - -
79bc39b4 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Deduplicate assertion

- - - - -
199cf4fe by Ben Gamari at 2023-01-27T10:09:09-05:00
rts: Fix type issues in Sparks.h

Adds explicit casts to satisfy a C++ compiler.

- - - - -
62a64d08 by Ben Gamari at 2023-01-27T10:09:09-05:00
rts/BlockAlloc: Allow disabling of internal assertions

These can be quite expensive and it is sometimes useful to compile a
DEBUG RTS without them.

- - - - -
2d8b29ef by Ben Gamari at 2023-01-27T10:09:09-05:00
rts/Sanity: Mark pinned_object_blocks

- - - - -
f5a0115a by Ben Gamari at 2023-01-27T10:09:09-05:00
rts/Sanity: Look at nonmoving saved_filled lists

- - - - -
dd784b3b by Ben Gamari at 2023-01-27T10:09:09-05:00
Evac: Squash data race in eval_selector_chain

- - - - -
9e3f4ecc by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Clarify implementation

This makes the intent of this implementation a bit clearer.

- - - - -
1af1e990 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Clarify comment

- - - - -
9f931a88 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Add missing no-op in busy-wait loop

- - - - -
d407cc3e by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Don't push empty arrays to update remembered set

Previously the write barrier of resizeSmallArray# incorrectly handled
resizing of zero-sized arrays, pushing an invalid pointer to the update
remembered set.

Likely fixes the cause of #22264.

- - - - -
a999f7b5 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Fix handling of weak pointers

This fixes an interaction between aging and weak pointer handling which
prevented the finalization of some weak pointers. In particular, weak
pointers could have their keys incorrectly marked by the preparatory
collector, preventing their finalization by the subsequent concurrent
collection.

While in the area, we also significantly improve the assertions
regarding weak pointers.

Fixes #22327.

- - - - -
34dacb43 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Sanity check nonmoving large objects and compacts

- - - - -
bd9ce0b1 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Sanity check mutable list

Assert that entries in the nonmoving generation's generational
remembered set (a.k.a. mutable list) live in nonmoving generation.

- - - - -
fcd97941 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Don't show occupancy if we didn't collect live words

- - - - -
48b89dba by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Fix tracking of FILLED_SWEEPING segments

Previously we only updated the state of the segment at the head of each
allocator's filled list.

- - - - -
0da3a9c7 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Assert state of swept segments

- - - - -
6dfc1646 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Handle new closures in nonmovingIsNowAlive

- - - - -
b93457b8 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Don't clobber update rem sets of old capabilities

Previously `storageAddCapabilities` (called by `setNumCapabilities`) would
clobber the update remembered sets of existing capabilities when
increasing the capability count. Fix this by only initializing the
update remembered sets of the newly-created capabilities.

- - - - -
038650d9 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Add missing write barriers in selector optimisation

This fixes the selector optimisation, adding a few write barriers which
are necessary for soundness.

- - - - -
d1d88f29 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Post-sweep sanity checking

- - - - -
c00d6de8 by Ben Gamari at 2023-01-27T10:09:09-05:00
nonmoving: Avoid n_caps race

- - - - -
e3751a2c by Ben Gamari at 2023-01-27T10:09:10-05:00
nonmoving: Don't push if nonmoving collector isn't enabled

- - - - -
cc75031b by Ben Gamari at 2023-01-27T10:09:10-05:00
nonmoving: Be more paranoid in segment tracking

Previously we left various segment link pointers dangling. None of this
wrong per se, but it did make it harder than necessary to debug.

- - - - -
c6206696 by Ben Gamari at 2023-01-27T14:23:38-05:00
nonmoving: Sync-phase mark budgeting

Here we significantly improve the bound on sync phase pause times by
imposing a limit on the amount of work that we can perform during the
sync. If we find that we have exceeded our marking budget then we allow
the mutators to resume, return to concurrent marking, and try
synchronizing again later.

- - - - -
3887132f by Ben Gamari at 2023-01-27T14:23:38-05:00
nonmoving: Allow pinned gen0 objects to be WEAK keys

- - - - -
e55d4cc6 by Ben Gamari at 2023-01-27T14:23:38-05:00
rts: Reenable assertion

- - - - -
29223105 by Ben Gamari at 2023-01-27T14:23:38-05:00
nonmoving: Move current segment array into Capability

- - - - -
298824f0 by Ben Gamari at 2023-01-27T14:23:38-05:00
nonmoving: Fix Note references

Some references to Note [Deadlock detection under the non-moving
collector] were missing an article.

- - - - -
f30551dd by Ben Gamari at 2023-01-27T14:23:38-05:00
rts/Sanity: Fix block count assertion with non-moving collector

The nonmoving collector does not use `oldest_gen->blocks` to track its
block list. However, it nevertheless updates `oldest_gen->n_blocks` to
ensure that its size is accounted for by the storage manager.
Consequently, we must not attempt to assert consistency between the two.

- - - - -
50433d12 by Ben Gamari at 2023-01-27T14:23:38-05:00
hadrian: Add +boot_nonmoving_gc flavour transformer

For using GHC bootstrapping to validate the non-moving GC.

- - - - -
79b96b4f by Ben Gamari at 2023-01-27T14:23:38-05:00
gitlab-ci: Add job bootstrapping with nonmoving GC

- - - - -
b81ad23e by Ben Gamari at 2023-01-27T14:23:39-05:00
nonmoving: Don't call prepareUnloadCheck

When the nonmoving GC is in use we do not call `checkUnload` (since we
don't unload code) and therefore should not call `prepareUnloadCheck`,
lest we run into assertions.

- - - - -
b6deaacd by Ben Gamari at 2023-01-27T14:23:39-05:00
rts: Encapsulate block allocator spinlock

This makes it a bit easier to add instrumentation on this spinlock
while debugging.

- - - - -
01fcb9ac by Ben Gamari at 2023-01-27T14:24:10-05:00
testsuite: Skip some tests when sanity checking is enabled

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Unit/Module/Graph.hs
- hadrian/cfg/system.config.in
- hadrian/src/Builder.hs
- hadrian/src/Flavour.hs
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Default.hs
- libraries/base/tests/listThreads.hs
- − libraries/base/tests/listThreads.stdout
- m4/fptools_set_haskell_platform_vars.m4
- m4/ghc_convert_os.m4
- rts/Capability.c
- rts/Capability.h
- rts/Messages.h
- rts/PrimOps.cmm
- rts/RtsStartup.c
- rts/RtsSymbols.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b90a7f9e72c926e52acbdfaa61f8bf3c4826142a...01fcb9acd861a21a16386d41d3db29f76b9b9617

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b90a7f9e72c926e52acbdfaa61f8bf3c4826142a...01fcb9acd861a21a16386d41d3db29f76b9b9617
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/20230127/d95c6bcc/attachment-0001.html>


More information about the ghc-commits mailing list