[Git][ghc/ghc][wip/sjakobi/T27534] testsuite: Fix T17088 flakiness and restore bug coverage
Simon Jakobi pushed to branch wip/sjakobi/T27534 at Glasgow Haskell Compiler / GHC Commits: 2e31845d by Simon Jakobi at 2026-07-22T17:25:04+02:00 testsuite: Fix T17088 flakiness and restore bug coverage T17088 reads and prints a byte from an uninitialized array. Debug RTS ways fill allocated memory with 0xaa, so the test can fail due to an output mismatch unrelated to the pointer-tagging bug it covers. Initialize the byte to zero to make the output deterministic. The original bug requires the compacting collector and particular compiler and RTS settings. Run the test only in the compacting_gc way with -O1 and -A128k. Also disable STG lambda lifting because it removes the closure shape needed to reproduce the pointer-tagging failure. This makes the test reliable while ensuring it remains an effective reproducer for #17088. Closes #27534. Assisted-by: gpt-5.6-sol via Codex CLI - - - - - 2 changed files: - testsuite/tests/rts/T17088.hs - testsuite/tests/rts/all.T Changes: ===================================== testsuite/tests/rts/T17088.hs ===================================== @@ -2,6 +2,9 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} +-- Lambda lifting removes the closure shape needed to reproduce #17088. +{-# OPTIONS_GHC -fno-stg-lift-lams #-} + module Main (main) where import Data.Word @@ -27,7 +30,9 @@ instance Show Bytes where bytesAllocRet :: Int -> IO Bytes bytesAllocRet (I# sz) = IO $ \s -> case newAlignedPinnedByteArray# sz 8# s of - (# s', mba #) -> (# s', Bytes mba #) + (# s', mba #) -> + case writeWord8Array# mba 0# (wordToWord8# 0##) s' of + s'' -> (# s'', Bytes mba #) ------------------------------------------------------------------------ ===================================== testsuite/tests/rts/all.T ===================================== @@ -540,8 +540,11 @@ test('RestartEventLogging', compile_and_run, ['RestartEventLogging_c.c']) test('T17088', - [extra_ways(['compacting_gc']), extra_run_opts('+RTS -A256k -RTS')], - compile_and_run, ['-rtsopts -O2']) + [ only_ways(['compacting_gc']) + , extra_ways(['compacting_gc']) + , extra_run_opts('+RTS -A128k -RTS') + ], + compile_and_run, ['-rtsopts -O1']) test('T15427', js_broken(22374), compile_and_run, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e31845de0c7db63506b70ad86045938... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e31845de0c7db63506b70ad86045938... 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)
-
Simon Jakobi (@sjakobi2)