From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id BCF253858D20 for ; Mon, 7 Feb 2022 12:32:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BCF253858D20 Received: by mail-lj1-x234.google.com with SMTP id z20so19348721ljo.6 for ; Mon, 07 Feb 2022 04:32:59 -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=Ok4t41SDRAA4iTrRrMP5iEBWv3+1FB8nJMjkhrahZUw=; b=4TucGJ1B/zXICg+pS1jeZ9hl73NwShP/5ssQNCJl3jaGZ3S+E/y+0uz8iHN8TP0msW 6aRCR5gs0XXA3Y3RBP8v1XGPeVtEeL33jj7XkIWt1v/7f8chrpBuDkyOevzdXS3TOHVM pBs6cuipzEXTj1kg9aB9ugIukcJuSQ54zbmn+BJpKRg+fqWK/OGCq1VOoQ7hksxdmfs+ obWvBDlth/Xc6JxMIxOrGz38SJppk13UjU+6rJ6C4zgVDP1LlGUyN/c/momfLufPp5jO 1pbJPaS4D3hS+Sinzf86ql/uhpLDbuyYi5zPFM/bF0+5sekFsyeqIJ2YRZ3vKfDCcEIY PFwg== X-Gm-Message-State: AOAM532sn24W11ny4DlZLHkBxvP9FdYSLOHBzVOQp9M+HA8hIhagOGrc x94WAZ1sbkkTGu13da0R6NgHmJ92GFk= X-Google-Smtp-Source: ABdhPJwaZV+czLk4fHaW03gCYoCRcIWt411Hg8Cs9tMPAH5H86fzUL1OjyJu2aCV2Gvt5Z9nH+TEWg== X-Received: by 2002:a2e:a80a:: with SMTP id l10mr8812889ljq.137.1644237178643; Mon, 07 Feb 2022 04:32:58 -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 b13sm1475959lfv.175.2022.02.07.04.32.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Feb 2022 04:32:58 -0800 (PST) Message-ID: <4ea94b1b-71f5-3fbe-e18d-dff61ba3d835@gmail.com> Date: Mon, 7 Feb 2022 13:32:57 +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: 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> From: Jacob Kroon In-Reply-To: <87wni6amk5.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 12:33:01 -0000 On 2/7/22 13:27, Florian Weimer wrote: > * Jacob Kroon: > >>> What I find really confusing is that this is not the result of a dlopen >>> call. I definitely would expect that the maps array contains *all* >>> objects that are being loaded. Clearly this is not the case here. >>> Somehow certain objects are missing, and then they get written into the >>> rpo array. >>> >>> Please try to find libjvm.so among the l_initfini arrays of the objects. >> >> I do find libjvm.so in a couple of the maps[]->l_initfini[]->l_name >> arrays, yes. > > Okay, and of course there is an assumption that those make it to the > maps. No wonder we run off the array. > >>> It must be present somewhere. I assume it's also on the main list, >>> which starts off at _rtld_global._dl_ns[0]._ns_loaded. >> >> Hmm how do I iterate over that data structure ? >> >> See below: >>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded[0]->l_name >>> $186 = 0x7ffff7ff1d97 "" >>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded[1]->l_name >>> $187 = 0x0 >>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded[2]->l_name >>> $188 = 0x0 >>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded->l_name >>> $189 = 0x7ffff7ff1d97 "" >>> (gdb) print _rtld_global._dl_ns[1]._ns_loaded->l_name >>> Cannot access memory at address 0x8 >>> (gdb) print _rtld_global._dl_ns[2]._ns_loaded->l_name >>> Cannot access memory at address 0x8 > > It's a list chained by l_prev/l_next. > Ok, yes "libjvm.so" is there, in multiple entries. Jacob