[erlang-bugs] erlang,hd,[[]]

Björn-Egil Dahlberg <>
Mon Feb 11 10:29:28 CET 2013


2013/2/11 Vitaliy Kulchevych <>

> Hi, Robert!
>
> Yes, it's true.
> When os:cmd("LANG=C LC_ALL=C uptime")  calling on loaded system there
> returns empty string.
> I think os:cmd has timeout.
> May be cpu_sup must be catch it?
>

Either that or it shouldn't call it in the first place. Using a capability
without checking if it exists .. not ideal.


>
> On Mon, Feb 11, 2013 at 2:35 AM, Robert Virding
> <> wrote:
> > 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.
> >
> > Robert
> >
> > ----- Original Message -----
> >> From: "Vitaliy Kulchevych" <>
> >> To: 
> >> Sent: Friday, 8 February, 2013 2:17:18 PM
> >> Subject: [erlang-bugs] erlang,hd,[[]]
> >>
> >> Hi, all!
> >> I'm using cpu_sup for monitoring os of erlang node. Sometimes I catch
> >> crash:
> >>
> >>
> {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}]}]}
> >>
> >>
> >> Darwin coolchevy.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug
> >> 23
> >> 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
> >>
> >> Mac OS X 10.7.5
> >>
> >> Erlang from mac ports: Erlang R15B (erts-5.9)
> >>
> >> --
> >> live free or die;
> >> _______________________________________________
> >> erlang-bugs mailing list
> >> 
> >> http://erlang.org/mailman/listinfo/erlang-bugs
> >>
>
>
>
> --
> live free or die;
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130211/2d77375f/attachment.html>


More information about the erlang-bugs mailing list