Crash in socket_dist_controller

Open
#2,030 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

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

Research direction

Start with libs/estdlib/src/socket_dist_controller.erl, especially recv_data_loop/1 at line 173 and handle_info/2 at line 161, where the crash report shows {error, closed} reaching an unhandled case. Trace how socket closure is handled and check the related previous crashes mentioned in the issue. Done means the controller handles this failure without crashing; the issue provides no test or reproduction steps.

Written by the indexing model from the issue text.

Description

This might be related to other previous crashes.
See also build-and-test (clang-10, -O3, 25, 1.11.1)
Found while running CI on 6ef74599478c3d785f9ac2e25448516e84ab52dc

CRASH 
======
pid: <0.2122.0>

Stacktrace:
[{proc_lib,exit_raise,3,[{file,"/__w/AtomVM/AtomVM/libs/estdlib/src/proc_lib.erl"},{line,286}]}]

cp: #CP<module: 5, label: 93, offset: 0>

x[0]: exit
x[1]: {{case_clause,{error,closed}},[{socket_dist_controller,recv_data_loop,1,[{file,"/__w/AtomVM/AtomVM/libs/estdlib/src/socket_dist_controller.erl"},{line,173}]},{socket_dist_controller,handle_info,2,[{file,"/__w/AtomVM/AtomVM/libs/estdlib/src/socket_dist_controller.erl"},{line,161}]},{gen_server,handle_msg,4,[{file,"/__w/AtomVM/AtomVM/libs/estdlib/src/gen_server.erl"},{line,561}]},{proc_lib,init_p,5,[{file,"/__w/AtomVM/AtomVM/libs/estdlib/src/proc_lib.erl"},{line,272}]},{proc_lib,init_p,5,[{file,"/__w/AtomVM/AtomVM/libs/estdlib/src/proc_lib.erl"},{line,272}]}]}
x[2]: {1,1,48,1,[{5,1404}],exit}

Stack 
-----



Mailbox
-------


Monitors
--------
link to <0.2123.0>
monitored by resource type dist_connection ref=6585
monitored by resource type socket_fd ref=6590


**End Of Crash Report**
Segmentation fault (core dumped)
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.