I think this should solve it, but i think someone from OTP team can verify it <div><br></div><div><div>index de0f23b..9151cac 100644</div><div>--- a/lib/kernel/src/inet_res.erl</div><div>+++ b/lib/kernel/src/inet_res.erl</div>
<div>@@ -552,10 +552,10 @@ do_udp_recv(Recv, IP, Port, Timeout) -></div><div> </div><div> do_udp_recv(Recv, IP, Port, Timeout, Then) -></div><div> case Recv(Timeout) of</div><div>+ {ok,_} when Timeout =:= 0 -></div>
<div>+ {error,timeout};</div><div> {ok,{IP,Port,Answer}} -></div><div> {ok,Answer,erlang:max(0, Timeout - now_ms(erlang:now(), Then))};</div><div>- {ok,_} when Timeout =:= 0 -></div>
<div>- {error,timeout};</div><div> {ok,_} -></div><div> Now = erlang:now(),</div><div> T = erlang:max(0, Timeout - now_ms(Now, Then)),</div><div><br></div><br><div class="gmail_quote">
On Tue, Apr 12, 2011 at 10:52 AM, Ahmed Omar <span dir="ltr"><<a href="mailto:spawn.think@gmail.com">spawn.think@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Actually it might be a bug. There's a clause in do_udp_recv/4 that will call do_upd_recv/5 with the value of Then as undefined.<div>If this value passed to now_ms/2 , it will crash. The crash reason is converted to case_clause instead of function_clause because now_ms/2 is inlined.<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Tue, Apr 12, 2011 at 10:27 AM, Ahmed Omar <span dir="ltr"><<a href="mailto:spawn.think@gmail.com" target="_blank">spawn.think@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Any steps to reproduce it?<div><div></div><div><br><br><div class="gmail_quote">On Tue, Apr 12, 2011 at 8:25 AM, Evgeniy Khramtsov <span dir="ltr"><<a href="mailto:xramtsov@gmail.com" target="_blank">xramtsov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We have a weird problem with inet_res in R14B02. Here is a snippet:<br>
<br>
=ERROR REPORT==== 2011-04-11 18:45:50 ===<br>
** State machine <0.6000.0> terminating<br>
....<br>
** Reason for termination =<br>
** {{case_clause,{{1302,533150,198860},undefined}},<br>
[{inet_res,do_udp_recv,5},<br>
{inet_res,query_udp_recv,6},<br>
{inet_res,query_ns,10},<br>
{inet_res,query_nss_dns,7},<br>
{inet_res,query_retries,6},<br>
{inet_res,res_getby_query,4},<br>
{inet_res,res_getby_search,6},<br>
{inet_res,getbyname,3}]}<br>
<br>
Any clue how to debug this?<br>
<br>
-- <br>
Regards,<br>
Evgeniy Khramtsov, ProcessOne.<br>
<a href="mailto:xmpp%3Axram@jabber.ru" target="_blank">xmpp:xram@jabber.ru</a>.<br>
<br>
_______________________________________________<br>
erlang-bugs mailing list<br>
<a href="mailto:erlang-bugs@erlang.org" target="_blank">erlang-bugs@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-bugs" target="_blank">http://erlang.org/mailman/listinfo/erlang-bugs</a><br>
</blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>Best Regards,<br>- Ahmed Omar<div><a href="http://nl.linkedin.com/in/adiaa" target="_blank">http://nl.linkedin.com/in/adiaa</a></div><div>
Follow me on twitter</div><div><a href="http://twitter.com/#!/spawn_think" target="_blank">@spawn_think</a></div>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>- Ahmed Omar<div><a href="http://nl.linkedin.com/in/adiaa" target="_blank">http://nl.linkedin.com/in/adiaa</a></div><div>Follow me on twitter</div>
<div><a href="http://twitter.com/#!/spawn_think" target="_blank">@spawn_think</a></div><br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>- Ahmed Omar<div><a href="http://nl.linkedin.com/in/adiaa" target="_blank">http://nl.linkedin.com/in/adiaa</a></div><div>Follow me on twitter</div><div><a href="http://twitter.com/#!/spawn_think" target="_blank">@spawn_think</a></div>
<br>
</div>