From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 110354] Confusing Junk in the results: Last errno: 25, Inappropriate ioctl for device Date: Mon, 08 Apr 2019 14:53:33 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0951907270==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id C11A78929A for ; Mon, 8 Apr 2019 14:53:33 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0951907270== Content-Type: multipart/alternative; boundary="15547352132.9aa51056.19191" Content-Transfer-Encoding: 7bit --15547352132.9aa51056.19191 Date: Mon, 8 Apr 2019 14:53:33 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D110354 --- Comment #1 from Arek Hiler --- 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 =3D 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.=20 The questions is now: do we really want to hunt all similar cases down? A r= ound 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 cha= nge 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 =3D 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 re= t =3D write(); igt_assert(ret);' for those functions where errno matters. --=20 You are receiving this mail because: You are the assignee for the bug.= --15547352132.9aa51056.19191 Date: Mon, 8 Apr 2019 14:53:33 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 11035= 4 from Arek Hiler
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 =3D 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.=20

The questions is now: do we really want to hunt all similar cases down? A r=
ound
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 cha=
nge
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 =3D 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 re=
t =3D
write(); igt_assert(ret);' for those functions where errno matters.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15547352132.9aa51056.19191-- --===============0951907270== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0951907270==--