From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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> From: Jacob Kroon In-Reply-To: <87czk2o967.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 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: Fri, 04 Feb 2022 17:11:15 -0000 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