Andreas Klebinger pushed to branch wip/andreask/9.10.4-batch1 at Glasgow Haskell Compiler / GHC Commits: 226d17f3 by Cheng Shao at 2026-11-17T14:04:45+01:00 compiler: fix missing handling of CmmUnsafeForeignCall node in LayoutStack This patch fixes missing handling of `CmmUnsafeForeignCall` middle node in the `LayoutStack` pass. Before proc-points splitting, this pass computes liveliness of local registers, and spills those alive across a Cmm native call onto the stack. It need to traverse all middle nodes in each block and check whether a local register is an assignee, if so then the previous mapping in `sm_regs` is invalidated and needs to be dropped. However, it didn't handle `CmmUnsafeForeignCall` node which may also assign to a local register. When proc-points splitting is enabled, this can produce an invalid basic block that doesn't properly backup the updated local register to the stack before doing a Cmm call, resulting in completely invalid runtime behavior. The patch also adds a `T27447` regression test. With no-TNTC or with LLVM backend, without the fix the test case would output a stale 0x1111111111111111 value, instead of the expected 0x2222222222222222 output. Fixes #27447. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 3f00f234d0d5b3b3b2a23a5dc70ce372eb9bbdb4) - - - - - e605eb4c by mangoiv at 2026-11-17T14:07:07+01:00 ci: retry fetching test metrics Retry fetching test metrics to make the CI not fail if the services is temporarily unavailable (cherry picked from commit b7e24044fde064cb3f0d44c36872a86d024cd7d4) - - - - - 10b584a7 by Zubin Duggal at 2026-11-17T14:10:20+01:00 Update to semaphore-compat 2.0.0 using v2 of the protocol On Linux and other POSIX platforms, GHC's -jsem jobserver client now speaks v2 of the semaphore-compat protocol, which uses Unix domain sockets in place of POSIX named semaphores. This avoids the libc-ABI issues that affected the old implementation. Windows is unaffected and continues to use the v1 protocol (Win32 named semaphores); its reported protocol version remains v1. When GHC receives a -jsem name whose protocol version it does not support, it emits a -Wsemaphore-version-mismatch warning and falls back to -j<N> rather than crashing. ghc --info exposes the supported version in a new "Semaphore version" entry so cabal-install can detect a mismatch before invoking GHC. Users on a cabal-install that predates the v2 update will continue to build successfully on Linux/POSIX, but will lose the cross-process -jsem coordination and fall back to -j<N> per GHC invocation. Users must upgrade to a cabal-install that supports protocol v2 to recover full parallelism. Also fix a leak in cleanupSem (#27253): cleanupSem used to snapshot heldTokens and release them before killing the loop, while the loop's in-flight acquire/release children could still be mutating it. Cleanup now runs inside the loop's own exit handler, after draining the active child via a new activeChild TVar, so the snapshot has no concurrent mutator. See also: - GHC proposal amendment: https://github.com/ghc-proposals/ghc-proposals/pull/673 - cabal-install patch: https://github.com/haskell/cabal/pull/11628 - semaphore-compat MR: https://gitlab.haskell.org/ghc/semaphore-compat/-/merge_requests/8 Bump semaphore-compat submodule to 2.0.0 Fixes #25087 and #27253 (cherry picked from commit 8db331a381ae47ad9ad5c8613f5d3e2588d5dd55) - - - - - 0dad41ff by Andreas Klebinger at 2026-11-17T14:14:50+01:00 Fix a profiling race condition resulting in segfaults. StgToCmm: Don't assume tagged FUN closures in closureCodeBody. When entering a closure the self/node pointer might not be tagged in some situations when a thunk is evaluated by multiple threads. So we most AND away the tag bits rather than subtracting an expected tag. Apply.cmm: Fix a race condition occuring when a thunk is mutated during GC. In stg_ap_0_fast when might need to run GC before entering a thunk. If this happens another thread or the GC itself might mutate the closure making entering it no longer valid. We now check for this. Add test and changelog for #27123 fixes. (cherry picked from commit ed09895d7de1ca116a561868c151fd825a16ad0c) - - - - - b4024ee5 by Cheng Shao at 2026-11-17T14:15:39+01:00 ghc-heap: fix invalid srtlen returned by peekItbl when no-TNTC This patch fixes the no-TNTC code path of `peekItbl` so that it looks at the right memory address when reading the `srt` field from the `StgInfoTable_` struct. Also adds a `T27465` regression test that reproduces the bug on no-TNTC builds before the fix. Fixes #27465. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 67c03eb2c762fdfeb646eb8345341173dd4268b2) - - - - - 41ec1e12 by Cheng Shao at 2026-11-17T14:16:00+01:00 compiler: fix miscompiled %load_relaxed, add missing %store_relaxed This patch fixes the %load_relaxed cmm primop compilation logic to correctly use relaxed memory ordering, and adds the missing %store_relaxed primop. Parsing logic of %load/%store with explicit ordering is covered in the AtomicFetch test case. Fixes #27483. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit eee8ec5b25ef0f83ba4822e7a0a941df7b0bec5f) - - - - - 98c5d763 by Cheng Shao at 2026-11-17T14:16:24+01:00 rts: fix missing UNTAG in stg_readTVarIOzh This patch fixes missing UNTAG on the current value closure read from StgTVar. UNTAG is a no-op when it's stg_TREC_HEADER_info which is word aligned; it may be a tagged closure, and reading info table from the tagged address is an unaligned load which may cause issues on platforms with strict alignment requirements. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit d377e83e51d39a06e1f0bf2e35a923a3210b21a2) - - - - - 2b5e41fe by Cheng Shao at 2026-11-17T14:16:25+01:00 rts: fix missing UNTAG in stg_control0zh_ll This patch fixes missing UNTAG on the cont closure returned by captureContinuationAndAbort. In case it's not NULL, captureContinuationAndAbort returns a tagged StgContinuation closure, in which case it must be untagged before accessing the apply_mask_frame field. In the past it worked out of luck: when apply_mask_frame was NULL then mask_frame_offset is also 0 so the control flow didn't diverge to a wrong path. Still, this is horribly wrong and will crash once StgContinuation struct is refactored and fields are shuffled around. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 8ed038421a20e3e4e681973b2f5098e5bd2144b5) - - - - - 26bdcf42 by Ben Gamari at 2026-11-17T14:30:53+01:00 base: Don't drop exception context in SomeException(toException) For reasons that are lost to time, the implementation of [CLC #200] that was merged inappropriately dropped `ExceptionContext` in the `toException` implementation given to `SomeException`. Fix this infelicity. [CLC #200]: https://github.com/haskell/core-libraries-committee/issues/200 (cherry picked from commit 2ab02c579a9625438f5281a258051cb32ba40004) - - - - - f6b78798 by Zubin Duggal at 2026-11-17T14:31:24+01:00 hadrian: Fix links to remaining doc sites to not use the package hash for haddock links In 07267f79d91169f474cacc8bcd38d76a6e97887d we changed hadrian to not include the package hash in the haddock directory. This patch takes care of a few remaining links that were missed in that patch Fixes #27671 (cherry picked from commit 1446bb039a635f2b836be19f062cbffa568fe4c5) - - - - - 06388d63 by Luite Stegeman at 2026-11-17T14:32:35+01:00 rts: Fix missing memory barrier in eval_thunk_selector (#27477) unchain_thunk_selectors() was missing an ACQUIRE_LOAD for the indirectee, leading to segfaults and corruption during GC on weakly-ordered architectures. Fixes #27477 (cherry picked from commit 06eee015be4e361fe9cb33e8a608ab2ea1386b52) - - - - - ca89b876 by Luite Stegeman at 2026-11-17T14:33:52+01:00 rts: initialise the stack frame header for mask_frame and apply_mask_frame We must leave the stack in consistent state before jumping to mask_frame or apply_mask_frame because they may result. Failing to do so could lead to a crash if there were waiting exceptions. Fixes #27651 (cherry picked from commit 5796aa637cca079854fc7e84e7e0fa497aacab3c) - - - - - 0b96a78c by Luite Stegeman at 2026-11-17T14:35:10+01:00 rts: make stg_threadLabelzh return a valid pointer for unlabeled threads. This fixes a segfault in the GC caused by stg_threadLabelzh returning a 0 pointer in a GC pointer field. stg_threadLabelzh returns a tuple of type (# Int#, ByteArray# #). If a thread has no label, the second field is unused. We must still return a valid heap object pointer. Instead of returning 0, we now return stg_DEAD_SLOT_closure. fixes #27618 (cherry picked from commit 809294f14cf6939b249d93af92c0ae174dda5b4a) - - - - - aac0ffd6 by Peng Fan at 2026-11-17T14:46:00+01:00 backport: add LoongArch NCG support for v9.10 Also bump ci-images and add cross build for CI. Make the behaviour of the autoconf scripts consistent on cross-buildding. (cherry picked from commit 9586998d09d6be7ca4478b344c7db04ecd512c03) - - - - - 5001046f by Luite Stegeman at 2026-11-17T14:47:31+01:00 rts: move stack check to the start of the stg_unpack_cstring thunks fixes a deadlock see #27272 (cherry picked from commit 9af64305adb72f31a68f10751956a8277f321568) - - - - - c519560e by Andreas Klebinger at 2026-11-30T17:12:59+01:00 fixup! RecordCon lookup: don't allow a TyCon - - - - - 3f99bfba by Andreas Klebinger at 2026-11-30T17:26:36+01:00 fixup! Take more care in zonkEqTypes on AppTy/AppTy - - - - - 1ea29905 by Andreas Klebinger at 2026-11-30T17:29:25+01:00 fixup! StgToByteCode: Don't assume that data con workers are nullary - - - - - 99 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/test-metrics.sh - + changelog.d/T27123.md - + changelog.d/T27455 - + changelog.d/caf-deadlock-27272 - + changelog.d/fix-cmm-atomic-load-store - + changelog.d/fix-control0-mask-trampoline - + changelog.d/fix-layout-stack-fcall - + changelog.d/fix-parallel-gc-selector-race-27477 - + changelog.d/fix-peekitbl-no-tntc - + changelog.d/fix-threadlabel-segfault-27618 - + changelog.d/jobserver-leak-fix - + changelog.d/semaphore-v2 - compiler/CodeGen.Platform.h - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/Dwarf/Constants.hs - + compiler/GHC/CmmToAsm/LA64.hs - + compiler/GHC/CmmToAsm/LA64/CodeGen.hs - + compiler/GHC/CmmToAsm/LA64/Cond.hs - + compiler/GHC/CmmToAsm/LA64/Instr.hs - + compiler/GHC/CmmToAsm/LA64/Ppr.hs - + compiler/GHC/CmmToAsm/LA64/RegInfo.hs - + compiler/GHC/CmmToAsm/LA64/Regs.hs - compiler/GHC/CmmToAsm/PIC.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/Linear/LA64.hs - compiler/GHC/CmmToAsm/Reg/Target.hs - compiler/GHC/Driver/Backend.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeSem.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Platform/LoongArch64.hs → compiler/GHC/Platform/LA64.hs - compiler/GHC/Platform/Regs.hs - compiler/GHC/StgToCmm/Bind.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Hint.hs - compiler/GHC/Types/Hint/Ppr.hs - compiler/ghc.cabal.in - docs/index.html.in - docs/users_guide/ghc_config.py.in - docs/users_guide/using-warnings.rst - docs/users_guide/using.rst - hadrian/bindist/config.mk.in - hadrian/src/Flavour.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Builders/RunTest.hs - libraries/base/changelog.md - libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc - libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc - + libraries/ghc-heap/tests/T27465.hs - + libraries/ghc-heap/tests/T27465.stdout - libraries/ghc-heap/tests/all.T - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs - libraries/semaphore-compat - m4/fptools_set_c_ld_flags.m4 - rts/Apply.cmm - rts/ContinuationOps.cmm - rts/Interpreter.c - rts/PrimOps.cmm - rts/StgMiscClosures.cmm - rts/StgStdThunks.cmm - rts/include/stg/MiscClosures.h - rts/sm/Evac.c - testsuite/tests/cmm/should_run/AtomicFetch.hs - testsuite/tests/cmm/should_run/AtomicFetch_cmm.cmm - + testsuite/tests/cmm/should_run/T27447.hs - + testsuite/tests/cmm/should_run/T27447.stdout - + testsuite/tests/cmm/should_run/T27447_cmm.cmm - testsuite/tests/cmm/should_run/all.T - testsuite/tests/diagnostic-codes/codes.stdout - + testsuite/tests/rts/T27123.hs - + testsuite/tests/rts/T27272.hs - + testsuite/tests/rts/T27272_gen.py - + testsuite/tests/rts/T27477.hs - + testsuite/tests/rts/T27477.stdout - + testsuite/tests/rts/T27618.hs - + testsuite/tests/rts/T27618.stdout - testsuite/tests/rts/all.T - + testsuite/tests/rts/continuations/T27651.hs - + testsuite/tests/rts/continuations/T27651.stdout - testsuite/tests/rts/continuations/all.T - testsuite/tests/typecheck/should_compile/all.T - testsuite/tests/typecheck/should_fail/all.T - utils/ghc-toolchain/exe/Main.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cc.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0017758b53a271451794c776f5e1d64... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0017758b53a271451794c776f5e1d64... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Andreas Klebinger (@AndreasK)