[Bug 110354] Confusing Junk in the results: Last errno: 25, Inappropriate ioctl for device

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 8 14:53:33 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=110354

--- Comment #1 from Arek Hiler <arkadiusz.hiler at intel.com> ---
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 266aa832..b235b18c 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -984,8 +984,11 @@ void igt_debug_wait_for_keypress(const char *var)
 {
        struct termios oldt, newt;

-       if (!isatty(STDIN_FILENO))
+       if (!isatty(STDIN_FILENO)) {
+               errno = 0; /* otherwise may be ENOTTY */
                return;
+       }
+

        if (!igt_interactive_debug)
                return;

Found the culprit in this particular case. This would suppress most of the
weird errno logged in kms tests. 

The questions is now: do we really want to hunt all similar cases down? A round
of gdb through a couple of tests with 'watch errno' shows that it gets set to
non-zero value about a dozen times every single subtest. Depending when we hit
an assert we may get any of those printed out adding to confusion.

I see 3 options:
1. make sure that errno is reset to 0 by everything that touches it and change
my nickname to Sisyphus
2. get rid of printing errno in igt_assert(), but then lose valuable
information for all those igt_assert(write(...));
3. change igt_assert*(expr,...) macros so that they 'errno = 0;' before
evaluating expr

I think that 3 makes the most sense, then we can quickly go through all the
4000-ish of calls we have to make sure that we don't have any weird 'int ret =
write(); igt_assert(ret);' for those functions where errno matters.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190408/d7d89c76/attachment.html>


More information about the dri-devel mailing list