Hi all,<br><br>I have a curious bug that I've tracked down to a call to gen_tcp:controlling_process. From the stack trace (simple example reproduced below) it seems that the port in question definitely exists, but the call to inet_db:lookup fails. Has anyone seen this before or got any advice?<br>
<br>Thanks!<br>Paul.<br><br>Erlang (BEAM) emulator version 5.6.5 [source] [async-threads:0] [kernel-poll:false]<br><br>Eshell V5.6.5 (abort with ^G)<br>1> mochiweb_socket_server:start( [{ip, "<a href="http://127.0.0.1" target="_blank">127.0.0.1</a>"}, {loop, {connection, start}}, {name, badger}, {port, 8888}]).<br>
{ok,<0.32.0>}<br>2> Sock = gen_tcp:connect('<a href="http://127.0.0.1" target="_blank">127.0.0.1</a>', 8888, [binary, {packet, line}, {nodelay, true}], 3000000).<br>{ok,#Port<0.496>}<br>3> gen_tcp:controlling_process(Sock, self()).<br>
<br>=ERROR REPORT==== 24-Nov-2008::20:59:12 ===<br>** Generic server badger terminating <br>** Last message in was {'EXIT',<0.30.0>,<br> {function_clause,<br> [{inet_db,lookup_socket,[{ok,#Port<0.496>}]},<br>
{gen_tcp,controlling_process,2},<br> {erl_eval,do_apply,5},<br> {shell,exprs,6},<br> {shell,eval_exprs,6},<br>
{shell,eval_loop,3}]}}<br>** When Server state == {mochiweb_socket_server,8888,<br> {connection,start},<br> {local,badger},<br> 2047,<br>
{127,0,0,1},<br> #Port<0.488>,<0.37.0>,30}<br>** Reason for termination == <br>** {function_clause,[{inet_db,lookup_socket,[{ok,#Port<0.496>}]},<br>
{gen_tcp,controlling_process,2},<br> {erl_eval,do_apply,5},<br> {shell,exprs,6},<br> {shell,eval_exprs,6},<br> {shell,eval_loop,3}]}<br>
** exception exit: function_clause<br> in function inet_db:lookup_socket/1<br> called as inet_db:lookup_socket({ok,#Port<0.496>})<br> in call from gen_tcp:controlling_process/2<br>4> <br><br>