Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HsOpenSSL segfaults on OS X

I'm trying to give HsOpenSSL a whirl on Mac OS X, and it's blowing up in my face.

The latest Hackage version (HsOpenSSL-0.10.3.3) builds and imports, but doing anything with it kills my GHCi (both 7.6.3 and 7.4.2):

ghci> import OpenSSL
ghci> withOpenSSL $ do undefined
$ # Now I'm looking at a shell prompt

I put together an executable and built it with GHC, and voilà, a segfault:

$ ./test
Segmentation fault: 11

I'm using the version of OpenSSL that comes with OS X 10.8:

$ openssl version
OpenSSL 0.9.8r 8 Feb 2011

(I've also now installed the latest version of OpenSSL, v1.0.1e, and built HsOpenSSL against it. Again it builds and imports fine, but segfaults on any call out to OpenSSL.)

This is likely a problem with OpenSSL, or with some idiosyncrasy of using OS X rather than Linux, but my installation does work fine with Python's OpenSSL library. ...

Can anyone replicate this, or give me any debugging tips?

like image 855
pash Avatar asked Nov 03 '22 21:11

pash


1 Answers

I'm afraid I have another negative report - it works here for me, on OS X. Hypothetically, I might be using a version that I might not be allowed to mention, though, so that could be the difference...

module Main (main) where

import OpenSSL


main :: IO ()
main = withOpenSSL $ do
  putStrLn "Hm."

Then I can run it with:

$ ghc Crash.hs
... [it compiles] ...
$ ./Crash
Hm.

And it succeeds. I'm using GHC 7.6.3, HsOpenSSL 0.10.3.3, and OpenSSL 0.9.8y, this last dated 5 Feb 2013.

like image 168
Irene Knapp Avatar answered Nov 08 '22 05:11

Irene Knapp