aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Grodzovsky2018-01-25 12:03:32 -0600
committerAndrey Grodzovsky2018-01-26 06:45:48 -0600
commit429bb5820d2bb1e99dba15c05e912226be1ad1fc (patch)
treec9e1e627333f4acc8a0a1e0f0adc53747892e055
parent5e239f3e3d18e13e6ffa3128407d37b3c7582593 (diff)
downloadexternal-libgbm-429bb5820d2bb1e99dba15c05e912226be1ad1fc.tar.gz
external-libgbm-429bb5820d2bb1e99dba15c05e912226be1ad1fc.tar.xz
external-libgbm-429bb5820d2bb1e99dba15c05e912226be1ad1fc.zip
amdgpu: Fix segfault in deadlock test.
If amdgpu_cs_query_fence_status terminates prematurely the BO sometimes is unmapped before helper thread writes a vlaue into it causing a segfault. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
-rw-r--r--tests/amdgpu/deadlock_tests.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index 9a428858..fc49c48a 100644
--- a/tests/amdgpu/deadlock_tests.c
+++ b/tests/amdgpu/deadlock_tests.c
@@ -245,6 +245,8 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
245 AMDGPU_TIMEOUT_INFINITE,0, &expired); 245 AMDGPU_TIMEOUT_INFINITE,0, &expired);
246 CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1); 246 CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1);
247 247
248 pthread_join(stress_thread, NULL);
249
248 r = amdgpu_bo_list_destroy(bo_list); 250 r = amdgpu_bo_list_destroy(bo_list);
249 CU_ASSERT_EQUAL(r, 0); 251 CU_ASSERT_EQUAL(r, 0);
250 252
@@ -254,6 +256,4 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
254 256
255 r = amdgpu_cs_ctx_free(context_handle); 257 r = amdgpu_cs_ctx_free(context_handle);
256 CU_ASSERT_EQUAL(r, 0); 258 CU_ASSERT_EQUAL(r, 0);
257
258 pthread_join(stress_thread, NULL);
259} 259}