disksup crashing when spawned/forked from process

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

disksup crashing when spawned/forked from process

Christopher Meiklejohn-4
I've got an Erlang/Elixir application that's being invoked via child_process in Node.js.  Outside of Node.js, it's fine.  Inside, the node crashes on startup with a badarg from disksup -- this is because the application requires that os_mon be started.

A trivial reproducer is the following:

var child_process = require('child_process');
child_process.spawn(path_to_app_executable, ['foreground'], 
 { stdio: ignore, 
   detached: true });

Included is the crash:
2017-11-23 21:26:04 =ERROR REPORT====
** Generic server disksup terminating
** Last message in was timeout
** When Server state == [{data,[{"OS",{unix,linux}},{"Timeout",1800000},{"Threshold",80},{"D
iskData",[]}]}]
** Reason for termination ==
** {badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{file,"disksup.erl"
},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}]},{gen_server
,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_apply,3,[{file,"proc_
lib.erl"},{line,247}]}]}
2017-11-23 21:26:04 =CRASH REPORT====
  crasher:
    initial call: disksup:init/1
    pid: <0.913.0>
    registered_name: disksup
    exception exit: {{badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{
file,"disksup.erl"},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,
629}]},{gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_app
ly,3,[{file,"proc_lib.erl"},{line,247}]}]},[{gen_server,terminate,7,[{file,"gen_server.erl"}
,{line,800}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
    ancestors: [os_mon_sup,<0.911.0>]
    messages: []
    links: [<0.912.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 368
  neighbours:
2017-11-23 21:26:04 =SUPERVISOR REPORT====
     Supervisor: {local,os_mon_sup}
     Context:    child_terminated
     Reason:     {badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{file
,"disksup.erl"},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}
]},{gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_apply,3
,[{file,"proc_lib.erl"},{line,247}]}]}
     Offender:   [{pid,<0.913.0>},{id,disksup},{mfargs,{disksup,start_link,[]}},{restart_typ
e,permanent},{shutdown,2000},{child_type,worker}]

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: disksup crashing when spawned/forked from process

Luke Bakken-2
Hi Chris -

What is "path_to_app_executable"? erl itself or a relx-type shell script sort of thing?

On Nov 23, 2017 1:54 PM, "Christopher Meiklejohn" <[hidden email]> wrote:
I've got an Erlang/Elixir application that's being invoked via child_process in Node.js.  Outside of Node.js, it's fine.  Inside, the node crashes on startup with a badarg from disksup -- this is because the application requires that os_mon be started.

A trivial reproducer is the following:

var child_process = require('child_process');
child_process.spawn(path_to_app_executable, ['foreground'], 
 { stdio: ignore, 
   detached: true });

Included is the crash:
2017-11-23 21:26:04 =ERROR REPORT====
** Generic server disksup terminating
** Last message in was timeout
** When Server state == [{data,[{"OS",{unix,linux}},{"Timeout",1800000},{"Threshold",80},{"D
iskData",[]}]}]
** Reason for termination ==
** {badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{file,"disksup.erl"
},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}]},{gen_server
,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_apply,3,[{file,"proc_
lib.erl"},{line,247}]}]}
2017-11-23 21:26:04 =CRASH REPORT====
  crasher:
    initial call: disksup:init/1
    pid: <0.913.0>
    registered_name: disksup
    exception exit: {{badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{
file,"disksup.erl"},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,
629}]},{gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_app
ly,3,[{file,"proc_lib.erl"},{line,247}]}]},[{gen_server,terminate,7,[{file,"gen_server.erl"}
,{line,800}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
    ancestors: [os_mon_sup,<0.911.0>]
    messages: []
    links: [<0.912.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 368
  neighbours:
2017-11-23 21:26:04 =SUPERVISOR REPORT====
     Supervisor: {local,os_mon_sup}
     Context:    child_terminated
     Reason:     {badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{file
,"disksup.erl"},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}
]},{gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_apply,3
,[{file,"proc_lib.erl"},{line,247}]}]}
     Offender:   [{pid,<0.913.0>},{id,disksup},{mfargs,{disksup,start_link,[]}},{restart_typ
e,permanent},{shutdown,2000},{child_type,worker}]

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: disksup crashing when spawned/forked from process

Christopher Meiklejohn-4
Hi Luke,

Sorry for the delay in responding.  Yes, this is a relx/distillery wrapper around launching beam.smp.

Thanks,
Christopher

On Thu, Nov 23, 2017 at 10:21 PM Luke Bakken <[hidden email]> wrote:
Hi Chris -

What is "path_to_app_executable"? erl itself or a relx-type shell script sort of thing?

On Nov 23, 2017 1:54 PM, "Christopher Meiklejohn" <[hidden email]> wrote:
I've got an Erlang/Elixir application that's being invoked via child_process in Node.js.  Outside of Node.js, it's fine.  Inside, the node crashes on startup with a badarg from disksup -- this is because the application requires that os_mon be started.

A trivial reproducer is the following:

var child_process = require('child_process');
child_process.spawn(path_to_app_executable, ['foreground'], 
 { stdio: ignore, 
   detached: true });

Included is the crash:
2017-11-23 21:26:04 =ERROR REPORT====
** Generic server disksup terminating
** Last message in was timeout
** When Server state == [{data,[{"OS",{unix,linux}},{"Timeout",1800000},{"Threshold",80},{"D
iskData",[]}]}]
** Reason for termination ==
** {badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{file,"disksup.erl"
},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}]},{gen_server
,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_apply,3,[{file,"proc_
lib.erl"},{line,247}]}]}
2017-11-23 21:26:04 =CRASH REPORT====
  crasher:
    initial call: disksup:init/1
    pid: <0.913.0>
    registered_name: disksup
    exception exit: {{badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{
file,"disksup.erl"},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,
629}]},{gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_app
ly,3,[{file,"proc_lib.erl"},{line,247}]}]},[{gen_server,terminate,7,[{file,"gen_server.erl"}
,{line,800}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
    ancestors: [os_mon_sup,<0.911.0>]
    messages: []
    links: [<0.912.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 368
  neighbours:
2017-11-23 21:26:04 =SUPERVISOR REPORT====
     Supervisor: {local,os_mon_sup}
     Context:    child_terminated
     Reason:     {badarg,[{erlang,port_close,[#Port<0.2000>],[]},{disksup,terminate,2,[{file
,"disksup.erl"},{line,169}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}
]},{gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},{proc_lib,init_p_do_apply,3
,[{file,"proc_lib.erl"},{line,247}]}]}
     Offender:   [{pid,<0.913.0>},{id,disksup},{mfargs,{disksup,start_link,[]}},{restart_typ
e,permanent},{shutdown,2000},{child_type,worker}]

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions