From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id E72ZAE1e/WHxMgAAWB0awg (envelope-from ) for ; Fri, 04 Feb 2022 12:11:41 -0500 Received: by simark.ca (Postfix, from userid 112) id E73511F3BA; Fri, 4 Feb 2022 12:11:40 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 6F3561EDEE for ; Fri, 4 Feb 2022 12:11:40 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 955C83858422 for ; Fri, 4 Feb 2022 17:11:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 955C83858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643994699; bh=VdVdIBq92Q/MFNCV5hJYSCr+c6v0JWwKkzevyJ7LKJk=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Ot0GEDqNcrJM2x9D3UKsKD89+JDKmo6+WIN+FiSpN3dW/EKIGE7zM/blS3HDMQVta /OCJ0cU6GJnFY+gVEy3mjQ3vZS1n8pmG+bFajueHQbdeSZqfK7oV7o11rmFdOwdQ/a hAwD6GwbBwImRg0foGOGj3gm/VpBsLl9HE7/Q/Vc= Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id D74653858D20 for ; Fri, 4 Feb 2022 17:11:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D74653858D20 Received: by mail-lf1-x132.google.com with SMTP id z19so13820355lfq.13 for ; Fri, 04 Feb 2022 09:11:12 -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=VdVdIBq92Q/MFNCV5hJYSCr+c6v0JWwKkzevyJ7LKJk=; b=mXL9lhYVjvKJcl/DjxPmlhS0Fj1HGuse1+itHW2V8egdaEh4OL6tYUdBvd0m2xYtyk UgXoVPSbwcsYj4pH2GRbOq9x+pC2KPD2kPfLonsgkGp4qe8oNN8ysV4F7dCq1H1Wm/2D Q0hUCpj0LlpuobOUvIPegYXwVi0rAq08x24KvQ84yRBPRTHS6LZdeKieecR0xPu5BpSk NBJTXyRuv+2ZCTLEEmtw1POtoQ82mt7tzt5VvWl4Bpe/IRPzLs9559ScHMJ6CfVLtWvA 1vAOb4qp5bvouDccW4RGrCqIbB1GJaIN4sDoyNOf5ZpI+o0FXHkAU9+U40AKbwpdEV3z MJog== X-Gm-Message-State: AOAM532T4vfYiWcoDb1OvfGovZyelhAbxrIbNgQTNX6NScKmmLORW7gR dR+OnBTPsH5zW0ZwLSYfpOooRjbIPu0= X-Google-Smtp-Source: ABdhPJzywG4SnnqfbkRG5U0Y1htbQexXd3B3ehiVLXC9hPvdhDFmYOOBha968cDedTMsBqUco7QYNg== X-Received: by 2002:a05:6512:e82:: with SMTP id bi2mr2977318lfb.590.1643994671720; Fri, 04 Feb 2022 09:11:11 -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 f22sm387671lfe.167.2022.02.04.09.11.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Feb 2022 09:11:11 -0800 (PST) Message-ID: <06f726f4-855e-239b-fd2c-8d0d57f45131@gmail.com> Date: Fri, 4 Feb 2022 18:11:10 +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 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> In-Reply-To: <87czk2o967.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Jacob Kroon via Gdb Reply-To: Jacob Kroon Cc: Jacob Kroon via Gdb Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On 2/4/22 18:04, Florian Weimer wrote: > * Jacob Kroon: > >> I couldn't see that address anywhere in the output of "show files". >> >> But I did "full" recording, and found a place where just stepping a >> single instruction broke gdb interpreting the backtrace, if that is of >> any help. This is what I do: >> >> 1. goto instruction 225037 >> 2. print backtrace (looks sane) >> 3. do "disas" >> 4. step one instruction with "stepi" >> 5. print backtrace (looks garbled) >> 6. do "disas" > > Interesting. Can you figure out where *rpo points right before things > go wrong? If the debuginfo doesn't work, this should do it: > > print (void *)$rax - 8 > This is what I get: > (gdb) record goto 225037 > Go backward to insn number 225037 > #0 dfs_traversal (rpo=rpo@entry=0x7fffffffd3b0, map=0x7ffff7fad590, do_reldeps=do_reldeps@entry=0x0) at dl-sort-maps.c:175 > 175 **rpo = map; > (gdb) print *rpo > $13 = (struct link_map **) 0x7fffffffd2c8 > (gdb) print (void *)$rax - 8 > $14 = (void *) 0x7fffffffd2c8 > Maybe also look at map->l_name at this point, and further up the stack, > in dl_sort_maps, at maps and nmaps. It looks like we run off the end of > the array and write garbage to other areas of the process. 8-( > And this: > (gdb) print map->l_name > $15 = 0x7ffff7fad500 "/tmp/ramdisk/jacob-linux-master-glibc/work/x86_64-linux/icedtea7-native/2.1.3-r1.0/icedtea-2.1.3/build/openjdk.build-boot/lib/amd64/libjava.so" I couldn't find the other variables, maybe I need to get more acquainted with the sourcecode here. > This must be caused by something unusual in the object dependencies. > > Thanks, > Florian > Jacob