[Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

Edward Z. Yang ezyang at MIT.EDU
Wed Oct 20 13:39:03 EDT 2010

Excerpts from Johannes Waldmann's message of Wed Oct 20 05:13:36 -0400 2010:
> and indeed, gethostbyname is famous for being non re-entrant.

If you have the time, this would be a great time to improve the multithreaded
support of these libraries.  In particular, glibc offers a re-entrant version
gethostbyname_r, so at least for some POSIX systems network could be switched
to using that.  If all else fails, perhaps manually synchronize over an MVar
and hope no one else imports the FFI.

If you don't have the time, if you can identify where gethostbyname is
getting called from, hopefully you can manually synchronize those sections
of the program.


More information about the Haskell-Cafe mailing list