Skip to content

GitLab

  • Menu
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 4,869
    • Issues 4,869
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • 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 Compiler
  • GHCGHC
  • Issues
  • #19452
Closed
Open
Created Feb 27, 2021 by Andreas Abel@abel

panic: `Prelude.chr: bad argument` in GHC < 8.10 when stale interface is present

Summary

With .hi and .o left over from compilation with GHC-9.0.1, older GHC versions panic, e.g.:

$ ghc-8.8.4 AbsTest.hs
ghc: panic! (the 'impossible' happened)
  (GHC version 8.8.4 for x86_64-apple-darwin):
	Prelude.chr: bad argument: 4043309068

I tested 7.6 - 8.8.

Steps to reproduce

I can reproduce the issue with this script:

# Generate *.o *.hi that trip up older GHCs
ghc-9.0.1 Test.hs

# Produce panics in older GHCs
ghc-7.6.3 Test.hs
ghc-7.8.4 Test.hs
ghc-7.10.3 Test.hs
ghc-8.0.2 Test.hs
ghc-8.2.2 Test.hs
ghc-8.4.4 Test.hs
ghc-8.6.4 Test.hs
ghc-8.8.4 Test.hs

# From 8.10, this seems fixed
ghc-8.10.4 Test.hs
ghc-9.0.1 Test.hs

The source file Test.hs is an empty module:

module Test where

Expected behavior

What do you expect the reproducer described above to do?

No panic, but ignore stale products and recompile.

Environment

  • GHC version used: 7.6 - 8.8
  • Operating System: macOS

Related issues

  • #18228 (closed)
  • #18724 ?
  • #3435 (closed)
Edited Feb 27, 2021 by Andreas Abel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking