From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id JfhJEXW6eWA8FwAAWB0awg (envelope-from ) for ; Fri, 16 Apr 2021 12:25:25 -0400 Received: by simark.ca (Postfix, from userid 112) id 3764B1F104; Fri, 16 Apr 2021 12:25:25 -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 6F36A1E813 for ; Fri, 16 Apr 2021 12:25:24 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD4D4398B40B; Fri, 16 Apr 2021 16:25:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD4D4398B40B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618590323; bh=Fpa036qu4TIsVUA1fFGIB/xLajiIeALjoUsgJeraL1I=; 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=QbzLxdIcXPk9qzyTKNhlc+2Alck5ChLpJ4Q/706t/7WVSA/X2OqMg8FiqrLAPMdo7 c7gfMpq+jqhyDgJnBMRKpPyRlyojRe6K0T5jJH+Otf1uXLi2ny0SFQ/VwX0YU2vgXn dvOQ/TvMWZb57RcQnyrlNsBPrCzPcDBsbspP/pgM= 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 854B73844025 for ; Fri, 16 Apr 2021 16:25:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 854B73844025 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-fHs5x4v1Oeu9rRIt5-pXyg-1; Fri, 16 Apr 2021 12:25:18 -0400 X-MC-Unique: fHs5x4v1Oeu9rRIt5-pXyg-1 Received: by mail-wm1-f70.google.com with SMTP id v65-20020a1cde440000b029012853a35ee7so3376520wmg.2 for ; Fri, 16 Apr 2021 09:25:17 -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=Fpa036qu4TIsVUA1fFGIB/xLajiIeALjoUsgJeraL1I=; b=EWajAGyZmwDpdIuFuveAxKGtZ6bbMR/+NUZolAwExkIEL4YS6n3kCjAswLk5cNghzD mZDJ7lbNV/1GR2pGxR5Ia/M/KrY7tzud4KQxJHbOmV54Mo3dAt2ffe67dTIHyvyosjCw +pkdi2/z0VAuF/n5YkgTDjPIwMtpIC/psnBuvW7Xx3znM73MTUUbiaFw5HTLrSstWvgn UQTy38Cb+tX05eIM0NQZr3rFXBj4v23nbUVeTm0+9vwJHu8n2DMuu2P4hVQyZiT4oW11 dnVca6F8AI8vtSxfkLxeWkO4lEKyLXTIfn7Bk9AhZ1/DnKyGdFCpPzzPJNoAvRiHrH9I SVCw== X-Gm-Message-State: AOAM5302gGfDL5BgeA2cwNXvvsKDA+sM3iNxh0OQIrD8+I9uQ7OF2cOI nC4rsNQp+2n9QFix9wVU1hGlZVQev9C22y1OaKaECPr4xQtqlqAy6RPtqclICjMtd1mrcRYoB87 ynZ8AsPGkEr5cpq5z3QdF2A== X-Received: by 2002:adf:a40c:: with SMTP id d12mr1415wra.91.1618590316869; Fri, 16 Apr 2021 09:25:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/qcAJTGQyEjU16lAyH3pe1wMVB/WZVFEcWLoTHzO+EuIVUEVqce0oduXT2zN4J3vwiVsVMw== X-Received: by 2002:adf:a40c:: with SMTP id d12mr1405wra.91.1618590316752; Fri, 16 Apr 2021 09:25:16 -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 n9sm9420828wmo.27.2021.04.16.09.25.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Apr 2021 09:25:16 -0700 (PDT) Subject: Re: [PATCH glibc] nptl_db: different libpthread/ld.so load orders (bug 27744) To: Simon Marchi , Florian Weimer , libc-alpha@sourceware.org, gdb-patches@sourceware.org References: <87sg3qnrz3.fsf@oldenburg.str.redhat.com> <73b32cc6-e201-8bac-e442-e3dddcc01e0d@polymtl.ca> Message-ID: <625ec5fe-bd09-860a-f617-745042b94011@redhat.com> Date: Fri, 16 Apr 2021 17:25:15 +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: <73b32cc6-e201-8bac-e442-e3dddcc01e0d@polymtl.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 16/04/21 17:07, Simon Marchi wrote: > > Can this state (libpthread loaded, ld.so not loaded) really happen > during the normal lifetime of a process? My understanding is that this > state happens when attaching only because GDB reads the shared libraries > from the process in an undefined order, so libpthread may be discovered > before ld.so. So we present to libthread_db a state that doesn't really > make sense. I don't think it's random from GDB's perspective -- GDB reads the shared library list of out of the link map, so it should be reading them in link map order. 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? Pedro Alves