Skip to content

GHCi crashes when decoding with Aeson

$ ghci
GHCi, version 7.8.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :set -XOverloadedStrings
Prelude> let r = "{\"took\":1,\"timed_out\":false,\"_shards\":{\"total\":5,\"successful\":5,\"failed\":0},\"hits\":{\"total\":7,\"max_score\":1.0,\"hits\":[{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"2725954419\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150722T053908+0000\"]}},{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"9580897143\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150716T205624+0000\"]}},{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"3511215163\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150701T024616+0000\"]}},{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"22006\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150723T040619+0000\"]}},{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"4240142128\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150713T222827+0000\"]}},{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"1258498\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150722T134305+0000\"]}},{\"_index\":\"foo\",\"_type\":\"group\",\"_id\":\"1675836265\",\"_score\":1.0,\"fields\":{\"updated\":[\"20150720T222152+0000\"]}}]}}"
Prelude> import Data.Aeson
Prelude Data.Aeson> decode r :: Maybe Object
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package text-1.1.0.0 ... linking ... done.
Loading package attoparsec-0.10.4.0 ... linking ... done.
Loading package hashable-1.2.2.0 ... linking ... done.
Loading package unordered-containers-0.2.4.0 ... linking ... done.
Loading package primitive-0.5.2.1 ... linking ... done.
Loading package vector-0.10.9.1 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package dlist-0.7.1 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package scientific-0.3.3.0 ... linking ... done.
Loading package syb-0.4.1 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package aeson-0.7.0.6 ... linking ... done.
Just fromList [("took",Number 1.0),("_shards",Object fromList [("successful",Number 5.0),("total",Number 5.0),("failed",Number 0.0)]),("timed_out",Bool False),("hits",Object fromList [("max_score",Number 1.0),("total",Number 7.0),("hits",Array (fromList [Object fromList [("_type",String "group"),("_score",Number 1.0),("_id",String "2725954419"),("_index",String "foo"),("fields",Object fromList [("updated",Array (fromList [String "20150722T053908+0000"]))])],Object fromList [("_type",String "group"),("_score",Number 1.0),("_id",String "9580897143"),("_index",String "foo"),("fields",Object fromList [("updated",Array (fromList [String "20150716T205624+0000"]))])],Object fromList [("_type",String "group"),("_score",Number 1.0),("_id",String "3511215163"),("_index",String "foo"),("fields",Object fromList [("updated",Array (fromList [String "20150701T024616+0000"]))])],Object fromList [("_type",String "group"),("_score",Number 1.0),("_id",String "22006"),("_index",String "foo"),("fields",Object fromList [("updated",Array (fromList [String "20150723T040619+0000"]))])],Object fromList [("_type",String "group"),("_score",Number 1.0),("_id",String "4240142128"),("_index",String "foo"),Segmentation fault (core dumped)
Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information