From patchwork Mon Apr 8 14:53:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@freedesktop.org X-Patchwork-Id: 10889687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DF4114DB for ; Mon, 8 Apr 2019 14:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D55B283C9 for ; Mon, 8 Apr 2019 14:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D9FD2857F; Mon, 8 Apr 2019 14:53:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4DD1283C9 for ; Mon, 8 Apr 2019 14:53:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C05B8928F; Mon, 8 Apr 2019 14:53:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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) Received: by culpepper.freedesktop.org (Postfix, from userid 33) id BD70872167; Mon, 8 Apr 2019 14:53:33 +0000 (UTC) From: bugzilla-daemon@freedesktop.org To: dri-devel@lists.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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DRI X-Bugzilla-Component: IGT X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: arkadiusz.hiler@intel.com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: medium X-Bugzilla-Assigned-To: dri-devel@lists.freedesktop.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP https://bugs.freedesktop.org/show_bug.cgi?id=110354 --- Comment #1 from Arek Hiler --- diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 266aa832..b235b18c 100644 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. --- 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;