Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3] [gdb/testsuite] New test: gdb.base/check-errno.exp
Date: Thu, 2 May 2024 12:37:23 +0200	[thread overview]
Message-ID: <6f42cbea-053c-4c49-b82b-428bf55ec101@suse.de> (raw)
In-Reply-To: <20240502013934.389445-1-kevinb@redhat.com>

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.

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.

Thanks,
- Tom


  parent reply	other threads:[~2024-05-02 10:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02  1:38 Kevin Buettner
2024-05-02  1:45 ` Kevin Buettner
2024-05-02 10:37 ` Tom de Vries [this message]
2024-05-02 16:02   ` Kevin Buettner
2024-05-02 16:45     ` Tom de Vries
2024-05-02 17:39       ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f42cbea-053c-4c49-b82b-428bf55ec101@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox