Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,255
    • Issues 5,255
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 562
    • Merge requests 562
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7299
Closed
Open
Issue created Oct 05, 2012 by Trevor L. McDonell@tmcdonellReporter

threadDelay broken in ghci, Mac OS X

Control.Concurrent.threadDelay fails in ghci on Mac OS X. Behaviour is correct in compiled code. To reproduce, it is enough to just execute threadDelay at the prompt.

Depending on the architecture, I get different behaviour:

  • i386: 7.6.1 and 7.7.20121003: segmentation fault (11)
  • x86_64: 7.6.1 and 7.7.20121003: executes without segfault, but there is no actual delay.

This is on Mac OS X 10.7.5 and 10.8.2.

Correct behaviour for ghci-7.6.1-x86_64 on Ubuntu 12.04. Also fine on Mac in the 7.4 series.

Example output:

Nightfall $ ghci
GHCi, version 7.6.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.

Prelude > Foreign.Storable.sizeOf (undefined :: Int)
4

Prelude > Control.Concurrent.threadDelay (1000 * 1000)
Segmentation fault: 11

Sample program for the second case:

import Control.Concurrent

count :: Int -> IO ()
count n
  | n <= 0      = return ()
  | otherwise   = do
      putStrLn $ shows n "-ah-ha-ha"
      threadDelay (1000 * 1000) -- 1 second
      count (n-1)

main :: IO ()
main = count 10
Trac metadata
Trac field Value
Version 7.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking