Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#8377 closed bug (fixed)

GHCi crashes with unboxed values on 32-bit platforms

Reported by: akio Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.7
Keywords: Cc: hvr
Operating System: Unknown/Multiple Architecture: x86
Type of failure: GHCi crash Difficulty: Unknown
Test Case: ghci/should_run/T8377 Blocked By:
Blocking: Related Tickets:

Description

The following program causes GHCi to crash, on x86 Linux and x86 Windows.

{-# LANGUAGE MagicHash #-}
import System.Mem
import GHC.Base

main = do
  let list = concatMap buildThunk [0..10000]
  length list `seq` performGC
  print $ last list

buildThunk :: Int -> [Int]
buildThunk (I# k) = [f k]

f :: Int# -> Int
f x = I# x

Attachments (2)

0001-Fix-BCO-bitmap-generation-on-32-bit-platforms-8377.patch (4.3 KB) - added by akio 7 months ago.
0001-Test-Trac-8377.patch (1.5 KB) - added by akio 7 months ago.
patch to the test suite

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 months ago by akio

I'm preparing a patch.

Changed 7 months ago by akio

patch to the test suite

comment:2 Changed 7 months ago by akio

  • Status changed from new to patch

The patch validates on x86 Linux. The testsuite patch may not be needed because some existing tests also seem to catch the error (T1288_ghci dynbrk009 print020 ghcilink002 ghcilink004 ghcilink005).

comment:3 Changed 7 months ago by Austin Seipp <austin@…>

In 3bd786147fc9eff8d03ec9ac2697ada826282b08/ghc:

Fix BCO bitmap generation on 32-bit platforms (#8377)

On 32-bit platforms, the bitmap should be an array of
32-bit words, not Word64s.

Signed-off-by: Austin Seipp <austin@well-typed.com>

comment:4 Changed 7 months ago by Austin Seipp <austin@…>

In b499ed1ea71f58c02d5b71e147b938ca0b96f8a1/testsuite:

Test Trac #8377

Signed-off-by: Austin Seipp <austin@well-typed.com>

comment:5 Changed 7 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from patch to closed
  • Test Case set to ghci/should_run/T8377

Merged (with a test - too many can't hurt) - thanks!

comment:6 Changed 7 months ago by simonmar

Good catch. This must have broke when StgWord was changed to be Word64.

Note: See TracTickets for help on using tickets.