<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Justin,<br>
<br>
Belonging to an application means the Erlang process has its group
leader set to an application master that the kernel source code
knows about (application_controller:get_application/1 does an ets
lookup to find the application associated with the application
master). If you are running Erlang source code that isn't using
an application at the top-level, Erlang processes will not have
the group_leader set to refer to an application (for example,
application:get_application(self()) in the shell). It is possible
to intentionally set the group leader with erlang:group_leader/2
to something that is not an application master, but there are
warnings in the documentation about that.<br>
<br>
Best Regards,<br>
Michael<br>
<br>
On 10/14/2018 10:14 AM, Justin Wood wrote:<br>
</div>
<blockquote type="cite"
cite="mid:o1kAnEymZH3xBJpGRUj96H6bovxF15ExqX4O9ik7mNQx0ky5g2g6mDeau1JWEoB4AFEG6tqi9yxxYFYRsiHhvvrvrQ_4LHUdJYCTDrvad1g=@protonmail.com">
<div>Hello list,<br>
</div>
<div><br>
</div>
<div>I have a situation where I am finding a random pid and asking
which application it came from using <span style="font-family:
menlo, consolas, courier new, monospace, sans-serif;"
class="font">application:get_application/1</span>. According
to the documentation, that function will return <span
style="font-family: menlo, consolas, courier new, monospace,
sans-serif;" class="font">undefined</span><span
style="font-family: arial, sans-serif;" class="font"> if the
pid does not belong to any application.</span><br>
</div>
<div><br>
</div>
<div>When my app runs it is returning <span style="font-family:
menlo, consolas, courier new, monospace, sans-serif;"
class="font">undefined</span><span style="font-family: arial,
sans-serif;" class="font"> for a pid belonging to </span><span
style="font-family: menlo, consolas, courier new, monospace,
sans-serif;" class="font">kernel</span><span
style="font-family: arial, sans-serif;" class="font">. I know
this because I am outputting </span><span style="font-family:
menlo, consolas, courier new, monospace, sans-serif;"
class="font">erlang:process_info(Pid)</span><span
style="font-family: arial, sans-serif;" class="font"> and I am
seeing registered names such as </span><span
style="font-family: menlo, consolas, courier new, monospace,
sans-serif;" class="font">inet_db</span><span
style="font-family: arial, sans-serif;" class="font"> and </span><span
style="font-family: menlo, consolas, courier new, monospace,
sans-serif;" class="font">file_server_2</span><span
style="font-family: arial, sans-serif;" class="font">. When I
check the shell for those applications, it is properly
returning </span><span style="font-family: menlo, consolas,
courier new, monospace, sans-serif;" class="font">{ok, kernel}</span><span
style="font-family: arial, sans-serif;" class="font">.</span><br>
</div>
<div><br>
</div>
<div>I am wondering under what circumstances a pid does not belong
to an application?<br>
</div>
<div><br>
</div>
<div>If it makes a difference, I am testing this on OTP 21.0.9.<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>