aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server_io.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-11-19 15:35:05 +0100
committerBjörn Gustavsson <[email protected]>2012-11-19 15:35:05 +0100
commit011bb8a503c7ff967996c32a656d3e6436d017f7 (patch)
tree08d6645a0cd74ea90a50748c015cd3146895b5ed /lib/test_server/src/test_server_io.erl
parent2cec24c37208c360123740f3af6b09aa33697f5f (diff)
downloadotp-011bb8a503c7ff967996c32a656d3e6436d017f7.tar.gz
otp-011bb8a503c7ff967996c32a656d3e6436d017f7.tar.bz2
otp-011bb8a503c7ff967996c32a656d3e6436d017f7.zip
Fix race condition in test_server_io
In test_server_io:gc/1 we collect the group leaders for all processes. We must handle the case that a process has died after processes/0 was called and process_info(P, group_leader) is called.
Diffstat (limited to 'lib/test_server/src/test_server_io.erl')
-rw-r--r--lib/test_server/src/test_server_io.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/test_server/src/test_server_io.erl b/lib/test_server/src/test_server_io.erl
index e960b3087a..777b377201 100644
--- a/lib/test_server/src/test_server_io.erl
+++ b/lib/test_server/src/test_server_io.erl
@@ -307,8 +307,10 @@ do_print_buffered(Q0, St) ->
gc(#st{gls=Gls0}) ->
InUse0 = [begin
- {group_leader,GL} = process_info(P, group_leader),
- GL
+ case process_info(P, group_leader) of
+ {group_leader,GL} -> GL;
+ undefined -> undefined
+ end
end || P <- processes()],
InUse = ordsets:from_list(InUse0),
Gls = gb_sets:to_list(Gls0),