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 73079384A02B for ; Fri, 16 Apr 2021 16:43:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 73079384A02B 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-214-ZrU4kPO2OomBRma7DQt9Rw-1; Fri, 16 Apr 2021 12:43:35 -0400 X-MC-Unique: ZrU4kPO2OomBRma7DQt9Rw-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 87C72501E4; Fri, 16 Apr 2021 16:43:31 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D87732619D; Fri, 16 Apr 2021 16:43:29 +0000 (UTC) From: Florian Weimer To: Pedro Alves Cc: Simon Marchi , libc-alpha@sourceware.org, gdb-patches@sourceware.org, Emil Velikov , Kevin Buettner Subject: Re: [PATCH glibc] nptl_db: different libpthread/ld.so load orders (bug 27744) References: <87sg3qnrz3.fsf@oldenburg.str.redhat.com> <73b32cc6-e201-8bac-e442-e3dddcc01e0d@polymtl.ca> <625ec5fe-bd09-860a-f617-745042b94011@redhat.com> <87fszqnqi3.fsf@oldenburg.str.redhat.com> Date: Fri, 16 Apr 2021 18:43:47 +0200 In-Reply-To: (Pedro Alves's message of "Fri, 16 Apr 2021 17:33:14 +0100") Message-ID: <87blaenprw.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; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=unavailable 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: Fri, 16 Apr 2021 16:43:39 -0000 * Pedro Alves: > On 16/04/21 17:28, Florian Weimer wrote: >> * Pedro Alves: >>=20 >>> IIRC, the order which libraries are loaded by GDB hasn't changed. The >>> issue is that until recently (before glibc 1daccf403b1b), the stacks >>> lists lived in libpthread (stack_used/__stack_user), so the fact that >>> GDB loaded libthread_db.so before ld.so's symbols were loaded didn't >>> make a difference. Now they were moved to ld.so, so libthread_db.so >>> can't find them until GDB reads the ld.so symbols. Is this assessment >>> correct? >>=20 >> Yes, I believe this is what happens. >>=20 > > OK, I believe what is confusing in your commit log was the reference to > two different kinds of "loaded": > > "libthread_db is loaded once GDB encounters libpthread, and at this > point, ld.so may not have been loaded yet. " > > The first loaded is about GDB dlopening libthread_db.so. The second load= ed > refers to reading symbols -- ld.so has been loaded by the inferior alread= y > at that point. > > It would be clearer as: > > "libthread_db is loaded once GDB encounters libpthread, and at this > point, ld.so's symbols may not have been read by GDB yet. " I'm going to go with: =E2=80=9C libthread_db is loaded once GDB encounters libpthread, and at this point, ld.so may not have been processed by GDB yet. =E2=80=9D > If I understood that correctly, then the following sentence is also a > bit confusing: > > "As a result, _rtld_global cannot be accessed by regular means from > libthread_db." > > Because that sounds to me like you were perhaps talking about some > magic means to reference globals, some magic relocations, or some > other magic voodoo only understood by glibc experts. We use the magic that GDB provides to us (ps_pglobal_lookup, I think). I thought that this was understood by GDB experts only. 8-) Thanks, Florian