opensubscriber
   Find in this group all groups
 
Unknown more information…

g : glasgow-haskell-users@haskell.org 30 July 2012 • 11:00PM -0400

Re: thread blocked indefinitely in an MVar operation in unsafePerformIO
by Simon Marlow

REPLY TO AUTHOR
 
REPLY TO GROUP




On 30/07/2012 15:30, Marco TĂșlio Gontijo e Silva wrote:
> Hi.
>
> I'm having a problem calling logM from hsLogger inside
> unsafePerformIO.  I have described the problem in Haskell-cafe, so
> I'll avoid repeating it here:
>
> http://www.haskell.org/pipermail/haskell-cafe/2012-July/102545.html
>
> I've had this problem both with GHC 7.4.1 and 7.4.2.  Do you have any
> suggestion?

Is it possible that the String you are passing to uLog contains
unevaluated calls to uLog itself, which would thereby create a deadlock
as uLog tries to take the MVar that is already being held by the same
thread?

We once had this problem with hPutStr where if the argument string
contained a call to trace, which is unsafePerformIO $ hPutStr, the
result would be deadlock.  Now hPutStr has to go to some trouble to
evaluate the input string while not holding the lock.

Cheers,
Simon




_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@hask...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.