From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 080A4385841A for ; Mon, 7 Feb 2022 17:04:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 080A4385841A Received: by mail-lj1-x22d.google.com with SMTP id o17so20621601ljp.1 for ; Mon, 07 Feb 2022 09:04:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/mzbDeVOuV5HUcyEbxGiBcleEKIQmGVNwsWvRCd0sc4=; b=YKdH1Zf876zS9XUsUMbBFrPYnFHgD2X8odwS17AdxJ56PWp8g8RRJTmg65nnWOt4z/ IWiggAiuj3LrGQKxjagDDWK4PbMtl2qDmTmyN2R91dEZNHU4j36qT9pgtYFEcIxlB82f 7CJoG6TI8esPH/FjB9LIVPqq50oTjKMgB5Y+rXyiNTioFxEbQVtMi0iCyN8T6z5hl8xL pQDE36zL3mq3pa9M8thxecP+lrqaMat3fuPdY5YltD9w2Gex25LxqrTcx4TU2GYIKEYb XmpV1aQke0b45Hb6i/q0S+62t30g0rVwrzXAaGOajN/bfzaYjkCK2DoI/qSMEJxozhht fm+Q== X-Gm-Message-State: AOAM533O/Guky/7OpsloBJhxOVlI6NiSH3wS0+uMPhM1LXOvdFDWHMbP xcWUTDwaPLGW9uJMGcOMC7c= X-Google-Smtp-Source: ABdhPJxqfqcXdBsTFMpQpsfseh2TUJR3RmVKij0fm+4nLGdvdPucpL8J9NsKeecw1QtuXViRXeUFEA== X-Received: by 2002:a2e:8794:: with SMTP id n20mr215818lji.531.1644253483794; Mon, 07 Feb 2022 09:04:43 -0800 (PST) Received: from [192.168.10.175] (37-247-29-68.customers.ownit.se. [37.247.29.68]) by smtp.gmail.com with ESMTPSA id b31sm1559918lfv.163.2022.02.07.09.04.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Feb 2022 09:04:43 -0800 (PST) Message-ID: <14d95bb6-b8b3-32bc-8a9e-d5ea258d8a94@gmail.com> Date: Mon, 7 Feb 2022 18:04:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Debugging ld.so in gdb Content-Language: en-US To: Florian Weimer Cc: cltang@codesourcery.com, adhemerval.zanella@linaro.org, Jacob Kroon via Gdb References: <29e0ef71-4706-9b0f-2a68-e12c54120d8e@gmail.com> <8735kypwcd.fsf@oldenburg.str.redhat.com> <87y22qognw.fsf@oldenburg.str.redhat.com> <87h79eobq1.fsf@oldenburg.str.redhat.com> <87czk2o967.fsf@oldenburg.str.redhat.com> <06f726f4-855e-239b-fd2c-8d0d57f45131@gmail.com> <878ruqo8o2.fsf@oldenburg.str.redhat.com> <8d9d02de-1a59-1f4d-dbcf-050b65abef29@gmail.com> <93cd41d6-e333-f31e-96bb-2f34a88f164f@gmail.com> <875ypqc2ma.fsf@oldenburg.str.redhat.com> <3e08e7c7-05f5-16f2-50cb-036687386997@gmail.com> <87wni6amk5.fsf@oldenburg.str.redhat.com> <4ea94b1b-71f5-3fbe-e18d-dff61ba3d835@gmail.com> <87zgn293du.fsf@oldenburg.str.redhat.com> <87y22m7iae.fsf@oldenburg.str.redhat.com> From: Jacob Kroon In-Reply-To: <87y22m7iae.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2022 17:04:47 -0000 On 2/7/22 17:28, Florian Weimer wrote: > * Florian Weimer: > >> * Jacob Kroon: >> >>> I managed to build glibc master, and yes it also crashes. Reverting the >>> suspicious commit: >>> >>> commit 15a0c5730d1d5aeb95f50c9ec7470640084feae8 >>> Author: Chung-Lin Tang >>> Date: Thu Oct 21 21:41:22 2021 +0800 >>> >>> elf: Fix slow DSO sorting behavior in dynamic loader (BZ #17645) >>> >>> fixes the crash. Adding a couple of more people. >> >> Sorry, that is completely expected because this is where the faulty code >> was added. >> >> I plan to stare at _dl_map_object_deps a bit, to figure out where the >> discrepancy between l_initfini for the main program and the loaded >> objects comes from. > > I can see that we do not add l_fake objects (that failed to load) to the > main search list (and nlist is not incremented). But we do not remove > them from the individual list of dependencies, leading to this > discrepancy. > > This would be consistent with this bug report: > > Dynamic loader DFS algorithm segfaults on missing libraries > > > If you run with GLIBC_TUNABLES=glibc.rtld.dynamic_sort=0, do you see > “not found” lines in the ldd output? > I assume you meant "glibc.rtld.dynamic_sort=1", and not "glibc.rtld.dynamic_sort=0", since that also crashes. With "1" I see no crash, and three entries of "libjvm.so => not found". > If yes, do these surprising libjvm.so objects have l_fake set in their > link map? > Yes, looking at the "libjvm.so" entries in rpo[] right before the crash, I see l_faked == 1 for all three, and *only* for those three. Jacob