Uploaded image for project: 'Tsung development'
  1. Tsung development
  2. TSUN-320

get_os_data(freemem, {unix, linux}) crashes on Linux 3.10.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.2
    • Component/s: Server monitoring
    • Labels:
      None
    • Environment:
      CentOS 7.1.1503 x86_64, kernel 3.10.0-229.7.2.el7.x86_64

      Description

      Server monitoring crashes on CentOS 7.1 with the following error report:

      ------------------
      =ERROR REPORT==== 30-Jun-2015::16:33:52 ===

        • Generic server <0.75.0> terminating
        • Last message in was {'EXIT',<7847.62.0>,
          {{badmatch,[]},
          [
          Unknown macro: {ts_os_mon_erlang,get_os_data,2, [{file, "src/tsung_controller/ts_os_mon_erlang.erl"},
          {line,253}]},
          {ts_os_mon_erlang,node_data,0,
          [{file, "src/tsung_controller/ts_os_mon_erlang.erl"}, {line,215}]},
          {ts_os_mon_erlang,updatestats,3,
          [{file, "src/tsung_controller/ts_os_mon_erlang.erl"},
          {line,159}]}]}}
          ** When Server state == {state,{global,ts_mon},
          10000,'os_mon@tor1-tst-nginx01',
          "tor1-tst-nginx01",<7847.62.0>,[]}
          ** Reason for termination ==
          ** {function_clause,
          [{ts_os_mon_erlang,handle_info,
          [{'EXIT',<7847.62.0>,
          {{badmatch,[]},
          [{ts_os_mon_erlang,get_os_data,2,
          [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
          {line,253}]},
          {ts_os_mon_erlang,node_data,0,
          [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
          {line,215}]}

          ,

          Unknown macro: {ts_os_mon_erlang,updatestats,3, [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
          {line,159}]}]}},
          {state,
          {global,ts_mon},
          10000,'os_mon@tor1-tst-nginx01',"tor1-tst-nginx01",
          <7847.62.0>,[]}],
          [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,118}]}

          ,

          Unknown macro: {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,604}]}

          ,

          Unknown macro: {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}

          ]}

      =ERROR REPORT==== 30-Jun-2015::16:33:52 ===
      Error in process <0.62.0> on node 'os_mon@tor1-tst-prefs01' with exit value: {{badmatch,[]},[{ts_os_mon_erlang,get_os_data,2,[

      {file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,253}]},{ts_os_mon_erlang,node_data,0,[{file,"src/tsung_controller/ts_os_mon_erlang.erl"}

      ,

      {line,215}

      ]},{ts_os_mon_erlang...
      ------------------

      Line 253 seems to be dealing with memory usage:

      get_os_data(freemem,

      {unix, linux}

      ) ->
      Result = os:cmd("free | grep '\\-/
      +'"),
      [_, _, _, Free] = string:tokens(Result, " \n"),
      list_to_integer(Free)/1024;

      ------------------

      Command output:

      $ free
      total used free shared buff/cache available
      Mem: 3882756 102960 3504080 8544 275716 3569232
      Swap: 0 0 0

      $ free | grep '\\-/
      +'
      $

        Activity

        Hide
        gtirloni Giovanni Tirloni added a comment -
        =ERROR REPORT==== 30-Jun-2015::16:33:52 ===
        ** Generic server <0.75.0> terminating 
        ** Last message in was {'EXIT',<7847.62.0>,
                                   {{badmatch,[]},
                                    [{ts_os_mon_erlang,get_os_data,2,
                                         [{file,
                                              "src/tsung_controller/ts_os_mon_erlang.erl"},
                                          {line,253}]},
                                     {ts_os_mon_erlang,node_data,0,
                                         [{file,
                                              "src/tsung_controller/ts_os_mon_erlang.erl"},
                                          {line,215}]},
                                     {ts_os_mon_erlang,updatestats,3,
                                         [{file,
                                              "src/tsung_controller/ts_os_mon_erlang.erl"},
                                          {line,159}]}]}}
        ** When Server state == {state,{global,ts_mon},
                                       10000,'os_mon@tor1-tst-nginx01',
                                       "tor1-tst-nginx01",<7847.62.0>,[]}
        ** Reason for termination == 
        ** {function_clause,
               [{ts_os_mon_erlang,handle_info,
                    [{'EXIT',<7847.62.0>,
                         {{badmatch,[]},
                          [{ts_os_mon_erlang,get_os_data,2,
                               [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
                                {line,253}]},
                           {ts_os_mon_erlang,node_data,0,
                               [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
                                {line,215}]},
                           {ts_os_mon_erlang,updatestats,3,
                               [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
                                {line,159}]}]}},
                     {state,
                         {global,ts_mon},
                         10000,'os_mon@tor1-tst-nginx01',"tor1-tst-nginx01",
                         <7847.62.0>,[]}],
                    [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,118}]},
                {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,604}]},
                {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
        
        =ERROR REPORT==== 30-Jun-2015::16:33:52 ===
        Error in process <0.62.0> on node 'os_mon@tor1-tst-prefs01' with exit value: {{badmatch,[]},[{ts_os_mon_erlang,get_os_data,2,[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,253}]},{ts_os_mon_erlang,node_data,0,[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,215}]},{ts_os_mon_erlang... 
        
        ---------------------------
        
        Line 253 seems to be dealing with memory usage:
        
        et_os_data(freemem, {unix, linux}) ->
            Result = os:cmd("free | grep '\\-/\\+'"),
            [_, _, _, Free] = string:tokens(Result, " \n"),
            list_to_integer(Free)/1024;
        
        ---------------------------
        
        $ free
                      total        used        free      shared  buff/cache   available
        Mem:        3882756      103528     3503612        8544      275616     3568772
        Swap:             0           0           0
        
        $ free | egrep '\\-/\\+'
        $
        
        Show
        gtirloni Giovanni Tirloni added a comment - =ERROR REPORT==== 30-Jun-2015::16:33:52 === ** Generic server <0.75.0> terminating ** Last message in was {'EXIT',<7847.62.0>, {{badmatch,[]}, [{ts_os_mon_erlang,get_os_data,2, [{file, "src/tsung_controller/ts_os_mon_erlang.erl"}, {line,253}]}, {ts_os_mon_erlang,node_data,0, [{file, "src/tsung_controller/ts_os_mon_erlang.erl"}, {line,215}]}, {ts_os_mon_erlang,updatestats,3, [{file, "src/tsung_controller/ts_os_mon_erlang.erl"}, {line,159}]}]}} ** When Server state == {state,{global,ts_mon}, 10000,'os_mon@tor1-tst-nginx01', "tor1-tst-nginx01",<7847.62.0>,[]} ** Reason for termination == ** {function_clause, [{ts_os_mon_erlang,handle_info, [{'EXIT',<7847.62.0>, {{badmatch,[]}, [{ts_os_mon_erlang,get_os_data,2, [{file,"src/tsung_controller/ts_os_mon_erlang.erl"}, {line,253}]}, {ts_os_mon_erlang,node_data,0, [{file,"src/tsung_controller/ts_os_mon_erlang.erl"}, {line,215}]}, {ts_os_mon_erlang,updatestats,3, [{file,"src/tsung_controller/ts_os_mon_erlang.erl"}, {line,159}]}]}}, {state, {global,ts_mon}, 10000,'os_mon@tor1-tst-nginx01',"tor1-tst-nginx01", <7847.62.0>,[]}], [{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,118}]}, {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,604}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} =ERROR REPORT==== 30-Jun-2015::16:33:52 === Error in process <0.62.0> on node 'os_mon@tor1-tst-prefs01' with exit value: {{badmatch,[]},[{ts_os_mon_erlang,get_os_data,2,[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,253}]},{ts_os_mon_erlang,node_data,0,[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,215}]},{ts_os_mon_erlang... --------------------------- Line 253 seems to be dealing with memory usage: et_os_data(freemem, {unix, linux}) -> Result = os:cmd("free | grep '\\-/\\+'"), [_, _, _, Free] = string:tokens(Result, " \n"), list_to_integer(Free)/1024; --------------------------- $ free total used free shared buff/cache available Mem: 3882756 103528 3503612 8544 275616 3568772 Swap: 0 0 0 $ free | egrep '\\-/\\+' $
        Hide
        nniclausse Nicolas Niclausse added a comment -

        Hello, It's already fixed in git. Can you try it ?

        Show
        nniclausse Nicolas Niclausse added a comment - Hello, It's already fixed in git. Can you try it ?

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development