Skip to content

GHC Killed with out of memory when using generics #296

@jcristovao

Description

@jcristovao

Aeson 0.10 seems to somehow have changed the way it handles generics, and thus crashes ghc.

Cabal file:

name:                a
version:             0.1.0.0
build-type:          Simple
cabal-version:       >=1.10

library
  exposed-modules:     Test
  build-depends:       base >=4.8 && <4.9, aeson >=0.10 && <0.11, iso3166-country-codes
  hs-source-dirs:      src
  default-language:    Haskell2010

iso3166-country-codes is a very simple module with a datatype which lists all countries. It derives Generic.
https://hackage.haskell.org/package/iso3166-country-codes-0.20140203.7/docs/Data-ISO3166_CountryCodes.html

The source code (src/Test.hs):

  module Test
    (
    CountryCode(..)
  )where

  import Data.Aeson
  import Data.ISO3166_CountryCodes

  instance ToJSON CountryCode

Crashes GHC (Killed) - memory consumption raises up to 4GB before crashing.
This did not happen with previous versions of Aeson.

PS: I'm using ghc 7.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions