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,319
    • Issues 4,319
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 367
    • Merge Requests 367
  • 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
  • #578

Closed
Open
Opened Aug 18, 2001 by apfeffer@trac-apfeffer

fromDynamic crashes ghci

Loading the following code into ghci and evaluating x
causes a segmentation fault:

data Foo a = Foo a

instance Typeable (Foo a) where
  typeOf x = mkAppTy (mkTyCon "BAD") []

x :: Maybe (Foo Char)
x = fromDynamic (toDyn (Foo "abc"))

This is not a problem for ghc.

The version of ghci is 5.00.2

I'm running on linux, not sure what vintage I'm afraid.

By the way, the reason I wrote this code was because I
was trying to figure out what role the type string
plays in the Dynamic library.  The documentation seems
to indicate that it is checked for equality every time
fromDyn or fromDynamic is called, but that doesn't seem
to be the case.  More documentation on what the string
does, and how to construct it correctly, would be
appreciated.  I was trying to figure out if I could
make this type Typeable:

data Name a = String




Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component None
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#578