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,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • 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
  • #13102
Closed
Open
Issue created Jan 10, 2017 by rwbarton@trac-rwbarton

orphan family instances can leak through the EPS in --make mode

In --make mode there is a single EPS whose eps_fam_inst_env holds all type family instances that have been read from interface files from external packages for any reason. The type checker uses this field pervasively via tcGetFamInstEnvs.

When compiling multiple files it's fairly easy to set up a situation in which

  1. the first module to be compiled A loads an interface file O.hi from another package containing an orphan family instance (say, because it imports the module directly);
  2. a later module B uses this instance to reduce a type, even though B has no dependency at all on the module O defining the instance.

(The only tricky bit in arranging this is that since B cannot depend on A, a little good fortune is needed for GHC to decide to compile B after A.)

Now another module could import B and obtain a function whose definition relies on a type family instance that is not visible from B at all, compromising type safety.

Trac metadata
Trac field Value
Version 8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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