[erlang-questions] how to debug distribution protocol issues?
Thu Feb 23 08:48:27 CET 2012
On 02/23/2012 07:43 AM, OvermindDL1 wrote:
> On Mon, Feb 20, 2012 at 9:58 PM, mabrek <mabrek@REDACTED> wrote:
>> Problem solved.
>> I rebuilt Erlang with CFLAGS="-D ERTS_DIST_MSG_DBG" and all
>> distribution messages were printed to stderr in readable format.
>> On Sun, Feb 19, 2012 at 5:53 PM, mabrek <mabrek@REDACTED> wrote:
>>> I've got erlang process linked to jinterface mailbox. When jinterface
>>> mailbox terminates erlang process trace shows getting_unlinked and no
>>> 'EXIT' message. It's a simplified version of process leak that I'm
>>> trying to debug.
>>> dbg:p(Pid, [m, p]) wasn't very helpful, it shows getting_unlinked, but
>>> there is no unlink/1 call neither on erlang nor on jinterface side.
>>> packet dump gathered via tcpdump may contain something interesting,
>>> but I can't find any tools to decode distribution protocol messages
>>> from binary to human readable form (wireshark has support only for
>>> epmd conversations).
>>> What is the best strategy/tools to use when debugging such kind of situations?
> So what was the issue and resolution of your distribution node
> problem, I am curious?
It was really a stupid mistake. Java code called mailbox.close() which
means exit(normal). Erlang process didn't set trap_exit. After receiving
normal exit signal it simply removed link (thouse getting_unlinked lines
in trace) and didn't exit.
More information about the erlang-questions