From: Dave Airlie <airlied@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] syncobj: add test for handle->fd + close twice.
Date: Thu, 21 Dec 2017 12:59:37 +1000 [thread overview]
Message-ID: <20171221025937.32670-1-airlied@gmail.com> (raw)
From: Dave Airlie <airlied@redhat.com>
This demos a bug found in the vulkan CTS that causes
VFS: Close: file count is 0
in dmesg, and ls /proc/self/fd to oops.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
tests/syncobj_basic.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/syncobj_basic.c b/tests/syncobj_basic.c
index acc4a641..42fc99f8 100644
--- a/tests/syncobj_basic.c
+++ b/tests/syncobj_basic.c
@@ -177,6 +177,22 @@ test_valid_cycle(int fd)
syncobj_destroy(fd, second_handle);
}
+static void
+test_create_close_twice(int fd)
+{
+ uint32_t handle;
+ int syncobj_fd;
+
+ handle = syncobj_create(fd, 0);
+ syncobj_fd = syncobj_handle_to_fd(fd, handle, 0);
+ close(syncobj_fd);
+
+ syncobj_fd = syncobj_handle_to_fd(fd, handle, 0);
+ close(syncobj_fd);
+
+ syncobj_destroy(fd, handle);
+}
+
static bool has_syncobj(int fd)
{
uint64_t value;
@@ -231,4 +247,7 @@ igt_main
igt_subtest("test-valid-cycle")
test_valid_cycle(fd);
+ igt_subtest("test-create-close-twice")
+ test_create_close_twice(fd);
+
}
--
2.14.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2017-12-21 2:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 2:59 Dave Airlie [this message]
2017-12-21 8:33 ` [PATCH i-g-t] syncobj: add test for handle->fd + close twice Chris Wilson
2017-12-21 9:04 ` [PATCH igt] igt/syncobj: Stress handle->fd/close Chris Wilson
2017-12-21 10:54 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-21 13:11 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171221025937.32670-1-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.