anchor.diff:  	     simple_resolve2, simple_resolve3, leftover_name,
   	     re_register_name, name_exit, external_nodes, many_nodes,
   	     sync_0, global_groups_change, register_1, both_known_1,
  -	     lost_unregister, mass_death, garbage_messages
  +	     lost_unregister, mass_death, garbage_messages, flaw1
               ]
       end.
   
  
positive.code:                Node <- Nodes],
      Dir = proplists:get_value(priv_dir, Config),
      DataFile = filename:join([Dir, lists:concat(["global_", ?testcase])]),
      io:format("High-level trace on ~p\n", [DataFile]),
      file:write_file(DataFile, term_to_binary({high_level_trace, When, Data})).
  
  lock_global2(Id, Parent) ->
  
negative.code:     init_condition(Config),
      ok.
  
  %% This is scenario outlined in
  %% https://erlang.org/pipermail/erlang-questions/2020-October/100034.html.
  %% It illustrates that the algorithm of Global is flawed.
  flaw1(Config) ->
      Timeout = 360,
      ct:timetrap({seconds,Timeout}),
      init_high_level_trace(Timeout),
      init_condition(Config),
      OrigNames = global:registered_names(),
  
      [A, B, C, D] = OtherNodes = start_nodes([a, b, c, d], peer, Config),
      Nodes = lists:sort([node() | OtherNodes]),
      wait_for_ready_net(Config),
  
      F1 =
          fun(S0) ->
                  ct:sleep(100),
                  Str = "************",
                  S = Str ++ "  " ++ lists:flatten(S0) ++ "  " ++ Str,
                  io:format("~s\n", [S]),
                  [begin
                       RNs = rpc:call(N, global, registered_names, []),
                       W = rpc:call(N, global, whereis_name, [x]),
                       io:format("   === ~w ===\n", [N]),
                       io:format("       registered names: ~p", [RNs]),
                       io:format("       where is x:       ~p", [W])
                   end || N <- OtherNodes]
          end,
      F1("start"),
  
      true = rpc:call(A, erlang, disconnect_node, [C]),
      F1("after disconnecting c from a"),
  
      Pid = self(),
      yes = rpc:call(A, global, register_name, [x, Pid]),
      F1(io_lib:format("after registering x as ~p on a", [Pid])),
  
      true = rpc:call(B, erlang, disconnect_node, [D]),
      F1("after disconnecting d from b"),
  
      Pid2 = whereis(global_name_server),
      yes = rpc:call(B, global, re_register_name, [x, Pid2]),
      F1(io_lib:format("after re_register_name x as ~p on b", [Pid2])),
  
      pong = rpc:call(A, net_adm, ping, [C]),
      F1("finished after ping c from a"),
  
      pong = rpc:call(B, net_adm, ping, [D]),
  
      timer:sleep(1000),
  
      %% "You have all 4 nodes connected again, but A, B & C believe the
      %% name belongs to Y, while D believes it belongs to X."
      Pid2 = rpc:call(A, global, whereis_name, [x]),
      Pid2 = rpc:call(B, global, whereis_name, [x]),
      Pid2 = rpc:call(C, global, whereis_name, [x]),
      Pid  = rpc:call(D, global, whereis_name, [x]),
  
      lists:foreach(fun(N) ->
  			  rpc:call(N, ?MODULE, stop_tracer, [])
  		  end, Nodes),
      _ = rpc:call(A, global, unregister_name, [x]),
  
      F1("after unregistering x on node a"),
  
      %% _ = rpc:call(B, global, unregister_name, [y]),
      %% F1("after unregistering y on node b"),
  
      _ = rpc:call(C, global, unregister_name, [x]),
      F1("after unregistering x on node c"),
  
      ct:sleep(100),
      OrigNames = global:registered_names(),
      write_high_level_trace(Config),
      stop_nodes(OtherNodes),
      init_condition(Config),
      ok.
  
  wait_for_ready_net(Config) ->
      {Pid, MRef} = spawn_monitor(fun() ->
                                          wait_for_ready_net(?NODES, Config)
  