From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id EE1D21F4B4 for ; Fri, 16 Apr 2021 16:43:43 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27AD63892456; Fri, 16 Apr 2021 16:43:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27AD63892456 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618591421; bh=1sKmEFrlSPo+q1gRrISGXhCXfY5UxcGFVqMLQd9CpfM=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lpXo364J0PrXuVJOmt5DonVmHdmFOfDz6VQ3YQHQrz9P4ZU8gT1nWDweboDDE8Mya m3OUANpYBOxbHbv6MF2AxdXk/qxOxpEm7z7MsYODst6BakAPlOa/xFRbuZY1kRQ4sV E75FCtfSsc8lLSiz00LbT/ew7Xs0ZRaID4puS/FI= 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) To: Pedro Alves 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-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: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: libc-alpha@sourceware.org, gdb-patches@sourceware.org, Simon Marchi , Kevin Buettner Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * 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