[erlang-questions] Crash in diameter_sctp:peeloff/3

Andreas Schultz aschultz@REDACTED
Tue Jan 26 10:14:10 CET 2016


Hi,

It seems that is possible to get an DIAMETER sctp socket into
a situation where diameter_sctp:peeloff/3 will crash with:

2016-01-25 15:07:34 =ERROR REPORT====
** Generic server <0.339.0> terminating 
** Last message in was {sctp,#Port<0.4624>,{8193,1784,4825,22,656,3071,65066,34054},52556,{[],{sctp_assoc_change,comm_up,0,10,10,152}}}
** When Server state == {listener,#Ref<0.0.1.4007>,#Port<0.4624>,1,{0,{[],[]}},#Ref<0.0.1.4505>,[]}
** Reason for termination == 
** {{badmatch,{error,einval}},[{diameter_sctp,peeloff,3,[{file,"transport/diameter_sctp.erl"},{line,749}]},{diameter_sctp,l,2,[{file,"transport/diameter_sctp.erl"},{line,452}]},{diameter_sctp,handle_info,2,[{file,"transport/diameter_sctp.erl"},{line,396}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
2016-01-25 15:07:34 =CRASH REPORT====
  crasher:
    initial call: diameter_sctp:init/1
    pid: <0.339.0>
    registered_name: []
    exception exit: {{{badmatch,{error,einval}},[{diameter_sctp,peeloff,3,[{file,"transport/diameter_sctp.erl"},{line,749}]},{diameter_sctp,l,2,[{file,"transport/diameter_sctp.erl"},{line,452}]},{diameter_sctp,handle_info,2,[{file,"transport/diameter_sctp.erl"},{line,396}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},[{gen_server,terminate,7,[{file,"gen_server.erl"},{line,826}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
    ancestors: [diameter_sctp_listener_sup,diameter_transport_sup,diameter_sup,<0.221.0>]
    messages: []
    links: [<0.290.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 75113
    stack_size: 27
    reductions: 2935
  neighbours:


This most likely happens when the incoming connection is terminated very
quickly after it has been established. I looked at the code and the possible
error returns of get_sctp:peeloff/2 are not handled.

To me, this looks like a valid socket shutdown that should be handled
gracefully instead of crashing?

Andreas



More information about the erlang-questions mailing list