[erlang-bugs] Bug in the resolver?

Raimo Niskanen <>
Tue Apr 12 13:35:33 CEST 2011


On Tue, Apr 12, 2011 at 01:08:24PM +0200, Ahmed Omar wrote:
> Hmmm, the crash doesn't look to be in subtraction (otherwise it would have
> been badarg?),  it's a crash because of a function clause in now_ms (because
> undefined won't match)
> (and undefined looks to be generated only when timeout is 0 )

Well, I ment _conceptually_ subtract since now_ms/2 is supposed to
return the number of elapsed microseconds i.e subtract
its now() arguments, and now got 'undefined' instead
of {MegaSec,Sec,MicroSec) as second argumnent.

'undefined' must be a leftover from an unfinished implementation
of either the case when you have timed out or when the
timeout is 'infinity'. Nevertheless it is incorrect.

The Timeout variable is how long time still remains to wait of the
initial user interface timeout.

> 
> Maybe I'm missing something or my coffee doesn't work :)
> 
> On Tue, Apr 12, 2011 at 12:30 PM, Raimo Niskanen <
> > wrote:
> 
> > On Tue, Apr 12, 2011 at 10:27:48AM +0200, Ahmed Omar wrote:
> > > Any steps to reproduce it?
> > >
> > > On Tue, Apr 12, 2011 at 8:25 AM, Evgeniy Khramtsov <
> > >wrote:
> > >
> > > > We have a weird problem with inet_res in R14B02. Here is a snippet:
> > > >
> > > > =ERROR REPORT==== 2011-04-11 18:45:50 ===
> > > > ** State machine <0.6000.0> terminating
> > > > ....
> > > > ** Reason for termination =
> > > > ** {{case_clause,{{1302,533150,198860},undefined}},
> > > >    [{inet_res,do_udp_recv,5},
> > > >     {inet_res,query_udp_recv,6},
> > > >     {inet_res,query_ns,10},
> > > >     {inet_res,query_nss_dns,7},
> > > >     {inet_res,query_retries,6},
> > > >     {inet_res,res_getby_query,4},
> > > >     {inet_res,res_getby_search,6},
> > > >     {inet_res,getbyname,3}]}
> > > >
> > > > Any clue how to debug this?
> >
> > The stacktrace was enough.
> >
> > 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'.
> >
> > This is a bug. Thank you for reporting it.
> >
> > You should be able to work around it by using a long timeout value.
> >
> > > >
> > > > --
> > > > Regards,
> > > > Evgeniy Khramtsov, ProcessOne.
> > > > xmpp:
> > > >
> > > > _______________________________________________
> > > > erlang-bugs mailing list
> > > > 
> > > > http://erlang.org/mailman/listinfo/erlang-bugs
> > > >
> > >
> > >
> > >
> > > --
> > > Best Regards,
> > > - Ahmed Omar
> > > http://nl.linkedin.com/in/adiaa
> > > Follow me on twitter
> > > @spawn_think <http://twitter.com/#!/spawn_think>
> >
> > > _______________________________________________
> > > erlang-bugs mailing list
> > > 
> > > http://erlang.org/mailman/listinfo/erlang-bugs
> >
> >
> > --
> >
> > / Raimo Niskanen, Erlang/OTP, Ericsson AB
> >
> 
> 
> 
> -- 
> Best Regards,
> - Ahmed Omar
> http://nl.linkedin.com/in/adiaa
> Follow me on twitter
> @spawn_think <http://twitter.com/#!/spawn_think>

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB


More information about the erlang-bugs mailing list