[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: ci: Try using multi repl in ghc-in-ghci test
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: d5d940b3 by Matthew Pickering at 2025-12-07T03:58:31-05:00 ci: Try using multi repl in ghc-in-ghci test This should be quite a bit faster than the ./hadrian/ghci command as it doesn't properly build all the dependencies. - - - - - f6cbfed3 by Rodrigo Mesquita at 2025-12-07T03:58:32-05:00 Stack.Decode: Don't error on bitmap size 0 A RET_BCO may have a bitmap with no payload. In that case, the bitmap = 0. One can observe this by using -ddump-bcos and interpreting ``` main = pure () ``` Observe, for instance, that the BCO for this main function has size 0: ``` ProtoBCO Main.main#0: \u [] break<main:Main,0>() GHC.Internal.Base.pure GHC.Internal.Base.$fApplicativeIO GHC.Internal.Tuple.() bitmap: 0 [] BRK_FUN <breakarray> main:Main 0 <cc> PACK () 0 PUSH_G GHC.Internal.Base.$fApplicativeIO PUSH_APPLY_PP PUSH_G GHC.Internal.Base.pure ENTER ``` Perhaps we never tried to decode a stack in which a BCO like this was present. However, for the debugger, we want to decode stacks of threads stopped at breakpoints, and these kind of BCOs do get on a stack under e.g. `stg_apply_interp_info` frames. See the accompanying test in the next commit for an example to trigger the bug this commit fixes. Fixes #26640 - - - - - d844061d by Rodrigo Mesquita at 2025-12-07T03:58:32-05:00 Add test for #26640 - - - - - 6 changed files: - .gitlab-ci.yml - libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs - + testsuite/tests/bytecode/T26640.hs - + testsuite/tests/bytecode/T26640.script - + testsuite/tests/bytecode/T26640.stdout - testsuite/tests/bytecode/all.T Changes: ===================================== .gitlab-ci.yml ===================================== @@ -416,7 +416,7 @@ hadrian-ghc-in-ghci: # workaround for docker permissions - sudo chown ghc:ghc -R . variables: - GHC_FLAGS: -Werror + GHC_FLAGS: -Werror -Wwarn=unused-imports tags: - x86_64-linux script: @@ -428,7 +428,7 @@ hadrian-ghc-in-ghci: - "echo ' ghc-options: -Werror' >> hadrian/cabal.project.local" # Load ghc-in-ghci then immediately exit and check the modules loaded - export CORES="$(mk/detect-cpu-count.sh)" - - echo ":q" | HADRIAN_ARGS=-j$CORES hadrian/ghci -j$CORES | tail -n2 | grep "Ok," + - echo ":q" | HADRIAN_ARGS=-j$CORES hadrian/ghci-multi -j$CORES | tail -n2 | grep "Ok," after_script: - .gitlab/ci.sh save_cache - cat ci_timings.txt ===================================== libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs ===================================== @@ -269,7 +269,7 @@ decodeLargeBitmap getterFun# stackSnapshot# index relativePayloadOffset = do cWordArrayToList ptr size = mapM (peekElemOff ptr) [0 .. (size - 1)] usedBitmapWords :: Int -> Int - usedBitmapWords 0 = error "Invalid large bitmap size 0." + usedBitmapWords 0 = 0 usedBitmapWords size = (size `div` fromIntegral wORD_SIZE_IN_BITS) + 1 bitmapWordsPointerness :: Word -> [Word] -> [Pointerness] ===================================== testsuite/tests/bytecode/T26640.hs ===================================== @@ -0,0 +1,4 @@ +-- Main.hs +module Main where +main = pure () + ===================================== testsuite/tests/bytecode/T26640.script ===================================== @@ -0,0 +1,6 @@ +:l T26640 +:break 3 +main +import GHC.Conc +import GHC.Stack.CloneStack +() <- mapM_ (\ix -> do !_ <- decode =<< cloneThreadStack ix; return ()) =<< listThreads ===================================== testsuite/tests/bytecode/T26640.stdout ===================================== @@ -0,0 +1,3 @@ +Breakpoint 0 activated at T26640.hs:3:8-14 +Stopped in Main.main, T26640.hs:3:8-14 +_result :: IO () = _ ===================================== testsuite/tests/bytecode/all.T ===================================== @@ -8,6 +8,7 @@ test('T25975', extra_ways(ghci_ways), compile_and_run, test('T26565', extra_files(["T26565.hs"]), ghci_script, ['T26565.script']) test('T23973', extra_files(["T23973.hs"]), ghci_script, ['T23973.script']) +test('T26640', extra_files(["T26640.hs"]), ghci_script, ['T26640.script']) # Nullary data constructors test('T26216', extra_files(["T26216_aux.hs"]), ghci_script, ['T26216.script']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9e337061f82ce0c564b1ca48fd3e44b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9e337061f82ce0c564b1ca48fd3e44b... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)