9494 alias_bif /1 ,
9595 monitor_alias /1 ,
9696 spawn_monitor_alias /1 ,
97+ alias_process_exit /1 ,
9798 monitor_tag /1 ]).
9899
99100-export ([prio_server /2 , prio_client /2 , init /1 , handle_event /2 ]).
@@ -180,7 +181,7 @@ groups() ->
180181 gc_request_when_gc_disabled , gc_request_blast_when_gc_disabled ,
181182 otp_16436 , otp_16642 ]},
182183 {alias , [],
183- [alias_bif , monitor_alias , spawn_monitor_alias ]}].
184+ [alias_bif , monitor_alias , spawn_monitor_alias , alias_process_exit ]}].
184185
185186init_per_suite (Config ) ->
186187 A0 = case application :start (sasl ) of
@@ -199,9 +200,15 @@ end_per_suite(Config) ->
199200 catch erts_debug :set_internal_state (available_internal_state , false ),
200201 Config .
201202
203+ init_per_group (alias , Config ) ->
204+ erts_debug :set_internal_state (available_internal_state , true ),
205+ Config ;
202206init_per_group (_GroupName , Config ) ->
203207 Config .
204208
209+ end_per_group (alias , Config ) ->
210+ erts_debug :set_internal_state (available_internal_state , false ),
211+ Config ;
205212end_per_group (_GroupName , Config ) ->
206213 Config .
207214
@@ -4575,11 +4582,25 @@ otp_16642(Config) when is_list(Config) ->
45754582 false = is_process_alive (Pid ),
45764583 ok .
45774584
4585+ pid_ref_table_size () ->
4586+ erts_debug :get_internal_state (pid_ref_table_size ).
4587+
4588+ check_pid_ref_table_size (PRTSz ) ->
4589+ receive after 500 -> ok end ,
4590+ case pid_ref_table_size () of
4591+ PRTSz ->
4592+ ok ;
4593+ NewPRTSz ->
4594+ ct :fail ({port_ref_table_size_mismatch , PRTSz , NewPRTSz })
4595+ end .
4596+
45784597alias_bif (Config ) when is_list (Config ) ->
4598+ PRTSz = pid_ref_table_size (),
45794599 alias_bif_test (node ()),
45804600 {ok , Peer , Node } = ? CT_PEER (),
45814601 alias_bif_test (Node ),
45824602 stop_node (Peer , Node ),
4603+ check_pid_ref_table_size (PRTSz ),
45834604 ok .
45844605
45854606alias_bif_test (Node ) ->
@@ -4624,10 +4645,12 @@ alias_bif_test(Node) ->
46244645
46254646
46264647monitor_alias (Config ) when is_list (Config ) ->
4648+ PRTSz = pid_ref_table_size (),
46274649 monitor_alias_test (node ()),
46284650 {ok , Peer , Node } = ? CT_PEER (),
46294651 monitor_alias_test (Node ),
46304652 stop_node (Peer , Node ),
4653+ check_pid_ref_table_size (PRTSz ),
46314654 ok .
46324655
46334656monitor_alias_test (Node ) ->
@@ -4711,6 +4734,7 @@ monitor_alias_test(Node) ->
47114734spawn_monitor_alias (Config ) when is_list (Config ) ->
47124735 % % Exit signals with immediate exit reasons are sent
47134736 % % in a different manner than compound exit reasons.
4737+ PRTSz = pid_ref_table_size (),
47144738 spawn_monitor_alias_test (undefined , node (), spawn_opt , normal ),
47154739 spawn_monitor_alias_test (undefined , node (), spawn_opt , make_ref ()),
47164740 spawn_monitor_alias_test (undefined , node (), spawn_request , normal ),
@@ -4723,6 +4747,7 @@ spawn_monitor_alias(Config) when is_list(Config) ->
47234747 spawn_monitor_alias_test (Peer3 , Node3 , spawn_request , normal ),
47244748 {ok , Peer4 , Node4 } = ? CT_PEER (),
47254749 spawn_monitor_alias_test (Peer4 , Node4 , spawn_request , make_ref ()),
4750+ check_pid_ref_table_size (PRTSz ),
47264751 ok .
47274752
47284753spawn_monitor_alias_test (Peer , Node , SpawnType , ExitReason ) ->
@@ -4863,6 +4888,28 @@ spawn_monitor_alias_test(Peer, Node, SpawnType, ExitReason) ->
48634888 ok
48644889 end .
48654890
4891+ alias_process_exit (Config ) when is_list (Config ) ->
4892+ Tester = self (),
4893+ CreatedAliases = make_ref (),
4894+ PRTSz = pid_ref_table_size (),
4895+ P = spawn_link (fun () ->
4896+ A0 = alias ([explicit_unalias ]),
4897+ A1 = alias ([reply ]),
4898+ A2 = monitor (process , Tester , [{alias , explicit_unalias }]),
4899+ A3 = monitor (process , Tester , [{alias , demonitor }]),
4900+ A4 = monitor (process , Tester , [{alias , reply_demonitor }]),
4901+ Tester ! CreatedAliases ,
4902+ receive after infinity -> ok end ,
4903+ some_module :some_function ([A0 , A1 , A2 , A3 , A4 ])
4904+ end ),
4905+ receive CreatedAliases -> ok end ,
4906+ PRTSz = erts_debug :get_internal_state (pid_ref_table_size ) - 5 ,
4907+ unlink (P ),
4908+ exit (P , kill ),
4909+ false = is_process_alive (P ),
4910+ check_pid_ref_table_size (PRTSz ),
4911+ ok .
4912+
48664913monitor_tag (Config ) when is_list (Config ) ->
48674914 % % Exit signals with immediate exit reasons are sent
48684915 % % in a different manner than compound exit reasons, and
0 commit comments