public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug testsuite/27690] FAIL: gdb.threads/check-libthread-db.exp: user-initiated check: libpthread.so not initialized (pattern 2)
Date: Tue, 13 Jul 2021 11:49:19 +0000	[thread overview]
Message-ID: <bug-27690-4717-2NwJgL8hJV@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27690-4717@http.sourceware.org/bugzilla/>

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Managed to bisect this in glibc, as follows.

I. 

Build glibc using pretty basic script:
...
$ more ~/glibc/scripts/build.sh
#!/bin/sh

set -e

pwd=$(pwd -P)

src=$pwd/src
build=$pwd/build
install=$pwd/install

rm -Rf $build $install
mkdir $build $install

cd $build

$src/configure --prefix=$install

make -j5
...

II.

Run test-case using custom build glibc (using recipe from
https://sourceware.org/glibc/wiki/Testing/Builds#Compile_against_glibc_build_tree):
...
diff --git a/gdb/testsuite/gdb.threads/check-libthread-db.exp
b/gdb/testsuite/gdb.threads/c
heck-libthread-db.exp
index dfb3bad3712..78bb881c6b3 100644
--- a/gdb/testsuite/gdb.threads/check-libthread-db.exp
+++ b/gdb/testsuite/gdb.threads/check-libthread-db.exp
@@ -27,15 +27,23 @@ if [gdb_debug_enabled] {

 standard_testfile

+set GLIBC "/home/vries/glibc/build"
+set f1
"-Wl,-rpath=${GLIBC}:${GLIBC}/math:${GLIBC}/elf:${GLIBC}/dlfcn:${GLIBC}/nss:
${GLIBC}/nis:${GLIBC}/rt:${GLIBC}/resolv:${GLIBC}/crypt:${GLIBC}/nptl:${GLIBC}/dfp" 
+
+set f2 "-Wl,--dynamic-linker=${GLIBC}/elf/ld.so"
+
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-        executable debug] != "" } {
+        executable [list debug additional_flags=$f1 additional_flags=$f2]] !=
"" } {
     return -1
 }

+
 with_test_prefix "user-initiated check" {

     # User-initiated check with libthread_db not loaded.
     clean_restart ${binfile}
+    gdb_test "set auto-load safe-path /"
+    gdb_test "set libthread-db-search-path /home/vries/glibc/build/nptl_db"

     gdb_test "maint show check-libthread-db" \
        "Whether to check libthread_db at load time is off."
@@ -81,6 +89,8 @@ with_test_prefix "automated load-time check" {
     # Automated load-time check with NPTL uninitialized.
     with_test_prefix "libpthread.so not initialized" {
        clean_restart ${binfile}
+       gdb_test "set auto-load safe-path /"
+       gdb_test "set libthread-db-search-path /home/vries/glibc/build/nptl_db"

        gdb_test_no_output "maint set check-libthread-db 1"
        gdb_test_no_output "set debug libthread-db 1"
@@ -99,6 +109,8 @@ with_test_prefix "automated load-time check" {
     # Automated load-time check with NPTL fully operational.
     with_test_prefix "libpthread.so fully initialized" {
        clean_restart ${binfile}
+       gdb_test "set auto-load safe-path /"
+       gdb_test "set libthread-db-search-path /home/vries/glibc/build/nptl_db"

        gdb_test_no_output "maint set check-libthread-db 1"
        gdb_test_no_output "set debug libthread-db 1"
...

Bisects to (as indeed suggested here
https://sourceware.org/pipermail/gdb-patches/2021-July/180867.html by Simon):
...
$ git bisect bad
1daccf403b1bd86370eb94edca794dc106d02039 is the first bad commit
commit 1daccf403b1bd86370eb94edca794dc106d02039
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Nov 16 19:33:30 2020 +0100

    nptl: Move stack list variables into _rtld_global
...

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

  parent reply	other threads:[~2021-07-13 11:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 17:15 [Bug threads/27690] New: " vries at gcc dot gnu.org
2021-04-05 21:26 ` [Bug threads/27690] " vries at gcc dot gnu.org
2021-07-07 14:10 ` [Bug testsuite/27690] " vries at gcc dot gnu.org
2021-07-13 11:49 ` vries at gcc dot gnu.org [this message]
2021-07-13 13:56 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:11 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:12 ` vries 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-27690-4717-2NwJgL8hJV@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).