Zubin pushed to branch wip/9.14.2-rc2 at Glasgow Haskell Compiler / GHC

Commits:

24 changed files:

Changes:

  • changelog.d/27626 deleted
    1
    -section: compiler
    
    2
    -synopsis: Fix a bug where an argument used only by a function's stable unfolding
    
    3
    -  could still be marked absent, resulting in a runtime crash.
    
    4
    -mrs: !16503
    
    5
    -issues: #27626

  • changelog.d/27627 deleted
    1
    -section: compiler
    
    2
    -synopsis: Fix a bug where an absent constraint argument could be replaced by an
    
    3
    -  error thunk, which GHC then evaluated, crashing the program.
    
    4
    -mrs: !16519
    
    5
    -issues: #27627

  • changelog.d/27703 deleted
    1
    -section: compiler
    
    2
    -synopsis: Fix a bug where the specialiser could drop an argument that the
    
    3
    -  function's stable unfolding still used, resulting in a runtime crash.
    
    4
    -mrs: !16519
    
    5
    -issues: #27703

  • changelog.d/27704 deleted
    1
    -section: compiler
    
    2
    -synopsis: Fix a bug where a class declared abstractly in an hs-boot file was
    
    3
    -  assumed not to be unary, so GHC speculatively evaluated a dictionary that
    
    4
    -  could be bottom, crashing the program.
    
    5
    -mrs: !16519
    
    6
    -issues: #27704

  • changelog.d/27717 deleted
    1
    -section: compiler
    
    2
    -synopsis: Fix a bug where -fspec-eval-dictfun could speculatively evaluate a
    
    3
    -  looping dictionary whose recursion went through an hs-boot import, hanging
    
    4
    -  the program.
    
    5
    -mrs: !16519
    
    6
    -issues: #27717

  • changelog.d/T26423 deleted
    1
    -section: compiler
    
    2
    -synopsis: Introduce ``ExternalUnitDatabases`` and ``ExternalUnitDatabaseCache`` to cache unit databases.
    
    3
    -issues: #26423
    
    4
    -mrs: !16115
    
    5
    -
    
    6
    -description: {
    
    7
    -    Cache the ``UnitDatabase`` in memory in ``ExternalUnitDatabases`` to avoid constantly reading
    
    8
    -    the same ``UnitDatabase`` from disk with multiple home units.
    
    9
    -
    
    10
    -    Allows to share the on-disk representation of ``UnitInfo`` across the whole ``UnitEnv``.
    
    11
    -    We cache a mutable version of ``ExternalUnitDatabases`` as ``ExternalUnitDatabaseCache``
    
    12
    -    in ``UnitEnv``.
    
    13
    -    This allows us more easily to change the ``packageDBFlags`` and reading new package databases
    
    14
    -    from disk if required, but cache everything that has been read from disk before.
    
    15
    -}

  • changelog.d/T26716 deleted
    1
    -section: rts
    
    2
    -synopsis: Fix design of TSO blocking info, fixing a use-after-free bug
    
    3
    -issues: #26716 #26717
    
    4
    -mrs: !15519
    
    5
    -description: {
    
    6
    -  Experimental work on ASAN support for GHC (MR !15168) revealed a
    
    7
    -  use-after-free bug when using the combination of the new poll I/O
    
    8
    -  manager with the compacting GC. The ultimate cause is that a TSO's
    
    9
    -  `block_info` (used by I/O managers and many other parts of the RTS)
    
    10
    -  is sometimes a GC pointer and sometimes not, but without a consistent
    
    11
    -  and easy-to-follow rule for when this is the case. The solution has
    
    12
    -  been to clean up and enforce that the TSO's `why_blocked` enumeration
    
    13
    -  is a proper tag for the `block_info`, and to use an encoding that
    
    14
    -  determines precisely when the `block_info` is a GC pointer or not.
    
    15
    -}

  • changelog.d/T27202 deleted
    1
    -section: ghci
    
    2
    -synopsis: Fix regression to honour module targets in nested directories into GHCi after startup.
    
    3
    -issues: #27202 #27640
    
    4
    -mrs: !15980 !16591
    
    5
    -
    
    6
    -description: {
    
    7
    -    Fix a regression that made it impossible to import modules using `:load <Mod>` and `:add <Mod>` after GHCi startup.
    
    8
    -    GHCi wasn't honouring the `-i<directory>` argument if given via `ghci -i<directory>`.
    
    9
    -
    
    10
    -    Further, we fix a bug while setting up package database stacks for GHCi that was uncovered during this fix.
    
    11
    -    By underspecifying the version of dependencies, import modules from dependencies were ambiguous, even though
    
    12
    -    they shouldn't have been!
    
    13
    -}

  • changelog.d/T27308 deleted
    1
    -section: compiler
    
    2
    -synopsis: Drop `preloadClosure` from `UnitState`
    
    3
    -issues: #27308
    
    4
    -mrs: !16108
    
    5
    -
    
    6
    -description: {
    
    7
    -    Drop `preloadClosure` from `UnitState` as it is always set to the empty set.
    
    8
    -    This allows to simplify the `UnitState` and related functions.
    
    9
    -}
    
    10
    -

  • changelog.d/T27314.md deleted
    1
    -section: compiler
    
    2
    -issues: #27314
    
    3
    -mrs: !16118
    
    4
    -synopsis:
    
    5
    -  Fix spurious ``-Wincomplete-uni-patterns`` warning under ``-finfo-table-map``.
    
    6
    -description:
    
    7
    -  The pattern-match checker now ignores ticks when comparing scrutinees in
    
    8
    -  its CoreMap, so long-distance information is no longer lost across
    
    9
    -  function-application scrutinees because debug source annotations
    
    10
    -  (e.g. SourceNotes added by ``-finfo-table-map``) were inserted.

  • changelog.d/T27360 deleted
    1
    -section: compiler
    
    2
    -issues: #27360
    
    3
    -mrs: !16161
    
    4
    -synopsis:
    
    5
    -  Recognise ``considerAccessible`` under ticks (``-g``, ``-finfo-table-map``, ``-fhpc`` etc)
    
    6
    -description:
    
    7
    -  The pattern-match checker now properly recognises ``considerAccessible`` even
    
    8
    -  when it is surrounded by ticks (e.g. debug info ticks with ``-g``, with
    
    9
    -  ``-finfo-table-map``, etc). This ensures it works as advertised, suppressing
    
    10
    -  redundant pattern-match warnings, even when it occurs under a tick.

  • changelog.d/T27440 deleted
    1
    -section: compiler
    
    2
    -issues: #27440
    
    3
    -mrs: !16434
    
    4
    -synopsis:
    
    5
    -  Fix a panic on ``@ty`` in a pattern synonym RHS
    
    6
    -description:
    
    7
    -  An invisible type argument (``@ty``) in the right-hand side of an implicitly
    
    8
    -  bidirectional pattern synonym no longer causes a panic.

  • changelog.d/T27455 deleted
    1
    -section: base
    
    2
    -issues: #27455
    
    3
    -mrs: !16274
    
    4
    -synopsis:
    
    5
    -  Don't drop `ExceptionContext` in `SomeException(toException)`
    
    6
    -description:
    
    7
    -  Previously the implementation of ``Exception(toException)`` given to `SomeException` would inappropriately drop the carried `ExceptionContext`. Now ``toException = id``, faithfully implementing the semantics proposed in :ref:`CLC Proposal #200 <https://github.com/haskell/core-libraries-committee/issues/200>`.
    
    8
    -

  • changelog.d/T27583 deleted
    1
    -section: compiler
    
    2
    -issues: #27583
    
    3
    -mrs: !16434
    
    4
    -synopsis:
    
    5
    -  Fix spurious out-of-scope errors from ``type ty`` in a pattern synonym RHS
    
    6
    -description:
    
    7
    -  A required type argument with an explicit namespace specifier (``type ty``)
    
    8
    -  in the right-hand side of an implicitly bidirectional pattern synonym no
    
    9
    -  longer reports variables bound by the pattern as out of scope.

  • changelog.d/T27586 deleted
    1
    -section: compiler
    
    2
    -issues: #27586
    
    3
    -mrs: !16440
    
    4
    -synopsis:
    
    5
    -  Fix a panic on a required type argument in a pattern synonym RHS
    
    6
    -description:
    
    7
    -  An argument of a pattern synonym that is matched against a required type
    
    8
    -  argument in the right-hand side no longer causes a panic; it is reported as
    
    9
    -  an illegal term-level use of a type variable.

  • changelog.d/T27639 deleted
    1
    -section: compiler
    
    2
    -issues: #27639
    
    3
    -mrs: !16474
    
    4
    -synopsis:
    
    5
    -  Stop representation-polymorphism checks from producing a coercion that fails
    
    6
    -  Core Lint.
    
    7
    -description:
    
    8
    -  The representation-polymorphism check that is done when subsumption performs
    
    9
    -  eta-expansion now composes the coercions it builds in the correct order,
    
    10
    -  avoiding a Core Lint failure.

  • changelog.d/T27657 deleted
    1
    -section: base
    
    2
    -issues: #27657
    
    3
    -mrs: !16508
    
    4
    -synopsis:
    
    5
    -  Fix ``retry`` and async exception delivery inside a ``catchSTM`` handler
    
    6
    -description:
    
    7
    -  ``catchSTM``\'s ``WhileHandling`` annotation used ``catch#``, leaving an IO
    
    8
    -  ``CATCH_FRAME`` inside the transaction. Use ``catchSTM#``, which is the
    
    9
    -  correct way to catch exceptions inside STM.

  • changelog.d/T27705 deleted
    1
    -section: compiler
    
    2
    -synopsis: Fixed an issue that caused the specializer to sometimes loop on recursive dictionary superclasses.
    
    3
    -issues: #27705
    
    4
    -mrs: !16559
    
    5
    -

  • changelog.d/arm_ncg_fixes_T27430 deleted
    1
    -section: compiler
    
    2
    -issues: #27430 #27539 #27538 #27537 #27550 #27565 #27533
    
    3
    -mrs: !16255
    
    4
    -synopsis:
    
    5
    -  A series of fixes to the ARM64 ncg, related to handling of primitive
    
    6
    -  8/16bit types and simd.
    
    7
    -description:
    
    8
    -  A series of related fixes to the ncg fixing:
    
    9
    -
    
    10
    -  Fixed sign extension for subword values returned from unsafe ffi calls.
    
    11
    -  Clarify and lint for invalid conversions of int8/int16 -> float/double conversions.
    
    12
    -  Fix incorrect clobbering of local variables when comparing signed subword values.
    
    13
    -  Fix incorrect use of 32bit reads/stores for 8/16bit wide reads/stores.
    
    14
    -  Fix zero extension on function entry if arguments are passed at word-width
    
    15
    -  but used at subword-widths.
    
    16
    -  Fix broadcast# for non-literal arguments (arm64 only).
    
    17
    -  Fix rare assembler errors caused by overflowing literals, by properly checking
    
    18
    -  whether a constant is a viable immediate argument.

  • changelog.d/fix-parallel-gc-selector-race-27477 deleted
    1
    -section: rts
    
    2
    -synopsis: Fix a parallel GC race on weakly-ordered architectures (AArch64) that could crash or silently corrupt the heap
    
    3
    -description:
    
    4
    -  On weakly-ordered architectures such as AArch64 programs using
    
    5
    -  could crash during parallel garbage collection (segmentation fault
    
    6
    -  or ``internal error: eval_thunk_selector: strange selectee <n>``) or
    
    7
    -  continue running with silently corrupted heap data, due to a missing
    
    8
    -  memory barrier in the parallel GC.
    
    9
    -mrs: !16488
    
    10
    -issues: #27477

  • changelog.d/llvm-23 deleted
    1
    -section: llvm-backend
    
    2
    -synopsis: Bump LlvmMaxVersion to support LLVM 23.x releases.
    
    3
    -issues: #27764
    
    4
    -mrs: !16617

  • changelog.d/unit-index deleted
    1
    -section: compiler
    
    2
    -synopsis: Use global ``UnitIndex`` to deduplicate ``UnitInfo``s over multiple home units
    
    3
    -issues: #27500 #26423 #27748
    
    4
    -mrs: !16115 !16598
    
    5
    -
    
    6
    -description: {
    
    7
    -    The ``UnitState`` used to be duplicated for all ``HomeUnitEnv``, not sharing any of the ``UnitInfo``s.
    
    8
    -    This can lead to excessive memory usage with multiple home units and large package databases.
    
    9
    -
    
    10
    -    Our solution to this problem is deduplicating ``UnitInfo``s globally across the whole ``UnitEnv``.
    
    11
    -    We store this information in the ``UnitIndex`` which contains data global to all ``UnitState``s.
    
    12
    -    All processed ``UnitInfo``s and the ``WiredMap`` are stored in there, and in the future, we might
    
    13
    -    move more fields from ``UnitState`` to ``UnitIndex``.
    
    14
    -}

  • docs/users_guide/9.14.2-notes.rst
    ... ... @@ -87,13 +87,30 @@ Compiler
    87 87
     - Make the order of usages deterministic (:ghc-ticket:`26877`)
    
    88 88
     - Fix the interaction of ExplicitLevelImports with qualified imports (:ghc-ticket:`26616`, :ghc-ticket:`27385`)
    
    89 89
     - Rename ZonkAny to UnusedType and add pretty printing logic for it (:ghc-ticket:`27390`)
    
    90
    +- Cache unit databases and use a global ``UnitIndex`` to deduplicate
    
    91
    +  ``UnitInfo``\s across multiple home units, reducing memory usage
    
    92
    +  (:ghc-ticket:`26423`, :ghc-ticket:`27500`, :ghc-ticket:`27748`)
    
    93
    +- Drop ``preloadClosure`` from ``UnitState`` (:ghc-ticket:`27308`)
    
    94
    +- Fix a bug where an argument used only by a function's stable unfolding could still be marked absent, resulting in a runtime crash. (:ghc-ticket:`27626`)
    
    95
    +- Fix a bug where an absent constraint argument could be replaced by an error thunk, which GHC then evaluated, crashing the program. (:ghc-ticket:`27627`)
    
    96
    +- Fix a bug where the specialiser could drop an argument that the function's stable unfolding still used, resulting in a runtime crash. (:ghc-ticket:`27703`)
    
    97
    +- Fix a bug where a class declared abstractly in an hs-boot file was assumed not to be unary, so GHC speculatively evaluated a dictionary that could be bottom, crashing the program. (:ghc-ticket:`27704`)
    
    98
    +- Fix a bug where ``-fspec-eval-dictfun`` could speculatively evaluate a looping dictionary whose recursion went through an hs-boot import, hanging the program. (:ghc-ticket:`27717`)
    
    99
    +- Fix a panic on ``@ty`` in a pattern synonym RHS (:ghc-ticket:`27440`)
    
    100
    +- Fix spurious out-of-scope errors from ``type ty`` in a pattern synonym RHS (:ghc-ticket:`27583`)
    
    101
    +- Fix a panic on a required type argument in a pattern synonym RHS (:ghc-ticket:`27586`)
    
    102
    +- Stop representation-polymorphism checks from producing a coercion that fails Core Lint. (:ghc-ticket:`27639`)
    
    103
    +- Fixed an issue that caused the specializer to sometimes loop on recursive dictionary superclasses. (:ghc-ticket:`27705`)
    
    104
    +- Bumped the maximum supported LLVM version to 23 (:ghc-ticket:`27764`)
    
    105
    +- Recognise ``considerAccessible`` under ticks (``-g``, ``-finfo-table-map``, ``-fhpc`` etc) (:ghc-ticket:`27360`)
    
    106
    +- Fix spurious ``-Wincomplete-uni-patterns`` warning under ``-finfo-table-map``. (:ghc-ticket:`27314`)
    
    90 107
     
    
    91 108
     GHCi
    
    92 109
     ~~~~
    
    93 110
     
    
    94 111
     - Added the ``-fimport-loaded-targets`` flag, which automatically imports all loaded targets into the GHCi session (:ghc-ticket:`26866`)
    
    95 112
     - Added support for custom external interpreter commands, allowing GHC API clients to extend the external interpreter with their own message handlers (:ghc-ticket:`26652`)
    
    96
    -- Fix regression to allow loading modules into the GHCi after startup (:ghc-ticket:`27202`)
    
    113
    +- Fix regression to allow loading modules into the GHCi after startup (:ghc-ticket:`27202`, :ghc-ticket:`27640`)
    
    97 114
     - Fixed the GHCi prompt and session home units to use a consistent package database stack, avoiding spurious ambiguous-import errors for home unit dependencies (:ghc-ticket:`27202`)
    
    98 115
     - Fixed the order in which ``:info`` lists instances, which previously depended on the order in which interface files happened to be loaded (:ghc-ticket:`27532`)
    
    99 116
     
    
    ... ... @@ -128,6 +145,9 @@ Runtime System
    128 145
     - Fix several black hole handling bugs that could lead to deadlocks or crashes in multithreaded programs. These could show up as the program hanging or "END_TSO_QUEUE object entered" errors (:ghc-ticket:`26922`, :ghc-ticket:`26936`)
    
    129 146
     - Rethrow exceptions in overlapped IO when using the WinIO IO manager (:ghc-ticket:`27283`)
    
    130 147
     - Fix "unknown/strange object 24 crash" in compacting GC (:ghc-ticket:`27434`)
    
    148
    +- Fix a possible use-after-free bug with TSOs (:ghc-ticket:`26716`, :ghc-ticket:`26717`)
    
    149
    +- Fix a parallel GC race on weakly-ordered architectures (AArch64) that could crash or silently corrupt the heap (:ghc-ticket:`27477`)
    
    150
    +- Fix stack corruption when returning large unboxed tuples in GHCi (:ghc-ticket:`27633`)
    
    131 151
     
    
    132 152
     Code Generation
    
    133 153
     ~~~~~~~~~~~~~~~
    
    ... ... @@ -139,6 +159,10 @@ Code Generation
    139 159
     - Fix module finalizers on multiple platforms (:ghc-ticket:`27072`)
    
    140 160
     - Fix miscompiled %load_relaxed primop, add missing %store_relaxed (:ghc-ticket:`27483`)
    
    141 161
     - Fix redundant AP thunk codegen when not using -ticky-ap-thunk (:ghc-ticket:`27502`)
    
    162
    +- A number of fixes to the ARM64 ncg, fixing a number of bugs, including
    
    163
    +  incorrect runtime results when using subword operations
    
    164
    +  (:ghc-ticket:`27430`, :ghc-ticket:`27539`, :ghc-ticket:`27538`,
    
    165
    +  :ghc-ticket:`27537`, :ghc-ticket:`27550`, :ghc-ticket:`27533`)
    
    142 166
     
    
    143 167
     Bytecode Compiler
    
    144 168
     ~~~~~~~~~~~~~~~~~
    
    ... ... @@ -151,6 +175,8 @@ Bytecode Compiler
    151 175
     ~~~~~~~~~~~~~~~~
    
    152 176
     
    
    153 177
     - Added ``@since`` annotation to ``System.Info.fullCompilerVersion`` (:ghc-ticket:`26973`)
    
    178
    +- Don't drop ``ExceptionContext`` in ``SomeException(toException)`` (:ghc-ticket:`27455`)
    
    179
    +- Fix ``retry`` and async exception delivery inside a ``catchSTM`` handler (:ghc-ticket:`27657`)
    
    154 180
     
    
    155 181
     ``ghc-heap`` library
    
    156 182
     ~~~~~~~~~~~~~~~~~~~~
    

  • libraries/base/changelog.md
    ... ... @@ -8,6 +8,7 @@
    8 8
       * Hide implementation details of `throw` and `throwSTM` from exception stack traces ([CLC proposal #387](https://github.com/haskell/core-libraries-committee/issues/387), [#26808](https://gitlab.haskell.org/ghc/ghc/-/issues/26808))
    
    9 9
       * GHC internals re-exported from `GHC.Num` have been deprecated and will be removed after one major release ([CLC proposal #360](https://github.com/haskell/core-libraries-committee/issues/360))
    
    10 10
       * The implementation of `toException` in `SomeException`'s `Exception` instance no longer drops exception context, in keeping with the behavior originally proposed in [CLC Proposal #200](https://github.com/haskell/core-libraries-committee/issues/200).
    
    11
    +  * Fix `retry` and async exception delivery inside a `catchSTM` handler ([#27657](https://gitlab.haskell.org/ghc/ghc/-/issues/27657))
    
    11 12
     
    
    12 13
     ## 4.22.0.0 *December 2025*
    
    13 14
       * Shipped with GHC 9.14.1