<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [CI] igt@perf@short-reads -fail - Failed assertion: ret == -1"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103183#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [CI] igt@perf@short-reads -fail - Failed assertion: ret == -1"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103183">bug 103183</a>
from <span class="vcard"><a class="email" href="mailto:matthew.auld@intel.com" title="mwa <matthew.auld@intel.com>"> <span class="fn">mwa</span></a>
</span></b>
<pre>8bytes is exactly the size of the report header, so probably just a case of
being unlucky with the read() giving us a REPORT_LOST, which just so happens to
fit into the non-protected region so we don't get an EFAULT.
First thought would just be:
diff --git a/tests/perf.c b/tests/perf.c
index ad62319e..fe8e32bf 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -3121,7 +3121,13 @@ test_short_reads(void)
/* A read that can't return a single record because it would result
* in a fault on buffer overrun should result in an EFAULT error...
*/
- ret = read(stream_fd, pages + page_size - 16, page_size);
+ do {
+ header = (void *)(pages + page_size - 16);
+ ret = read(stream_fd,
+ header,
+ page_size);
+ } while (header->type == DRM_I915_PERF_RECORD_OA_REPORT_LOST);
+
igt_assert_eq(ret, -1);
igt_assert_eq(errno, EFAULT);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are on the CC list for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>