From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 5F8933894415 for ; Thu, 22 Apr 2021 09:29:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5F8933894415 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-xZVlNNTcMRu_DYiKVqzGnQ-1; Thu, 22 Apr 2021 05:29:41 -0400 X-MC-Unique: xZVlNNTcMRu_DYiKVqzGnQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9216E343A0; Thu, 22 Apr 2021 09:29:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-20.ams2.redhat.com [10.36.113.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DFE8F19D80; Thu, 22 Apr 2021 09:29:38 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: Florian Weimer via Libc-alpha , Simon Marchi , Pedro Alves , Kevin Buettner , gdb-patches@sourceware.org Subject: Re: [PATCH v3] nptl_db: Support different libpthread/ld.so load orders (bug 27744) References: <87tuo24kxi.fsf@oldenburg.str.redhat.com> <87czunoo5m.fsf@oldenburg.str.redhat.com> Date: Thu, 22 Apr 2021 11:29:56 +0200 In-Reply-To: (H. J. Lu's message of "Wed, 21 Apr 2021 15:35:27 -0700") Message-ID: <87bla6k6p7.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 09:29:45 -0000 * H. J. Lu: > On Wed, Apr 21, 2021 at 6:04 AM Florian Weimer via Libc-alpha > wrote: >> >> * Florian Weimer via Libc-alpha: >> >> > libthread_db is loaded once GDB encounters libpthread, and at this >> > point, ld.so may not have been processed by GDB yet. As a result, >> > _rtld_global cannot be accessed by regular means from libthread_db. >> > To make this work until GDB can be fixed, acess _rtld_global through >> > a pointer stored in libpthread. >> > >> > The new test does not reproduce bug 27744 with >> > --disable-hardcoded-path-in-tests, but is still a valid smoke test. >> > With --enable-hardcoded-path-in-tests, it is necessary to avoid >> > add-symbol-file because this can tickle a GDB bug. >> > >> > Fixes commit 1daccf403b1bd86370eb94edca794dc106d02039 ("nptl: Move >> > stack list variables into _rtld_global"). >> > >> > --- >> > v3: Mark test as UNSUPPORTED if launching gdb fails with ENOENT. >> > This is the version I'd like to commit soon. >> >> I've pushed this version given that Pedro acknowledged v2. >> > > I got > > FAIL: nptl/tst-pthread-gdb-attach > FAIL: nptl/tst-pthread-gdb-attach-static > > when testing i686 build on Fedora 33: > > [New LWP 1329590] > Trying host libthread_db library: > /export/build/gnu/tools-build/glibc-32bit-cet-gitlab/build-i686-linux/nptl_db/libthread_db.so.1. > dlopen failed: /export/build/gnu/tools-build/glibc-32bit-cet-gitlab/build-i686-linux/nptl_db/libthread_db.so.1: > wrong ELF class: ELFCLASS32. > thread_db_load_search returning 0 > > Is it possible to skip this when gdb and libthread_db.so.1 have different > ELC classes? Right, that seems a good idea. I've put together a hackish patch: nptl: Check for compatible GDB in nptl/tst-pthread-gdb-attach Thanks, Florian