8181 alias_bif /1 ,
8282 monitor_alias /1 ,
8383 spawn_monitor_alias /1 ,
84+ alias_process_exit /1 ,
8485 monitor_tag /1 ]).
8586
8687-export ([prio_server /2 , prio_client /2 , init /1 , handle_event /2 ]).
@@ -149,7 +150,7 @@ groups() ->
149150 gc_request_when_gc_disabled , gc_request_blast_when_gc_disabled ,
150151 otp_16436 , otp_16642 ]},
151152 {alias , [],
152- [alias_bif , monitor_alias , spawn_monitor_alias ]}].
153+ [alias_bif , monitor_alias , spawn_monitor_alias , alias_process_exit ]}].
153154
154155init_per_suite (Config ) ->
155156 A0 = case application :start (sasl ) of
@@ -168,9 +169,15 @@ end_per_suite(Config) ->
168169 catch erts_debug :set_internal_state (available_internal_state , false ),
169170 Config .
170171
172+ init_per_group (alias , Config ) ->
173+ erts_debug :set_internal_state (available_internal_state , true ),
174+ Config ;
171175init_per_group (_GroupName , Config ) ->
172176 Config .
173177
178+ end_per_group (alias , Config ) ->
179+ erts_debug :set_internal_state (available_internal_state , false ),
180+ Config ;
174181end_per_group (_GroupName , Config ) ->
175182 Config .
176183
@@ -4032,11 +4039,25 @@ otp_16642(Config) when is_list(Config) ->
40324039 false = is_process_alive (Pid ),
40334040 ok .
40344041
4042+ pid_ref_table_size () ->
4043+ erts_debug :get_internal_state (pid_ref_table_size ).
4044+
4045+ check_pid_ref_table_size (PRTSz ) ->
4046+ receive after 500 -> ok end ,
4047+ case pid_ref_table_size () of
4048+ PRTSz ->
4049+ ok ;
4050+ NewPRTSz ->
4051+ ct :fail ({port_ref_table_size_mismatch , PRTSz , NewPRTSz })
4052+ end .
4053+
40354054alias_bif (Config ) when is_list (Config ) ->
4055+ PRTSz = pid_ref_table_size (),
40364056 alias_bif_test (node ()),
40374057 {ok , Node } = start_node (Config ),
40384058 alias_bif_test (Node ),
40394059 stop_node (Node ),
4060+ check_pid_ref_table_size (PRTSz ),
40404061 ok .
40414062
40424063alias_bif_test (Node ) ->
@@ -4081,10 +4102,12 @@ alias_bif_test(Node) ->
40814102
40824103
40834104monitor_alias (Config ) when is_list (Config ) ->
4105+ PRTSz = pid_ref_table_size (),
40844106 monitor_alias_test (node ()),
40854107 {ok , Node } = start_node (Config ),
40864108 monitor_alias_test (Node ),
40874109 stop_node (Node ),
4110+ check_pid_ref_table_size (PRTSz ),
40884111 ok .
40894112
40904113monitor_alias_test (Node ) ->
@@ -4168,6 +4191,7 @@ monitor_alias_test(Node) ->
41684191spawn_monitor_alias (Config ) when is_list (Config ) ->
41694192 % % Exit signals with immediate exit reasons are sent
41704193 % % in a different manner than compound exit reasons.
4194+ PRTSz = pid_ref_table_size (),
41714195 spawn_monitor_alias_test (node (), spawn_opt , normal ),
41724196 spawn_monitor_alias_test (node (), spawn_opt , make_ref ()),
41734197 spawn_monitor_alias_test (node (), spawn_request , normal ),
@@ -4180,6 +4204,7 @@ spawn_monitor_alias(Config) when is_list(Config) ->
41804204 spawn_monitor_alias_test (Node3 , spawn_request , normal ),
41814205 {ok , Node4 } = start_node (Config ),
41824206 spawn_monitor_alias_test (Node4 , spawn_request , make_ref ()),
4207+ check_pid_ref_table_size (PRTSz ),
41834208 ok .
41844209
41854210spawn_monitor_alias_test (Node , SpawnType , ExitReason ) ->
@@ -4320,6 +4345,28 @@ spawn_monitor_alias_test(Node, SpawnType, ExitReason) ->
43204345 ok
43214346 end .
43224347
4348+ alias_process_exit (Config ) when is_list (Config ) ->
4349+ Tester = self (),
4350+ CreatedAliases = make_ref (),
4351+ PRTSz = pid_ref_table_size (),
4352+ P = spawn_link (fun () ->
4353+ A0 = alias ([explicit_unalias ]),
4354+ A1 = alias ([reply ]),
4355+ A2 = monitor (process , Tester , [{alias , explicit_unalias }]),
4356+ A3 = monitor (process , Tester , [{alias , demonitor }]),
4357+ A4 = monitor (process , Tester , [{alias , reply_demonitor }]),
4358+ Tester ! CreatedAliases ,
4359+ receive after infinity -> ok end ,
4360+ some_module :some_function ([A0 , A1 , A2 , A3 , A4 ])
4361+ end ),
4362+ receive CreatedAliases -> ok end ,
4363+ PRTSz = erts_debug :get_internal_state (pid_ref_table_size ) - 5 ,
4364+ unlink (P ),
4365+ exit (P , kill ),
4366+ false = is_process_alive (P ),
4367+ check_pid_ref_table_size (PRTSz ),
4368+ ok .
4369+
43234370monitor_tag (Config ) when is_list (Config ) ->
43244371 % % Exit signals with immediate exit reasons are sent
43254372 % % in a different manner than compound exit reasons, and
0 commit comments