gem_mmap seg faults when all tests are run together. This occurs because
the new-object subtest closes the gem object, but short-mmap assumes
it still exists. Thus gem_mmap__cpu() returns nil for addr and memset()
seg faults. This patch makes new-object and short-mmap create and
close their own gem objects.
Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
igt_assert(ret == -1 && errno == ENOENT);
}
- igt_fixture
- handle = gem_create(fd, OBJECT_SIZE);
-
igt_subtest("new-object") {
+ handle = gem_create(fd, OBJECT_SIZE);
arg.handle = handle;
arg.offset = 0;
arg.size = OBJECT_SIZE;
igt_subtest("short-mmap") {
igt_assert(OBJECT_SIZE > 4096);
+ handle = gem_create(fd, OBJECT_SIZE);
addr = gem_mmap__cpu(fd, handle, 4096, PROT_WRITE);
memset(addr, 0, 4096);
munmap(addr, 4096);
+ gem_close(fd, handle);
}
igt_fixture