[GHC] #10673: GHCi crashes when decoding with Aeson

#10673: GHCi crashes when decoding with Aeson -----------------------------------------+------------------------------- Reporter: orion | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.3 Keywords: | Operating System: FreeBSD Architecture: x86_64 (amd64) | Type of failure: GHCi crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -----------------------------------------+------------------------------- {{{ $ 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) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10673 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10673: GHCi crashes when decoding with Aeson -------------------------------+----------------------------------------- Reporter: orion | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.8.3 Resolution: wontfix | Keywords: Operating System: FreeBSD | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------+----------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => wontfix Comment: Well, I actually tried to reproduce this using the exact versions of all those packages, but aeson-0.7.0.6 has a lower bound attoparsec >= 0.11.3.4, so I don't know how you got into this situation. If you can give steps to reproduce this crash on 7.10 and with a consistent set of packages, that would be extremely interesting (and unexpected). Otherwise, closing as wontfix since this is an old version of ghc and there seems to be something fishy about the set of packages you have installed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10673#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10673: GHCi crashes when decoding with Aeson -------------------------------+----------------------------------------- Reporter: orion | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.8.3 Resolution: wontfix | Keywords: Operating System: FreeBSD | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------+----------------------------------------- Comment (by orion): The library version issue seems to be related to FreeBSD's package management: http://www.freebsd.org/cgi/ports.cgi?query=aeson&stype=all -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10673#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10673: GHCi crashes when decoding with Aeson -------------------------------+----------------------------------------- Reporter: orion | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.8.3 Resolution: wontfix | Keywords: Operating System: FreeBSD | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------+----------------------------------------- Comment (by rwbarton): I see. There are two patches to aeson there, one to relax the version bound on attoparsec and one to add whatever functionality is missing in the old version. I tried building all these versions together with these patches applied (on a Linux machine) and they built successfully and unsurprisingly did not segfault when I tried your example. I didn't check whether any other packages among these had patches in ports. I wonder if the segfault would go away if you just rebuilt all the libraries... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10673#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC