Michael Snoyman | 21 Jun 10:39
Favicon
Gravatar

MonadCatchIO-transformers and ContT

Hi cafe,

I ran into a segfault while working on some database code. I eventually traced it back to a double-finalizing of a statement (read: freeing memory twice), which ultimately led back to switching my code to use the ContT monad transformer. I was able to isolate this down to a minimal test case (catch.hs); when run, it prints the line "released" twice.

In an attempt to understand what's going on, I rewrote the code to avoid the libraries entirely (catch-simplified.hs); it didn't give me any insight into the problem, but maybe it will help someone else.

If someone sees an obvious mistake I'm making in my usage of the bracket_ function, please let me know. Otherwise, I'd really like to get a fix for this so I can use this library.

Thanks,
Michael
Attachment (catch.hs): text/x-haskell, 431 bytes
Attachment (catch-simplified.hs): text/x-haskell, 1106 bytes
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane