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

Bas van Dijk v.dijk.bas at gmail.com
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
correctly.

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

  https://github.com/basvandijk/darwin-cxx-exception-bug

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?

Bas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190104/33febb6f/attachment.html>


More information about the ghc-devs mailing list