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,270
    • Issues 4,270
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 413
    • Merge Requests 413
  • 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
  • #3945

Closed
Open
Opened Mar 29, 2010 by basvandijk@trac-basvandijk

Bugs (with fixes) in withThread and runInUnboundThread

To quote my mail to the libraries list:

I discovered two similar bugs in Control.Concurrent:

  • In the function: 'runInUnboundThread' a thread is forked which first installs an exception handler before performing the given IO

computation. However it should first block asynchronous exceptions before forking the thread to ensure that the exception handler is always installed. In the attached patch I use the 'blockedApply' function which also ensures that the forked IO computation has the same blocked state as its parent thread.

  • There's a similar problem in the internal withThread function (which AFAICS is only called in threadWaitRead). withThead also forgets to properly block asynchronous exceptions before forking a thread which needs to install an exception handler. In this case I didn't use blockedApply but only used block because withThread is only called with 'waitFd' which only performs an FFI call which can't receive asynchronous exceptions anyway.
Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
6.12.3
Milestone
6.12.3
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#3945