Bug 29919 - [gdb/testsuite] FAIL: gdb.base/print-symbol-loading.exp: shlib off: load shared-lib
Summary: [gdb/testsuite] FAIL: gdb.base/print-symbol-loading.exp: shlib off: load shar...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: testsuite (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 14.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-20 08:49 UTC by Tom de Vries
Modified: 2022-12-31 06:38 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2022-12-20 08:49:20 UTC
On ubuntu 22.04.1 x86_64, I run into:
...
(gdb) PASS: gdb.base/print-symbol-loading.exp: shlib off: set print symbol-loading off
sharedlibrary .*^M
Symbols already loaded for /lib/x86_64-linux-gnu/libc.so.6^M
Symbols already loaded for /lib/x86_64-linux-gnu/libpthread.so.0^M
(gdb) FAIL: gdb.base/print-symbol-loading.exp: shlib off: load shared-lib
...

The problem is that the libpthread line is not matched.

This is with glibc 2.35.
Comment 1 Sourceware Commits 2022-12-31 06:36:02 UTC
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=38ef8cc8e80fe7dc33152af1f85e7530e66f51b8

commit 38ef8cc8e80fe7dc33152af1f85e7530e66f51b8
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Dec 31 07:35:56 2022 +0100

    [gdb/testsuite] Fix gdb.base/print-symbol-loading.exp on ubuntu 22.04.1
    
    On ubuntu 22.04.1 x86_64, I run into:
    ...
    (gdb) PASS: gdb.base/print-symbol-loading.exp: shlib off: \
      set print symbol-loading off
    sharedlibrary .*^M
    Symbols already loaded for /lib/x86_64-linux-gnu/libc.so.6^M
    Symbols already loaded for /lib/x86_64-linux-gnu/libpthread.so.0^M
    (gdb) FAIL: gdb.base/print-symbol-loading.exp: shlib off: load shared-lib
    ...
    
    The test-case expects the libc.so line, but not the libpthread.so line.
    
    However, we have:
    ...
    $ ldd /lib/x86_64-linux-gnu/libc.so.6
            linux-vdso.so.1 (0x00007ffd7f7e7000)
            libgtk3-nocsd.so.0 => /lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f4468c00000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f4469193000)
            libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4468f3e000)
            libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4468f39000)
    ...
    so it's not unexpected that libpthread.so is loaded if libc.so is loaded.
    
    Fix this by accepting the libpthread.so line.
    
    Tested on x86_64-linux.
    
    PR testsuite/29919
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29919
Comment 2 Tom de Vries 2022-12-31 06:38:49 UTC
Fixed by commit.