Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when inspecting process that monitors via {RegName, Node} #86

Merged
merged 1 commit into from Feb 10, 2022

Conversation

ansd
Copy link
Contributor

@ansd ansd commented Feb 9, 2022

Before this commit, when getting the process info in the observer CLI of a
worker process that monitors another process via

erlang:monitor(process, {registered_name(), node()})

the CLI crashed with the following error:

07:52:16.293 [error] Process #PID<11118.11514.13> on node :rabbit@me raised an exception
** (ArgumentError) argument error
    (stdlib 3.17) io_lib.erl:187: :io_lib.format("|~-16.16ts | ~-112.112ts | \e[0m\n|~-16.16ts | ~-112.112ts | \e[0m\n|~-16.16ts | ~-112.112ts \e[0m|~n", ['Links(1)', ['<0.522.0>'], 'Monitors(1)', ["%2F_qq-10": :rabbit@me], 'MonitoredBy(1)', ['<0.529.0>']])
    src/observer_cli_process.erl:90: :observer_cli_process.render_worker/7

Note than recon:info(Pid) returns

...
{signals,[{links,[<0.691.0>]},
           {monitors,[{process,{'%2F_qq-10','rabbit@me'}}]},
           {monitored_by,[]},
           {trap_exit,false}]},
...

Also see https://github.com/erlang/otp/blob/e5241e4b777b77db51ec83855958e67420048d94/erts/preloaded/src/erlang.erl#L2521-L2523 for latest Erlang master branch.

After this commit, observer CLI does not crash anymore.
Tested on Erlang 24.2.1.

Thanks @mkuratczyk for spotting the bug.

Before this commit, when getting the process info in the observer CLI of a
worker process that monitors another process via
erlang:monitor(process, {registered_name(), node()})
the CLI crashed with the following error:

07:52:16.293 [error] Process #PID<11118.11514.13> on node :rabbit@me raised an exception
** (ArgumentError) argument error
    (stdlib 3.17) io_lib.erl:187: :io_lib.format("|~-16.16ts | ~-112.112ts | \e[0m\n|~-16.16ts | ~-112.112ts | \e[0m\n|~-16.16ts | ~-112.112ts \e[0m|~n", ['Links(1)', ['<0.522.0>'], 'Monitors(1)', ["%2F_qq-10": :rabbit@me], 'MonitoredBy(1)', ['<0.529.0>']])
    src/observer_cli_process.erl:90: :observer_cli_process.render_worker/7

Note than recon:info(Pid) returns
...
{signals,[{links,[<0.691.0>]},
           {monitors,[{process,{'%2F_qq-10','rabbit@me'}}]},
           {monitored_by,[]},
           {trap_exit,false}]},
...

After this commit, observer CLI does not crash anymore.
@michaelklishin
Copy link
Contributor

@zhongwencool Team RabbitMQ has discovered this. Any chance we can get this in and then a new patch release we can depend on?

@zhongwencool zhongwencool merged commit 3127cd4 into zhongwencool:master Feb 10, 2022
@zhongwencool
Copy link
Owner

@michaelklishin 1.7.2 has already been released. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants