[erlang-questions] Seeing inet:start_timer badarg crash

Vince Foley vincefoley@REDACTED
Sat Oct 13 07:20:06 CEST 2018


I'll use the workaround, but I went ahead and took a shot at fixing the bug
in erlang here:

https://github.com/erlang/otp/pull/1983

On Fri, Oct 12, 2018 at 7:54 PM Vince Foley <vincefoley@REDACTED> wrote:

> This is excellent info, thanks so much!
>
> On Fri, Oct 12, 2018 at 6:39 PM Dominic Morneau <dmorneau@REDACTED>
> wrote:
>
>> Hi Vince,
>>
>> That’s a bug introduced in:
>> https://github.com/erlang/otp/pull/1694
>>
>> It happens when using an epmd_module that doesn’t implement the optional
>> address_please callback.
>>
>> You can work around it by implementing address_please inside your
>> EpmdClient module exactly like this:
>>
>> https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/erl_epmd.erl#L174
>>
>> Then inet_tcp_dist will pick up your implementation rather than the
>> default case, which is broken because inet.getaddr/3’s last argument is not
>> an address family, it’s a timeout:
>>
>> https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L450
>>
>> https://github.com/erlang/otp/blob/OTP-21.0.3/lib/kernel/src/inet_tcp_dist.erl#L289
>>
>> Dominic
>>
>> 2018年10月12日(金) 5:58 Vince Foley <vincefoley@REDACTED>:
>>
>>> Hello there, I'm seeing some crashes in my logs since updating to OTP 21
>>> that I can't quite track down...
>>>
>>> The exit value looks like this:
>>>
>>> {
>>>   :badarg,
>>>   [
>>>     {:erlang, :start_timer, [:inet, #PID<0.17713.363>, :inet], []},
>>>     {:inet, :start_timer, 1, [file: 'inet.erl', line: 1763]},
>>>     {:inet, :getaddr, 3, [file: 'inet.erl', line: 591]},
>>>     {:inet_tcp_dist, :do_setup, 7, [file: 'inet_tcp_dist.erl', line:
>>> 289]}
>>>   ]
>>> }
>>>
>>> It looks like something is going wrong in the distributed node
>>> connection system. The result that I can see from this is that the nodes
>>> are no longer able to connect to each other.
>>>
>>> I am using a mechanism other than the standard `epmd` to discover the
>>> other nodes, so I'm wondering if a detail changed that I have to adapt to.
>>> I'm using `-epmd_module`. The mechanism I'm using is described in this
>>> article:
>>>
>>>
>>> https://www.erlang-solutions.com/blog/erlang-and-elixir-distribution-without-epmd.html
>>>
>>> That might be related but I don't quite see how. Does anyone have any
>>> ideas what might be happening here?
>>>
>>> Thanks!
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181012/0d2499bc/attachment.htm>


More information about the erlang-questions mailing list