public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "kevinb at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug compile/29541] New: gdb.compile/compile-cplus-anonymous.exp shows failures with glibc debuginfo installed
Date: Wed, 31 Aug 2022 04:03:34 +0000	[thread overview]
Message-ID: <bug-29541-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29541

            Bug ID: 29541
           Summary: gdb.compile/compile-cplus-anonymous.exp shows failures
                    with glibc debuginfo installed
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: compile
          Assignee: unassigned at sourceware dot org
          Reporter: kevinb at redhat dot com
  Target Milestone: ---

I'm seeing failures in the gdb test gdb.compile/compile-cplus-anonymous.exp
when run, with glibc debuginfo installed, on Fedora releases ranging from
Fedora 29 thru 37 (and rawhide, currently numbered 38 too).  I also see these
failures on Ubuntu 22.04 LTS once a missing symlink is installed for libcc1.so.

To reproduce this problem on Fedora, do (as root or using sudo):

[root@f36-1 gdb]# debuginfo-install -y glibc

Then, using a recent (or even old) build of upstream gdb, while in the gdb
directory (where the 'gdb' executable is found), do:

make check TESTS=gdb.compile/compile-cplus-anonymous.exp

I see the following failures / summary:

FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code anon_e (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code anon_e
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print anon_e (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code anon_u.aa (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code anon_u.aa
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print anon_u.aa
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code a.u.b (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code a.u.b
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print a.u.b (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code a.s.len (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code a.s.len
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print a.s.len (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code a.e (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code a.e
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print a.e (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code (*a.s.ptr != 'h')
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code (*a.s.ptr
!= 'h') (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print (*a.s.ptr != 'h')
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code A::BB (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code A::BB
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print A::BB (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code ABC (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code ABC
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print ABC (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code DEF (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code DEF
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print DEF (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code GHI (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code GHI
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print GHI (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code JKL (timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code JKL
(timeout)
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile print JKL (timeout)

                === gdb Summary ===

# of expected passes            1
# of unexpected failures        33
# of known failures             12

On Fedora, glibc debuginfo can be removed as follows:

[root@f36-1 gdb]# dnf remove -y glibc-debuginfo

Running gdb.compile/compile-cplus-anonymous.exp with glibc debuginfo NOT
installed shows this summary:

                === gdb Summary ===

# of expected passes            34
# of known failures             12

Testing an upstream build of GDB on Ubuntu 22.04 LTS shows:

# of untested testcases         1

I found that libcc1.so was missing.  So, I did:

root@u2204-1:~# cd /usr/lib/x86_64-linux-gnu/
root@u2204-1:/usr/lib/x86_64-linux-gnu# ln -sn libcc1.so.0 libcc1.so

With that symlink in place, I see the following failures / summary on Ubuntu
22.04 LTS:

FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code anon_e
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code anon_e
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code anon_u.aa
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code anon_u.aa
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code a.u.b
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code a.u.b
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code a.s.len
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code a.s.len
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code a.e
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code a.e
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code (*a.s.ptr != 'h')
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code (*a.s.ptr
!= 'h')
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code A::BB
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code A::BB
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code ABC
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code ABC
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code DEF
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code DEF
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code GHI
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code GHI
FAIL: gdb.compile/compile-cplus-anonymous.exp: compile code JKL
FAIL: gdb.compile/compile-cplus-anonymous.exp: result of compile code JKL

                === gdb Summary ===

# of expected passes            12
# of unexpected failures        22
# of known failures             12

Back on Fedora, if I run the initial part of the test by hand, without glibc
debuginfo installed AND without debuginfod, I see:

[kev@f36-1 gdb]$ ./gdb -q
testsuite/outputs/gdb.compile/compile-cplus-anonymous/compile-cplus-anonymous
Reading symbols from
testsuite/outputs/gdb.compile/compile-cplus-anonymous/compile-cplus-anonymous...
(gdb) set debuginfod enabled off
(gdb) set height 0
(gdb) set width 0
(gdb) break -qualified main
Breakpoint 1 at 0x401145: file
/ironwood1/sourceware-git/f36-master/bld/../../worktree-master/gdb/testsuite/gdb.compile/compile-cplus-anonymous.cc,
line 71.
(gdb) run
Starting program:
/mesquite2/sourceware-git/f36-master/bld/gdb/testsuite/outputs/gdb.compile/compile-cplus-anonymous/compile-cplus-anonymous 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main () at
/ironwood1/sourceware-git/f36-master/bld/../../worktree-master/gdb/testsuite/gdb.compile/compile-cplus-anonymous.cc:71
71        A a;
(gdb) compile code -- ;
(gdb) break 75
Breakpoint 2 at 0x401165: file
/ironwood1/sourceware-git/f36-master/bld/../../worktree-master/gdb/testsuite/gdb.compile/compile-cplus-anonymous.cc,
line 75.
(gdb) continue
Continuing.

Breakpoint 2, main () at
/ironwood1/sourceware-git/f36-master/bld/../../worktree-master/gdb/testsuite/gdb.compile/compile-cplus-anonymous.cc:75
75          + static_cast<int> (anon_e) + anon_u.bb + anon_s.len; // break here
(gdb) compile code var = anon_e
(gdb)

I.e. 'compile code var = anon_e' works as expected.

Enabling debuginfod (but still without glibc debuginfo installed system-wide)
shows the following behavior:

(gdb) set debuginfod enabled on
... [same commands and similar output shown above]
(gdb) compile code var = anon_e
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_PRE_GENERICIZE            | libcp1plugin
PLUGIN_GGC_MARKING               | libcp1plugin
PLUGIN_PRAGMAS                   | libcp1plugin
gdb command line:1:1: internal compiler error: in plugin_start_enum_type, at
libcc1/libcp1plugin.cc:1782
Please submit a full bug report, with preprocessed source.
See <http://bugzilla.redhat.com/bugzilla> for instructions.

GDB is hung at this point, but Ctrl-C returns the user to the GDB prompt. This
explains the (many) timeouts that I see on Fedora.

I see this same behavior when I disable debuginfod, but have glibc debuginfo
installed via the 'debuginfo-install glibc' command shown earlier. In the
interest of brevity (!), I won't paste that nearly identical output.  (The part
that's different is the use of 'set debuginfod enabled off')

On Ubuntu 22.04 LTS, when running the test by hand, without debuginfod, but
with the libcc1.so symlink fixed as mentioned earlier, I see:

(gdb) set debuginfod enabled off
... [snipped session which is largely the same as that shown for Fedora]
(gdb) compile code var = anon_e
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_PRE_GENERICIZE            | libcp1plugin
PLUGIN_GGC_MARKING               | libcp1plugin
PLUGIN_PRAGMAS                   | libcp1plugin
gdb command line:1:1: internal compiler error: in plugin_start_enum_type, at
libcc1/libcp1plugin.cc:1937
0x7fd261edbd8f __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7fd261edbe3f __libc_start_main_impl
        ../csu/libc-start.c:392
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
Compilation failed.
(gdb) 

The main difference when running this on Ubuntu is that, after printing out the
messages related to the internal compiler error, GDB does not hang, but instead
prints "Compilation failed.", returning to the GDB prompt.  This explains the
difference between the number of failures shown for Ubuntu versus Fedora.  On
Fedora, the remaining tests failed due to the timeout. On Ubuntu, some gdb
tests succeeded; those which attempt to 'compile' something else fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-08-31  4:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  4:03 kevinb at redhat dot com [this message]
2022-11-30 18:09 ` [Bug compile/29541] " tromey at sourceware dot org
2022-11-30 19:36 ` tromey at sourceware dot org
2022-12-01 15:39 ` cvs-commit at gcc dot gnu.org

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=bug-29541-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).