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,383
    • Issues 4,383
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 373
    • Merge Requests 373
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18229

Closed
Open
Opened May 25, 2020 by Ben Gamari@bgamari🐢Maintainer

GHC API users can easily hit bottoming BreakArray

Recently I encountered a GHC crash exposed by ghcide, which loads modules via the GHC API and calls the desugarer with hscTarget == HscNothing. In this case the Coverage.addTicksToBinds can return emptyModBreaks, which contains a bottom, as the module's ModBreaks. Eventually if the client then calls the bytecode generator and tries to load the bytecode that results (e.g. due to the need to evaluate a Template Haskell splice) it will hit this bottom and crash.

In the case that hscTarget is HscNothing we really shouldn't even be returning any ModBreaks (N.B. this is possible as mg_modbreaks is a Maybe ModBreaks). This would avoid this entire failure mode.

See also: https://github.com/digital-asset/ghcide/issues/537

Edited May 25, 2020 by Ben Gamari
Assignee
Assign to
8.8.4
Milestone
8.8.4 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18229