[erlang-questions] Strange Socket Behaviour Was:Parents always take children with them?
Sun Apr 29 11:00:53 CEST 2007
It can be tricky to detect crashes in processes created using spawn().
One way to do it is to run SASL, and use proc_lib:spawn() instead:
=PROGRESS REPORT==== 29-Apr-2007::10:54:20 ===
2> spawn(fun() -> 1=2 end).
=ERROR REPORT==== 29-Apr-2007::10:54:32 ===
Error in process <0.43.0> with exit value:
(now that particular error message was reported by the shell.)
3> proc_lib:spawn(fun() -> 1=2 end).
=CRASH REPORT==== 29-Apr-2007::10:55:11 ===
2007/4/29, Matthias Lang <matthias@REDACTED>:
> Ludovic Coquelle writes:
> > ... so the normal behavior is that gen_recv doesn't block, which is
> > intended since you request 0 byte with infinity timeout
> More precisely, gen_tcp:recv(P, 0) will block until at least one octet
> of data is available, with the options Andrew is using.
> But yes, Andrew's problem is as you diagnosed: his "critical" line of
> code will crash the process because the second argument to io:format
> must be a list.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions