RE: [Haskell-cafe] Spurious program crashes

On 16 November 2005 17:38, Joel Reymont wrote:
I'm getting crashes like this and I cannot figure out what the problem is. I'm launching a bunch of threads that connect to a server via TCP and exchange packets.
I am running operations like connect and receive in a timeout function that launches two threads and uses an MVar to figure out who's done first. The timeout function then kills the two threads.
Any ideas what could be causing this? I feel like a Haskell guinea pig these days :-).
I don't see any reason why you should be getting crashes here, but this is a delicate area (async exceptions + FFI). It's possible there's a bug, but as usual we need to reproduce the symptoms here. Can you help with a repro case? Regarding the behaviour of killThread, I believe the version in GHC is slightly different from the version described in the Asynchronous Exceptions paper, in particular the GHC version blocks until the exception has been delivered to the target thread (use another forkIO to get the fully async version). Cheers, Simon

I will work on the repro case over the weekend. Getting this to work correctly is crucial to the future of Haskell, I think. Without this working correctly there's a slim chance of Haskell being used successfully used for high-performance networking apps. On Nov 17, 2005, at 3:00 PM, Simon Marlow wrote:
I don't see any reason why you should be getting crashes here, but this is a delicate area (async exceptions + FFI). It's possible there's a bug, but as usual we need to reproduce the symptoms here. Can you help with a repro case?

Actually, this has just become crucial for me. In my using of hWaitForInput I missed that it blocks all other threads if no input is available :-(. Arghh! I still need timeouts. On Nov 17, 2005, at 3:00 PM, Simon Marlow wrote:
Regarding the behaviour of killThread, I believe the version in GHC is slightly different from the version described in the Asynchronous Exceptions paper, in particular the GHC version blocks until the exception has been delivered to the target thread (use another forkIO to get the fully async version).
participants (2)
-
Joel Reymont
-
Simon Marlow