From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 52UHD5m/eWAKGAAAWB0awg (envelope-from ) for ; Fri, 16 Apr 2021 12:47:21 -0400 Received: by simark.ca (Postfix, from userid 112) id 281551F104; Fri, 16 Apr 2021 12:47:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6BBEF1E01F for ; Fri, 16 Apr 2021 12:47:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F017E389244D; Fri, 16 Apr 2021 16:47:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F017E389244D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618591640; bh=jI1a4yudVjp0cc9z+EfA1yfpmLRrhRpuiwbFZ19Z9RA=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=emuICckC83Dr2/GxfH10UiyUbFv5ItDWvsQhIFjYUxlMc2On/GRaXXpkhWqfjpWF6 zbTf+AuCK4mS4jsIft4Ec0B5SD9DQNEKNxqyH7HB3NMRa2Vo9AeneIKTEcRed9zHry 8P5+WgiJ11cKl/oPX0tQ2VEopkHPi+asvMTMJwrw= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 6CBF5384B823 for ; Fri, 16 Apr 2021 16:47:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6CBF5384B823 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-285-xbyvaQ42P56SamHY6vNhUA-1; Fri, 16 Apr 2021 12:47:15 -0400 X-MC-Unique: xbyvaQ42P56SamHY6vNhUA-1 Received: by mail-wm1-f69.google.com with SMTP id f134-20020a1c1f8c0000b029012e03286b7bso1406599wmf.0 for ; Fri, 16 Apr 2021 09:47:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jI1a4yudVjp0cc9z+EfA1yfpmLRrhRpuiwbFZ19Z9RA=; b=inBxzq1V3+ptoq3q/VJ0Behz5oxBXKLKV9D17lokk1lEqABSLoJV0KuYvANux6VNPG StfH48sIUNV4UBwKCMKJtBRhKlgViI2RMqKlG+3oW6+bNn9ut6MX8P/lBODYOYbWt2NG hoXiq+o11ZrSBLmz/F6YQt43cvLheJ1MJgP4pIJ9urgWRSdQqYQTtWCcchIM4+TqWoVS s51ptslekuW7AankcCNAxvhRQrIF1OInKRI++tnmjhbuEYMZKYombnA9QZCXQwDrxEnT BuYQiLk8w7psyV9Sibk4b3ia3iQfBqBsW0fTWxcm0flHl1UmtSch130H4H2bBuZD43h+ 5J3w== X-Gm-Message-State: AOAM531MAwtkGWAIUL/cyVVr9xbhIKz0o6OmIvlUgwMgzLa6DLM4SYzw s/oL+3rlUMlEYTECSFG0ZG282Pa3ID0KX68jDTU/UBoto1VbiqKwf7zMM74KAhRJcEaLki7IanO WMnl24tylE6jfJicERaYMUQ== X-Received: by 2002:adf:dfc2:: with SMTP id q2mr126031wrn.128.1618591634228; Fri, 16 Apr 2021 09:47:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/mXiZqY/zitNvvLbNQkvhD/un0oi291BAschdyNAxpO09wNOZ5CCeJBYAKSWJin4P5VQyQQ== X-Received: by 2002:adf:dfc2:: with SMTP id q2mr126016wrn.128.1618591634054; Fri, 16 Apr 2021 09:47:14 -0700 (PDT) Received: from ?IPv6:2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3? ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id w22sm9978617wmc.13.2021.04.16.09.47.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Apr 2021 09:47:13 -0700 (PDT) Subject: Re: [PATCH glibc] nptl_db: different libpthread/ld.so load orders (bug 27744) To: Florian Weimer 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> <87blaenprw.fsf@oldenburg.str.redhat.com> Message-ID: Date: Fri, 16 Apr 2021 17:47:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <87blaenprw.fsf@oldenburg.str.redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Pedro Alves via Gdb-patches Reply-To: Pedro Alves Cc: Emil Velikov , libc-alpha@sourceware.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 16/04/21 17:43, Florian Weimer wrote: > * Pedro Alves: > >> On 16/04/21 17:28, Florian Weimer wrote: >>> * Pedro Alves: >>> >>>> 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? >>> >>> Yes, I believe this is what happens. >>> >> >> 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 loaded >> refers to reading symbols -- ld.so has been loaded by the inferior already >> 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: > > “ > libthread_db is loaded once GDB encounters libpthread, and at this > point, ld.so may not have been processed by GDB yet. > ” Sounds good. > >> 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-) LOL I skimmed the patch, and FWIW, it LGTM. Just spotted a couple typos: > +/* This test runs GDB against a forked copy of itself, to check > + whether libthreaddb can be loaded, and that access to thread-local libthreaddb -> libthread_db > +/* This function implements the subprocess un der test. It creates a "un der" -> "under" Thanks, Pedro Alves