-
1957e964
by Duncan Coutts at 2026-05-22T15:48:38+02:00
Handle heap allocation failure in I/O primops
The current I/O managers do not use allocateMightFail, but future ones
will. To support this properly we need to be able to return to the
primop with a failure. We simply use a bool return value.
Currently however, we will just throw an exception rather than calling
the GC because that's what all the other primops do too.
For the general issue of primops invoking GC and retrying, see
https://gitlab.haskell.org/ghc/ghc/-/issues/24105
(cherry picked from commit 62ae97de67f8cc59fc702e26a9e29eda1f84d461)
-
789790d2
by Luite Stegeman at 2026-05-22T15:48:38+02:00
Windows: remove StgAsyncIOResult and fix crash/leaks
In stg_block_async{_void}, a stack slot was reserved for
an StgAsyncIOResult. This slot would be filled by the IO
manager upon completion of the async call.
However, if the blocked thread was interrupted by an async
exception, we would end up in an invalid state:
- If the blocked computation was never re-entered, the
StgAsyncIOResult would never be freed.
- If the blocked computation was re-entered, the thread would
find an unitialized stack slot for the StgAsyncIOResult,
leading to a crash reading its fields, or freeing the pointer.
We fix this by removing the StgAsyncIOResult altogether and writing
the result directly to the stack.
Fixes #26341
(cherry picked from commit fcf092dda534cc38637d1f7920aa0dae58fe5273)
-
716a1340
by Brian J. Cardiff at 2026-05-22T15:48:38+02:00
configure: Accept happy-2.2
In Jan 2026 happy-2.2 was released. The most sensible change is https://github.com/haskell/happy/issues/335 which didn't trigger in a fresh build
(cherry picked from commit 4f2840f2bb729ef1a6660f9f5c46906b7b838147)
-
1cbf9aed
by sheaf at 2026-05-22T15:48:38+02:00
Careful with ticked join points in mergeCaseAlts
This commit backports the fix to GHC.Core.Utils.mergeCaseAlts that was
carried out in f726fcc4fb0b59f8ad2e2fa80f1b03efdaf73c30.
That is, this commit addresses the regression that was introduced by
e026bdf275e287005f2c2e534d3ba034ebf11c01, which allowed mergeCaseAlts to
move ticks in between a join point and one of its jumps, which results
in disaster (see #26929 but also #26642, #26693).
See (MC6) in Note [Merge Nested Cases] for a detailed explanation.
(cherry picked from commit 08bc245be70d95801bc1138804ed1de9474fbdc0)
(cherry picked from commit 974586eb5b6a924e8ce3ea8c4b2180ea9c0f3801)
-
30d967d8
by Zubin Duggal at 2026-05-22T15:48:38+02:00
driver: recognise .dyn_o as a valid object file to link if passed on the command line.
This allows plugins compiled with this suffix to run.
Fixes #24486
(cherry picked from commit bc4b44870d096d43e8cbc530da1fd613d9e4514f)
-
0ccecfc5
by mangoiv at 2026-05-22T15:48:38+02:00
profiling: partial backport of 2dadf3b0 to fix #27121
This backports fix and test for #27121 from 2dadf3b0 since the entirety
of the patch is not backportable without also backporting two larger
refactorings.
-
26da4dd4
by sheaf at 2026-05-22T15:48:38+02:00
Deal with 'noSpec' in 'coreExprToPmLit'
This commit makes two separate changes relating to
'GHC.HsToCore.Pmc.Solver.Types.coreExprAsPmLit':
1. Commit 7124e4ad mistakenly marked deferred errors as non-canonical,
which led to the introduction of 'nospec' wrappers in the
generated Core. This reverts that accident by declaring deferred
errors as being canonical, avoiding spurious 'nospec' wrapping.
2. Look through magic identity-like Ids such as 'nospec', 'inline' and
'lazy' in 'coreExprAsPmLit', just like Core Prep does.
There might genuinely be incoherent evidence, but that shouldn't
obstruct the pattern match checker. See test T27124a.
Fixes #25926 #27124
-------------------------
Metric Decrease:
T3294
-------------------------
(cherry picked from commit e8a196c65cee32f06c3d99b74af33457511408c7)
-
ba7b8b5d
by Luite Stegeman at 2026-05-22T15:48:38+02:00
CodeOutput: Fix finalizers on multiple platforms
- ELF platforms: emit .fini_array section
- wasm32/Darwin: emit initializer with __cxa_atexit call
- Windows: use -Wl,--whole-archive to prevent dropping finalizer symbols
- rts linker: fix crash/assertion failure unloading objects with finalizers
fixes #27072
(cherry picked from commit 014087e7a5753687161a24a1b2bc55c7bf7273fd)
-
c18b40a6
by Luite Stegeman at 2026-05-22T15:48:38+02:00
rts: add a few missing i386 relocations in the rts linker
(cherry picked from commit 04d143c02e82e9ca03eb75849959d369d07fb81a)