From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rBT4Iz65M2baOAMAWB0awg (envelope-from ) for ; Thu, 02 May 2024 12:03:10 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YGFjv0hf; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 81F311E0C1; Thu, 2 May 2024 12:03:10 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 587FB1E092 for ; Thu, 2 May 2024 12:03:08 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00A5E385842A for ; Thu, 2 May 2024 16:03:08 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A1AE03858D20 for ; Thu, 2 May 2024 16:02:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A1AE03858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A1AE03858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714665771; cv=none; b=pN4W0Xjc3CtNFKPa/9zHyt+7hiDDNMOpfhlmEIKZufoi/De8UfFU9n9GUwYF18DX0fvR7gL2NoTL7FqoTP7OVf/mWm2epDGMdfLYluzTnNRXjztgMOyReUTxRAre8tmDO9G+5OS/87m2foV9l0uHAH9GW1CWUwQw6vqvSTiayz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714665771; c=relaxed/simple; bh=TXAMBMjc6vtOPKexzx7rOFueRFe/X46CESEh+5MkfkY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GHpiLUPGzFa1m5H/thBubGFA6OLOCDoeuLhXLI+1xiK0MAIuXv1TDedF+eHZMploQ3BsQhuBajoOH6tVa7iBgyxyBgrsX1eJkAulNGEJB+jpP/ffWx+IcO8ZKMukmDHakcfoC7J/mYK41fQW22JfIck5IUCpBmm9CG7yZZQkGw8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714665761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6gR+ZHQbPDTHbqK9ThlmRNe+v2jyyK7tiiqdb4Ul8zo=; b=YGFjv0hftd9UIo8CDSoEof1wi9Nql/wmw5A61PqWRSok2I3biYRtByk7pIyJdgJk9Xh6EJ +j8v5I6rohubJXxAyxrIvRnaRAqa4lf9/DNKagotNsA3OkS7yj350vZRMajPBDYErOHzxV 2Fl84u9okXGOEhkESON7L/M4ia3GS1s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-462-58MpXsLhMOyTy5FK0ynUyQ-1; Thu, 02 May 2024 12:02:40 -0400 X-MC-Unique: 58MpXsLhMOyTy5FK0ynUyQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A127B834FEE; Thu, 2 May 2024 16:02:39 +0000 (UTC) Received: from f39-zbm-amd (unknown [10.22.16.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4542BC01595; Thu, 2 May 2024 16:02:39 +0000 (UTC) Date: Thu, 2 May 2024 09:02:37 -0700 From: Kevin Buettner To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3] [gdb/testsuite] New test: gdb.base/check-errno.exp Message-ID: <20240502090237.69733376@f39-zbm-amd> In-Reply-To: <6f42cbea-053c-4c49-b82b-428bf55ec101@suse.de> References: <20240502013934.389445-1-kevinb@redhat.com> <6f42cbea-053c-4c49-b82b-428bf55ec101@suse.de> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org On Thu, 2 May 2024 12:37:23 +0200 Tom de Vries wrote: > On 5/2/24 03:38, Kevin Buettner wrote: > > Printing the value of 'errno' from GDB is sometimes problematic. The > > situation has improved in recent years, though there are still > > scenarios for which "print errno" doesn't work. > > > > The test, gdb.base/check-errno.exp, introduced by this commit, > > tests whether or not GDB can print errno with a binary compiled > > in the following different ways: > > > > - default: no switches aside from -g (and whatever else is added by the > > testing framework) > > - macros: macros included in the debuginfo; this is enabled by using > > -g3 when using gcc or clang > > - static: statically linked binary > > - static-macros: statically linked binary w/ macro definitions included > > in debuginfo > > - pthreads: libpthread linked binary > > - pthreads-macros: libpthread linked binary w/ macro definitions included > > in debuginfo > > - pthreads-static: Statically linked against libpthread > > - pthreads-static-macros: Statically linked against libpthread w/ macro > > definitions > > Hi, > > I applied the patch, and ran the test-case on leap 15.5. > > With glibc debuginfo installed, I get: > ... > FAIL: gdb.base/check-errno.exp: default: print errno > FAIL: gdb.base/check-errno.exp: default: print (int) errno > FAIL: gdb.base/check-errno.exp: default: check errno value from corefile > FAIL: gdb.base/check-errno.exp: static: print errno > FAIL: gdb.base/check-errno.exp: static: check errno value from corefile > FAIL: gdb.base/check-errno.exp: pthreads-static: print errno > FAIL: gdb.base/check-errno.exp: pthreads-static: check errno value from > corefile > ... > > Without glibc debuginfo installed, I get: > ... > FAIL: gdb.base/check-errno.exp: default: print (int) errno > FAIL: gdb.base/check-errno.exp: static: print errno > FAIL: gdb.base/check-errno.exp: static: check errno value from corefile > FAIL: gdb.base/check-errno.exp: pthreads-static: print errno > FAIL: gdb.base/check-errno.exp: pthreads-static: check errno value from > corefile > ... > > Then I ran it on tumbleweed. > > With and without glibc debuginfo installed, I get: > ... > FAIL: gdb.base/check-errno.exp: static: print errno > FAIL: gdb.base/check-errno.exp: static: check errno value from corefile > FAIL: gdb.base/check-errno.exp: pthreads-static: print errno > FAIL: gdb.base/check-errno.exp: pthreads-static: check errno value from > corefile > ... > > Looking in more detail at the first two FAILs of leap 15.5 with glibc > debug info installed, we have: > ... > (gdb) print errno^M > Cannot find thread-local storage for process 2259, shared library > /lib64/libc.so.6:^M > Cannot find thread-local variables on this target^M > (gdb) FAIL: gdb.base/check-errno.exp: default: print errno > print (int) errno^M > Cannot find thread-local storage for process 2259, shared library > /lib64/libc.so.6:^M > Cannot find thread-local variables on this target^M > (gdb) FAIL: gdb.base/check-errno.exp: default: print (int) errno > ... > > I think some of these are FAILs due to using a glibc version that > doesn't have libpthreads merged. Leap 15.5 uses glibc 2.31. > libpthreads was merged into libc in version 2.34. Current tumbleweed > uses 2.39. I can reproduce some of the above using old versions of Fedora. I'll attempt to xfail those cases too. > FWIW, in a fedora rawhide container I get: > ... > XPASS: gdb.base/check-errno.exp: static-macros: print (int) errno > XPASS: gdb.base/check-errno.exp: pthreads-static-macros: print (int) errno > ... > > That matches your description, but I think these xpasses shouldn't be there. Based on bug 31693, which you recently filed, I agree. Those should be FAILs. I'll update it so that those tests fail instead. Thanks! Kevin