Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-1242: inet driver can get stuck #4271

Closed
OTP-Maintainer opened this issue May 8, 2020 · 5 comments
Closed

ERL-1242: inet driver can get stuck #4271

OTP-Maintainer opened this issue May 8, 2020 · 5 comments
Assignees
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS

Comments

@OTP-Maintainer
Copy link

Original reporter: massemanet
Affected version: Not Specified
Component: erts
Migrated from: https://bugs.erlang.org/browse/ERL-1242


Start two sockets and connect them.
{code:erlang}
{ok,S}=gen_sctp:open(6666).
gen_sctp:listen(S,true). {code}
{code:erlang}
{ok,C}=gen_sctp:open().
gen_sctp:connect(C,localhost,6666,[]). 
{code}
 

{{Loop over a call to recv (with timeout).}}
{code:erlang}
RECV = fun(G,Sck) -> io:fwrite("~p~n",[gen_sctp:recv(Sck,500)]),G(G,Sck)end.
Pid = spawn(fun() -> RECV(RECV,S) end).
{code}
Close the socket.
{code:erlang}
gen_sctp:close(S).{code}
 The socket and the recv process is now stuck forever.

 
{code:erlang}
process_info(Pid,current_function).
{current_function,\{prim_inet,recvfrom0,3}
{code}
 
@OTP-Maintainer
Copy link
Author

ingela said:

Alas this is not a high priority for Ericsson, but we will try to find some time to look into it. Can not make any promises on when that will be though.  Any insights anyone might have on this issue are more than welcome.

@OTP-Maintainer
Copy link
Author

massemanet said:

The same thing happens for UDP.

{code:erlang}
{ok,S} = gen_udp:open(4567,[{active,false}]).
RECV = fun(G,Sck) -> io:fwrite("~p~n",[gen_udp:recv(Sck,0,500)]),G(G,Sck)end.
Pid = spawn(fun()->RECV(RECV,S)end).
{code}
{code:erlang}
gen_udp:close(S).
process_info(Pid,current_function).
{code}

@OTP-Maintainer
Copy link
Author

bmk said:

Hi,

The bug seems to be in the socket close. It does to inform those processes that have
ongoing requests towards the socket (port). Thereby leaving the process hanging.

This effects both udp and sctp since they share this code.

Regards,
     /BMK

@OTP-Maintainer
Copy link
Author

bmk said:

Hi,

A 22.3 patch package, 22.3.4.1, containing a fix for this has been released.

Regards,
    /BMK

@OTP-Maintainer
Copy link
Author

bmk said:

Hi,

A 23.0 patch package, 23.0.1, containing a fix for this has been released.

Regards,
     /BMK

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:PS Assigned to OTP team PS priority:medium labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

2 participants