zhongwencool/observer_cli

Crash on HiPE compiled node

mgumz opened this issue · 3 comments

mgumz commented

When using observer_cli (ba4c3a4) to attach to a node which contains HiPE compiled modules, observer_cli crashes with this:

{function_clause,[{observer_cli_lib,mfa_to_list,
                                    [undefined],
                                    [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli_lib.erl"},
                                     {line,107}]},
                  {observer_cli,get_current_initial_call,1,
                                [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl"},
                                 {line,429}]},
                  {observer_cli,get_top_n_info,1,
                                [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl"},
                                 {line,507}]},
                  {observer_cli,'-render_top_n_view/5-fun-0-',3,
                                [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl"},
                                 {line,296}]},
                  {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
                  {observer_cli,top_n_rows,3,
                                [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl"},
                                 {line,400}]},
                  {observer_cli,render_top_n_view,5,
                                [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl"},
                                 {line,308}]},
                  {observer_cli,redraw_running,7,
                                [{file,"/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl"},
                                 {line,132}]}]}

[erlang:process_info(X) || X <- erlang:processes()]. shows multiple entries {current_function,undefined} (which is expected due to the HiPE compilation).

  1. I can disable show current_function if we unable get it from process_info/1.
  2. But I read the process_info(Pid, current_function)'s document, it always return {current_function, {Module, Function, Arity}}.
    So I want to reproduce this crash.
    I use kerl build erlang 20.1
KERL_CONFIGURE_OPTIONS=--enable-hipe kerl build 20.1 20.1-hipe

kerl install 20.1-hipe /Users/zhongwen/.asdf/installs/erlang/20.1-hipe

. /Users/zhongwen/.asdf/installs/erlang/20.1-hipe/activate

erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 9.0

rebar3 shell
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V9.0  (abort with ^G)
1> c(observer_cli, [native,{hipe,03}]).
Recompiling xxxx/observer_cli/_build/default/deps/observer_cli/src/observer_cli.erl
{ok,observer_cli}
2>observer_cli:start().

The crash did not happen.
I just curious how to run into your hipe situation, which erl version ?

erl -version
mgumz commented
$> erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 9.1.5

to make the situation a bit more clear:

  • i have a non-HiPE compiled observer_cli
  • it faces a HiPE compiled Erlang release

@mgumz
I can't reproduce this, but I make sure it's not crash when can't get current_function on 3f90e85
Please try master on your node.

#rebar.config
{deps, [{observer_cli, {git, "https://github.com/zhongwencool/observer_cli.git", {branch, "master"}}}]}.

> rebar3 upgrade observer_cli