Any way to catch runtime errors in a DLL?

Lennart Augustsson lennart at augustsson.net
Thu Jun 15 20:02:04 EDT 2006


Exceptions generated from Haskell you can catch, but the really
bad ones are those that the runtime system itself generates
(when something really bad happens, like a failed malloc).

I have a set of patches that fixes those, so you can actually write
safe DLLs.  One of these days I'll file a bug report with them. :)

	-- Lennart

Michael Marte wrote:
> Hello *,
> 
> if a runtime error occurs inside a DLL compiled by ghc (like 
> "irrefutable pattern match failed" or exceptions caused by error),
> the application that called the DLL function dies. This is ok for 
> development but unacceptable when it happens with a user sitting in 
> front of the display. (It has not yet happened but it's only a question 
> of time.)
> 
> So my question is: Is there any way to catch and process runtime errors? 
> I am looking for some way to map those errors to exceptions on the C++ 
> side that can be caught if required. It would be ok to kill the Haskell 
> runtime system and unload the DLL if necessary.
> 
> Michael
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> 



More information about the Glasgow-haskell-users mailing list