
Hi all, I have written an application, that for some reason I don't yet understand, crashes. However, when I run the application in ghci, at the moment it crashes ghci crashes along with it. No error messages are given. Both my application and ghci just stop. When I compile it, and run it as a stand-alone application, when it crashes it just stops as well. Again, no error messages are given. What could be wrong? Regards, Robert

Oh don't look at the subject :-). It should say: GHCI crashes without error message (instead of broken pipe) :-). Robert van Herk wrote:
Hi all,
I have written an application, that for some reason I don't yet understand, crashes.
However, when I run the application in ghci, at the moment it crashes ghci crashes along with it. No error messages are given. Both my application and ghci just stop.
When I compile it, and run it as a stand-alone application, when it crashes it just stops as well. Again, no error messages are given.
What could be wrong?
Regards, Robert _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

It seems that the problem of the spontanious crash in ghci, without an error message, occurs because I use a wrong buffering strategy on a handle: When I include the line hSetBuffering handle LineBuffering in my program, the program crashes at random moments, without error messages. When I comment it out, it works ok. The handle in the above example is a socket. My program is a web server. Regards, Robert

On 4/27/05, Robert van Herk
It seems that the problem of the spontanious crash in ghci, without an error message, occurs because I use a wrong buffering strategy on a handle:
When I include the line hSetBuffering handle LineBuffering in my program, the program crashes at random moments, without error messages. When I comment it out, it works ok. The handle in the above example is a socket. My program is a web server.
From the Network documentation (http://haskell.org/ghc/docs/latest/html/libraries/network/Network.html): " SIGPIPE
On Unix, when reading from a socket and the writing end is closed by the remote client, the program is normally sent a SIGPIPE signal by the operating system. The default behaviour when a SIGPIPE is received is to terminate the program silently, which can be somewhat confusing if you haven't encountered this before. The solution is to specify that SIGPIPE is to be ignored, using the POSIX library: import Posix main = do installHandler sigPIPE Ignore Nothing; ... " -- Friendly, Lemmih

On Wed, 27 Apr 2005, Lemmih wrote:
From the Network documentation (http://haskell.org/ghc/docs/latest/html/libraries/network/Network.html): " SIGPIPE
On Unix, when reading from a socket and the writing end is closed by the remote client, the program is normally sent a SIGPIPE signal by the operating system.
Um, that's the wrong way round. In the situation described above the
program gets EOF. SIGPIPE is generated when the program *writes* to a
socket whose other end has been closed.
Tony.
--
f.a.n.finch
participants (3)
-
Lemmih
-
Robert van Herk
-
Tony Finch