Skip to content

Instantly share code, notes, and snippets.

@jhartikainen
Created September 26, 2012 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhartikainen/3786838 to your computer and use it in GitHub Desktop.
Save jhartikainen/3786838 to your computer and use it in GitHub Desktop.
Segfault on Ubuntu 12.04 GHC 7.4.1
{-# LANGUAGE BangPatterns #-}
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import Data.PEM (PEM(..), pemParseBS)
import Data.Certificate.X509
import Data.Either
main :: IO ()
main = do
certdata <- B.readFile "7d0b38bd.0"
let certPem = pemParseBS certdata
case certPem of
Right pem -> do
-- decodeCertificate will segfault on Ubuntu 12.04 / GHC 7.4.1
let !c = decodeCertificate $ L.fromChunks [pemContent (pem !! 0)]
putStrLn "read all certs"
_ -> error "nothing"
return ()
@jhartikainen
Copy link
Author

You can find the required certificate file on Ubuntu in /etc/ssl/certs, or at the following URL: http://jjh.fi/~jani/7d0b38bd.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment