[erlang-bugs] Bug in the resolver?

Raimo Niskanen raimo+erlang-bugs@REDACTED
Tue Apr 12 13:46:05 CEST 2011


On Tue, Apr 12, 2011 at 09:13:10PM +1000, Evgeniy Khramtsov wrote:
> 12.04.2011 20:30, Raimo Niskanen wrote:
> >
> >You must have called inet_res:getbyname(Name, Type, infinity),
> >and that was apparently not tested. The functions that calculate
> >the remaining time for do_udp_recv/5 are not written for a timeout of
> >'infinity' and crash for the subtraction of Now - 'undefined'.
> >   
> 
> Strange. There is inet_res:getbyname(String, srv, 10000) actually.

Sorry, I misread the condition in the code. To get to where your stacktrace
tells me the value of Timeout to inet_res:do_udp_receive/5 must be 0.

Then it seems the code accidentally loops exactly when 0 milliseconds
remain to wait for the whole user interface timeout. If a lower level
timeout of 5 seconds (which sounds familiar) is involved, then
two such UDP timeouts could make the code loop after exactly
10 seconds and get a rest timeout of 0 ms.

Try a timeout value of 11111 ms instead.

If this guess is correct the bug is more serious than I first assumed.

> 
> -- 
> Regards,
> Evgeniy Khramtsov, ProcessOne.
> xmpp:xram@REDACTED
> 
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list