branch=main - a portscan kills epmd

Open
#1,788 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
erlang
Domain
backend

Research direction

The crash points to epmd:accept/1 in AtomVM/libs/eavmlib/src/epmd.erl at line 128, called from handle_info/2. Start by reading those functions and the reported enotconn error path. Reproduce the failure with the port scan or a connection to port 4369, then confirm epmd remains running when a client disconnects during accept.

Written by the indexing model from the issue text.

Description

a portscan

nmap -p 4000-5000 10.28.57.95

kills epmd (andalso telnet ip 4369 and probably other programs)

(12526) otp_socket: Unable to accept on socket 54.  errno=128
CRASH
======
pid: <0.8.0>

Stacktrace:
[{epmd,accept,1,[{file,"../AtomVM/libs/eavmlib/src/epmd.erl"},{line,128}]},{epmd,handle_info,2,[{file,"../AtomVM/libs/eavmlib/src/epmd.erl"},{line,99}]},{gen_server,loop,3,[{file,"../AtomVM/libs/estdlib/src/gen_server.erl"},{line,556}]}]

cp: #CP<module: 17, label: 27, offset: 20>

x[0]: error
x[1]: {case_clause,{error,enotconn}}
x[2]: {3,3,114,2,[{4,3337},{17,333},{17,945}],error}

Stack 
-----

{state,{<<"">>,#Ref<0.0.7>},4369,#Ref<0.0.22>,[{#Ref<0.0.20>,client}],[{<<"atomvm">>,53195,#Ref<0.0.20>,<<207,203,77,0,0,6,0,6,0,6,97,116,111,109,118,109,0,0>>}],43}
#CP<module: 17, label: 15, offset: 40>
#CP<module: 4, label: 115, offset: 21>
[]
[]
[]
{state,{<<"">>,#Ref<0.0.7>},4369,#Ref<0.0.22>,[{#Ref<0.0.20>,client}],[{<<"atomvm">>,53195,#Ref<0.0.20>,<<207,203,77,0,0,6,0,6,0,6,97,116,111,109,118,109,0,0>>}],43}
[]
{state,epmd,epmd,{state,{<<"">>,#Ref<0.0.7>},4369,#Ref<0.0.22>,[{#Ref<0.0.20>,client}],[{<<"atomvm">>,53195,#Ref<0.0.20>,<<207,203,77,0,0,6,0,6,0,6,97,116,111,109,118,109,0,0>>}],43}}
<0.1.0>
#CP<module: 4, label: 140, offset: 0>

Mailbox
-------


Monitors
--------
link to <0.1.0>
monitored by resource 0x3fcc06ac ref=9
monitored by resource 0x3fcc4c60 ref=21


**End Of Crash Report**
Return value: 1000
I (12636) AtomVM: AtomVM application terminated.  Going to sleep forever ...
Dominant language
Erlang
Stars
2.3k
Forks
171
Avg merge
4d 11h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomvm/AtomVM

All issues in atomvm/AtomVM

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.