<div dir="ltr"><div>Hi Dinislam</div><div><br></div><div>If a process terminates normally, it won't cause other linked processes to terminate, "An exit signal with reason <span class="gmail-code">normal</span> is
ignored." see <a href="http://erlang.org/doc/reference_manual/processes.html#receiving-exit-signals">http://erlang.org/doc/reference_manual/processes.html#receiving-exit-signals</a></div><div>This is independent of whether the receiving process is hibernated or not.</div><div>With any other exit reason your assumption would be correct that the linked process should also terminate.</div><div>(Note that the atom 'ok' is also an abnormal termination reason)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 26, 2020 at 6:27 PM Dinislam Salikhov <<a href="mailto:Dinislam.Salikhov@kaspersky.com">Dinislam.Salikhov@kaspersky.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
There is a link from a process to another process which may come into hibernate state. I expect that when the former process terminates, the latter one does as well, but it doesn't happen:<br>
<br>
Erlang/OTP 21 [erts-10.3.5.9] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]<br>
<br>
Eshell V10.3.5.9 (abort with ^G)<br>
1> F = fun() -> {links,L} = process_info(self(), links), L end.<br>
#Fun<erl_eval.20.128620087><br>
2> C = fun() -> io:format("child: ~p ~p~n", [self(),F()]), erlang:hibernate(erlang,exit,[ok]) end.<br>
#Fun<erl_eval.20.128620087><br>
3> spawn(fun() -> spawn_link(C), io:format("parent: ~p ~p~n", [self(), F()]) end).<br>
parent: <0.82.0> [<0.83.0>]<br>
child: <0.83.0> [<0.82.0>]<br>
<0.82.0><br>
4> process_info(pid(0,82,0),links). % dead parent, as expected<br>
undefined<br>
5> process_info(pid(0,83,0),links). % alive child, unexpected<br>
{links,[]}<br>
<br>
Is it a bug? Or do I miss anything?<br>
<br>
Dinislam Salikhov</blockquote></div>