Andrea Vezzosi pushed to branch wip/romes/async-rpc at Glasgow Haskell Compiler / GHC Commits: a19c8feb by Rodrigo Mesquita at 2026-11-11T21:44:21+01:00 test: make T3171 not fragile and add version for ext interp too - actually test the sleep of the user-given expression gets interrupted - the ext interp version tests two things: - Requests can be cancelled without terminating the ext interp (#18852) - The stmt being evaluated gets interrupted in the ext interp (that is, ^C gets sent to the thread running the user-given expression and doesn't affect the ext interp main thread) - testing ext interp requires sending ^C to whole process group Fixes #15383 - - - - - b8dbe6df by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 interp: cancel requests if async exceptions while waiting for reply. - - - - - 275f95ac by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 interp: do not terminate ext. interp. process on exception `sendMessage` throwing an exception does not warrant terminating the external interpreter process anymore, because communication can keep going no matter what. `stopInterp` now resets the whole `Interp` state, so that a new ExtInterpInstance can be later created and work correctly. `withExtInterp` now calls `stopInterp` on a `PipeClosedException` and rethrows. Fixes #18852 - - - - - 35f4d9b2 by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 remoteAsyncReq cleans up a pendingReply on exception. - - - - - 1ad99faa by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 remoteAsyncReq: send cancel if exception during writePipe fixes gap in exception coverage. - - - - - 13241878 by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 interp: single-threaded sendTHComputation - - - - - 6c668169 by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 interp: test: no deadlock when handleTHMessage throws. it used to be that handleTHMessage throwing would neglect to notify and/or tear down the external interpreter, causing it to deadlock (or fail with blocked indefinitely). Now we reply with the exception, before rethrowing it, so the external interpreter can shutdown cleanly. - - - - - 838dd98e by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 interp: test: panic in handleTHMessage does not deadlock similar to TH_ReifyModuleFail but with a plugin. - - - - - 157fb8d0 by Andrea Vezzosi at 2026-11-11T21:44:21+01:00 interp: cleanup on cancel interp: don't drop pending frees if the drain is interrupted interp: release RemoteRefs and RemotePtrs from replies of canceled requests - - - - - ca669ee9 by Andrea Vezzosi at 2026-11-11T21:44:22+01:00 interp: mask while handling RemoteRefs in dynLinkCompiledByteCode Between 'createBCOs' and 'makeForeignNamedHValueRefs' the refs are not tracked, so could have been leaked if interrupted. Modified 'makeForeignNamedHValueRefs' so it does not have interruption points when the interpreter is running. - - - - - f99bff86 by Andrea Vezzosi at 2026-11-11T21:44:22+01:00 interp: return ForeignRef rather than RemoteRef whenever possible. and more generally masking until a finalizer is attached. Anything to do with EvalStatus_ is not fixed here, as it would require larger changes to the API. - - - - - e349ac81 by Andrea Vezzosi at 2026-11-11T21:44:22+01:00 linker: purge the symbol cache before unloading Unloading might throw at which point it's uncertain which symbols are still loaded, purging the symbol cache upfront means we don't risk holding a reference to an unloaded symbol.. See Note [LoaderState may lag the interpreter]. - - - - - 96197f5d by Andrea Vezzosi at 2026-11-11T21:44:22+01:00 interp: add finalizer to ModFinalizer under mask - - - - - 052a8f27 by Andrea Vezzosi at 2026-11-11T21:44:22+01:00 ghci: fixed 'freeForeignCallInfo' to properly free 'arg_types' array. freeForeignCallInfo used to free the 'p->arg_types' field itself, rather than the array it points to. Now reads the pointer stored at 'p->arg_types', frees that, then frees 'p'. - - - - - cdc27d98 by Andrea Vezzosi at 2026-11-11T21:44:22+01:00 interp: test resources are cleaned up when request interrupted. - - - - - 40f6c4f7 by Andrea Vezzosi at 2026-11-12T15:43:12+01:00 interp: exit cleanly if pipe closed while replying to Shutdown. iserv avoids reporting exceptions coming from pipe operations after we received Shutdown: writing a reply after the host closed its end because the grace period elapsed shouldn't look like a bug. We do so by indicating the pipe is closing right after we receive Shutdown, so both the main loop and any running handler threads can tell a closed pipe is expected. - - - - - 26fe9cf8 by Andrea Vezzosi at 2026-11-12T15:43:12+01:00 template-haskell: force arguments of Q primitives up front. Exceptions in arguments of 'Quote Q' and 'Quasi Q' were not detected until the last minute, where they could cause panics or cause implementation details to leak into error messages. Now they are 'deepseq'eq up front, types permitting, so any exceptions are cleanly reported as originating from the splice. Follow up to 'Follow `Note [Exceptions in TH]` in `qReport` implementation' which already handled the `qReport` case. Fixes #28112 - - - - - 65 changed files: - compiler/GHC/Driver/Main/Passes.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Process.hs - compiler/GHC/Runtime/Interpreter/Types.hs - compiler/GHC/Tc/Gen/Splice.hs - libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs - libraries/ghci/GHCi/FFI.hsc - libraries/ghci/GHCi/Message.hs - libraries/ghci/GHCi/Message/Async.hs - libraries/ghci/GHCi/Run.hs - libraries/ghci/GHCi/Server.hs - libraries/ghci/GHCi/Server/Threads.hs - libraries/ghci/GHCi/TH.hs - libraries/template-haskell/Language/Haskell/TH/Syntax.hs - libraries/template-haskell/template-haskell.cabal.in - testsuite/tests/ghci/custom-external-interpreter-commands/Main.hs - + testsuite/tests/ghci/interp-cancellation/Main.hs - + testsuite/tests/ghci/interp-cancellation/all.T - + testsuite/tests/ghci/interp-cancellation/interp-cancellation.stdout - testsuite/tests/ghci/should_run/Makefile - testsuite/tests/ghci/should_run/T3171.stdout - + testsuite/tests/ghci/should_run/T3171ext.stdout - testsuite/tests/ghci/should_run/all.T - testsuite/tests/interface-stability/template-haskell-exports.stdout - testsuite/tests/plugins/all.T - testsuite/tests/plugins/plugins10.stdout - + testsuite/tests/plugins/static-plugin-interp-panic-module.hs - + testsuite/tests/plugins/static-plugin-interp-panic.hs - + testsuite/tests/plugins/static-plugin-interp-panic.stderr - + testsuite/tests/plugins/static-plugin-interp-panic.stdout - + testsuite/tests/th/T8987c.hs - + testsuite/tests/th/T8987c.stderr - + testsuite/tests/th/T8987d.hs - + testsuite/tests/th/T8987d0.hs - + testsuite/tests/th/T8987d0.stderr - + testsuite/tests/th/T8987d1.hs - + testsuite/tests/th/T8987d1.stderr - + testsuite/tests/th/T8987d10.hs - + testsuite/tests/th/T8987d10.stderr - + testsuite/tests/th/T8987d11.hs - + testsuite/tests/th/T8987d11.stderr - + testsuite/tests/th/T8987d12.hs - + testsuite/tests/th/T8987d12.stderr - + testsuite/tests/th/T8987d13.hs - + testsuite/tests/th/T8987d13.stderr - + testsuite/tests/th/T8987d2.hs - + testsuite/tests/th/T8987d2.stderr - + testsuite/tests/th/T8987d3.hs - + testsuite/tests/th/T8987d3.stderr - + testsuite/tests/th/T8987d4.hs - + testsuite/tests/th/T8987d4.stderr - + testsuite/tests/th/T8987d5.hs - + testsuite/tests/th/T8987d5.stderr - + testsuite/tests/th/T8987d6.hs - + testsuite/tests/th/T8987d6.stderr - + testsuite/tests/th/T8987d7.hs - + testsuite/tests/th/T8987d7.stderr - + testsuite/tests/th/T8987d8.hs - + testsuite/tests/th/T8987d8.stderr - + testsuite/tests/th/T8987d9.hs - + testsuite/tests/th/T8987d9.stderr - + testsuite/tests/th/TH_ReifyModuleFail.hs - + testsuite/tests/th/TH_ReifyModuleFail.stderr - testsuite/tests/th/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0e0ba3334e2de0716899e5ca65c6c94... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0e0ba3334e2de0716899e5ca65c6c94... 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)
-
Andrea Vezzosi (@trac-Saizan)