<br><br><div class="gmail_quote">2013/2/11 Vitaliy Kulchevych <span dir="ltr"><<a href="mailto:coolchevy@gmail.com" target="_blank">coolchevy@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, Robert!<br>
<br>
Yes, it's true.<br>
When os:cmd("LANG=C LC_ALL=C uptime") calling on loaded system there<br>
returns empty string.<br>
I think os:cmd has timeout.<br>
May be cpu_sup must be catch it?<br></blockquote><div><br></div><div>Either that or it shouldn't call it in the first place. Using a capability without checking if it exists .. not ideal.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
On Mon, Feb 11, 2013 at 2:35 AM, Robert Virding<br>
<<a href="mailto:robert.virding@erlang-solutions.com">robert.virding@erlang-solutions.com</a>> wrote:<br>
> You are crashing because you are trying to call hd([]) which is illegal as hd/1 returns the head of the argument list and [] has no head. Hence the badarg error. Why it is calling hd([]) in cpu_sup:get_uint32/2 is another story. Can't help you there.<br>
><br>
> Robert<br>
><br>
> ----- Original Message -----<br>
>> From: "Vitaliy Kulchevych" <<a href="mailto:coolchevy@gmail.com">coolchevy@gmail.com</a>><br>
>> To: <a href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a><br>
>> Sent: Friday, 8 February, 2013 2:17:18 PM<br>
>> Subject: [erlang-bugs] erlang,hd,[[]]<br>
>><br>
>> Hi, all!<br>
>> I'm using cpu_sup for monitoring os of erlang node. Sometimes I catch<br>
>> crash:<br>
>><br>
>> {badarg,[{erlang,hd,[[]],[]},{cpu_sup,get_uint32_measurement,2,[{file,"cpu_sup.erl"},{line,282}]},{cpu_sup,measurement_server_loop,1,[{file,"cpu_sup.erl"},{line,585}]}]}<br>
>><br>
>><br>
>> Darwin coolchevy.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug<br>
>> 23<br>
>> 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64<br>
>><br>
>> Mac OS X 10.7.5<br>
>><br>
>> Erlang from mac ports: Erlang R15B (erts-5.9)<br>
>><br>
>> --<br>
>> live free or die;<br>
>> _______________________________________________<br>
>> erlang-bugs mailing list<br>
>> <a href="mailto:erlang-bugs@erlang.org">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>
>><br>
<br>
<br>
<br>
--<br>
live free or die;<br>
_______________________________________________<br>
erlang-bugs mailing list<br>
<a href="mailto:erlang-bugs@erlang.org">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>
</div></div></blockquote></div><br>