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,260
    • Issues 4,260
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 398
    • Merge Requests 398
  • 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
  • #16076

Closed
Open
Opened Dec 20, 2018 by radekchannable@trac-radekchannable

Internal compiler error when instance uses FFI function and defining other instance of the same class through Template Haskell

When one module defines an FFI function and uses it in an instance, and a Template Haskell function to derive an instance of the same class, using the function in another module causes GHC to crash, complaining it cannot find the FFI function.

See the attached modules for an example. Use the following command to trigger the bug (ensure template-haskell is available):

$ ghc Bar.hs
[1 of 2] Compiling Foo              ( Foo.hs, Foo.o )
[2 of 2] Compiling Bar              ( Bar.hs, Bar.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.4.4 for x86_64-unknown-linux):
	Loading temp shared object failed: /tmp/ghc13955_0/libghc_6.so: undefined symbol: showFoo

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field Value
Version 8.4.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#16076