[erlang-questions] SSL/TLS renegotiation crash triggered by setopts

Florian Waas <>
Wed Aug 7 08:15:37 CEST 2013


Hi,
Reading from a Postgres server tls_connection's gen_fsm crashes on me
during TLS renegotiation with below error report (small snippet of
most relevant parts only due to size).

I'm setting the socket into {active, once} after each packet; the
server kicks off renegotiation every 512MB. Looks like the problem
occurs when setopts is called during renegotiation. When hammering the
system I hit it pretty much every time the server renegotiates --
happens in both R15 and R16.

Quick hack in tls_connection.erl:995 to allow the transition from
'connection' to 'hello' in handle_sync_event instead of insisting that
setopts doesn't change states gets me out of this pickle...


Anybody seen this problem? Clean(er) workarounds available?

Thanks,
-fl.




=ERROR REPORT==== 6-Aug-2013::21:26:38 ===
** State machine <0.368.0> terminating
** Last message in was {'$gen_sync_all_state_event',
                           {<0.364.0>,#Ref<0.0.0.67905>},
                           {set_opts,[{active,once}]}}
** When State == connection
**      Data  == {state,client,
                     {#Ref<0.0.0.247>,<0.364.0>},
[...]
                     undefined,
                     {[],[]},
                     false,true,false,undefined,undefined}
** Reason for termination =
** {{case_clause,
        {next_state,hello,
            {state,client,
[...]

    [{tls_connection,handle_sync_event,4,
         [{file,"tls_connection.erl"},{line,994}]},
     {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}



More information about the erlang-questions mailing list