Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,312
    • Issues 4,312
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 385
    • Merge Requests 385
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2155

Closed
Open
Opened Mar 13, 2008 by dfranke@trac-dfranke

More deadlock issues with concurrent I/O

The following hangs on the current ghc-STABLE snapshot, and shouldn't.

module Main where

import Control.Concurrent
import qualified Data.ByteString.Lazy.Char8 as B
import System.IO
import System.Process

launch :: B.ByteString -> IO B.ByteString
launch i = do (hin,hout,herr,ph) <- runInteractiveProcess "cat" [] Nothing Nothing
              -- forkIO $ collect ph  -- This doesn't seem to be relevant to the problem.
              forkIO $ do B.hPut hin i
                          hClose hin
              B.hGetContents hout

collect :: ProcessHandle -> IO ()
collect ph = do waitForProcess ph
                return ()

main :: IO ()
main = let i = B.pack "foo" in
       do o <- foldl (>>=) (return i) (take 5 (repeat launch))
          B.putStrLn o

See also #1936 (closed).

Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
6.8.3
Milestone
6.8.3
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#2155