Failure to catch C++ exception in Haskell on OS X

Bas van Dijk v.dijk.bas at
Fri Jan 4 00:22:34 UTC 2019

Dear GHC Devs,

I'm debugging an issue in our haskell-opencv library where a C++ exception
that is thrown by the OpenCV C++ library isn't caught by the C++
try...catch block we have inlined in our Haskell code using inline-c-cpp.
This results in the process terminating by SIGABRT.

Note that this only happens on OS X. In Linux the exception is caught

I wrote a minimal isolated test case (which doesn't use OpenCV) at:

I wrote some instructions in the README on how to reproduce this and
included some debugging notes.

I'm not sure the bug is caused by a mis-configuration in my code or if it's
a bug in nixpkgs, Cabal or GHC. Any idea what could be causing this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list