[erlang-bugs] inets stand_alone mode

Michael Truog mjtruog@REDACTED
Wed Jul 30 21:37:25 CEST 2014


Hi,

I ran into a problem that exists in 17.1.2 with inets between inets mode and stand_along mode with httpc:

This works:
1> application:start(inets).
ok
2> inets:start(httpc, [{profile, foobar}], inets).
{ok,<0.53.0>}
3> inets:start(httpc, [{profile, foobar}], inets).
{error,{already_started,<0.53.0>}}

This is the problem (unable to use a try/catch to get the exit, since that is within an inets process):
1> inets:start(httpc, [{profile, foobar}], stand_alone).
{ok,<0.35.0>}
2> inets:start(httpc, [{profile, foobar}], stand_alone).

=ERROR REPORT==== 30-Jul-2014::12:24:22 ===
** Generic server <0.35.0> terminating
** Last message in was {'EXIT',<0.33.0>,
                         {'EXIT',
                          {badarg,
                           [{ets,new,
                             [stand_alone_foobar__session_db,
                              [public,set,named_table,{keypos,2}]],
                             []},
                            {httpc_manager,do_init,2,
[{file,"httpc_manager.erl"},{line,421}]},
                            {httpc_manager,init,1,
[{file,"httpc_manager.erl"},{line,406}]},
                            {gen_server,init_it,6,
                             [{file,"gen_server.erl"},{line,306}]},
                            {proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}}
** When Server state == {state,[],stand_alone_foobar__handler_db,
                             {cookie_db,undefined,16402},
stand_alone_foobar__session_db,stand_alone_foobar,
                             {options,
                                 {undefined,[]},
                                 {undefined,[]},
0,2,5,120000,2,disabled,false,inet,default,
                                 default,[]}}
** Reason for termination ==
** {'EXIT',{badarg,[{ets,new,
                          [stand_alone_foobar__session_db,
                           [public,set,named_table,{keypos,2}]],
                          []},
                     {httpc_manager,do_init,2,
[{file,"httpc_manager.erl"},{line,421}]},
                     {httpc_manager,init,1,
[{file,"httpc_manager.erl"},{line,406}]},
                     {gen_server,init_it,6,
[{file,"gen_server.erl"},{line,306}]},
                     {proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}
** exception exit: {'EXIT',
                        {badarg,
                            [{ets,new,
                                 [stand_alone_foobar__session_db,
[public,set,named_table,{keypos,2}]],
                                 []},
                             {httpc_manager,do_init,2,
[{file,"httpc_manager.erl"},{line,421}]},
                             {httpc_manager,init,1,
[{file,"httpc_manager.erl"},{line,406}]},
                             {gen_server,init_it,6,
[{file,"gen_server.erl"},{line,306}]},
                             {proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}

I am not sure if this was a known issue, but it should be a bug, since it seems valid that two standalone Erlang processes might use the same httpc profile data in ets.

Thanks,
Michael



More information about the erlang-bugs mailing list