[erlang-questions] Exit signals are funny things

Robert Virding <>
Wed May 3 15:03:53 CEST 2017


So:

1> Pid = spawn_link(fun() -> timer:sleep(infinity) end).
<0.59.0>
2> exit(Pid, normal).
true
3> flush().
ok
4> exit(Pid, die).
** exception exit: die

I spawn_link a process which is not trapping and send it the signal
'normal' which it ignores. As it should. I then send it the signal 'die'
and it crashes. As it should.

Now:

5> exit(self(), normal).
** exception exit: normal

Now I send myself the signal 'normal' and I die! So there is 'normal' and
there is 'normal' depending on to whom I send it.

Where's the logic in that?

Robert

P.S. More to come
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170503/979b0ce6/attachment.html>


More information about the erlang-questions mailing list