From 912a7d855600aadb937517ec5bab26bfd9b8953d Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 20 Aug 2013 06:39:43 +0200 Subject: [PATCH] tests/gem_concurrent_blit: Fix segmentation fault Apparently the simple changes introduced in commit 78865847f9fae7e590960f9836f2ec8b611a190e Author: Daniel Vetter AuthorDate: Mon Aug 19 07:23:49 2013 +0200 Commit: Daniel Vetter CommitDate: Mon Aug 19 08:09:25 2013 +0200 lib/drmtest: skip fixtures after an igt_skip pushed the stack space requirement for run_modes over some magic limit (I guess where the strack grow logic starts to fail, but I didn't check). Fix this by moving the data into .bss. Also add some asserts to check that fixtures aren't abused while at it (i.e. the useful parts of my debug printf/assert craze). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68299 Signed-off-by: Daniel Vetter --- lib/drmtest.c | 4 ++++ tests/gem_concurrent_blit.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 109fbc15..62b3f829 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -654,6 +654,8 @@ static enum { bool __igt_fixture(void) { + assert(!in_fixture); + if (igt_only_list_subtests()) return false; @@ -666,6 +668,8 @@ bool __igt_fixture(void) void __igt_fixture_end(void) { + assert(in_fixture); + in_fixture = false; longjmp(igt_subtest_jmpbuf, 1); } diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c index 69477748..d9ef5b56 100644 --- a/tests/gem_concurrent_blit.c +++ b/tests/gem_concurrent_blit.c @@ -333,11 +333,11 @@ run_basic_modes(struct access_mode *mode, run_wrap_func(mode, src, dst, dummy, do_gpu_read_after_write); } +drm_intel_bo *src[MAX_NUM_BUFFERS], *dst[MAX_NUM_BUFFERS], *dummy = NULL; + static void run_modes(struct access_mode *mode) { - drm_intel_bo *src[MAX_NUM_BUFFERS], *dst[MAX_NUM_BUFFERS], *dummy = NULL; - igt_fixture { bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr);