From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /Kk4Oz1f/WElMwAAWB0awg (envelope-from ) for ; Fri, 04 Feb 2022 12:15:41 -0500 Received: by simark.ca (Postfix, from userid 112) id E23281F3BA; Fri, 4 Feb 2022 12:15:41 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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 6B16C1EDEE for ; Fri, 4 Feb 2022 12:15:41 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E46FD3858429 for ; Fri, 4 Feb 2022 17:15:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E46FD3858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643994940; bh=CgcA4N4QrfSKwUoAI03v6ihi8wA15hdMYm1pwbtybwg=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EgCWgMBDmp7hRyTWtTUA257O0C//Rep9rcYmGakEaGQsgVLaDIdvgydO0l8I1qZrN HsUEN436lProipqe3u7tKg4AoLytfx5E93/A4R+JjBZ1ykygcZoeuNKl9OoNx/rSgl ALiEWsWvmVb2GvznZ1Ez0sEZrCCvnGCkvjk6nv/U= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 070BB3858D20 for ; Fri, 4 Feb 2022 17:15:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 070BB3858D20 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-226-mk-qzzJqMKmzwDoHlERQPA-1; Fri, 04 Feb 2022 12:15:13 -0500 X-MC-Unique: mk-qzzJqMKmzwDoHlERQPA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8FABD1091DA9; Fri, 4 Feb 2022 17:15:12 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.205]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDC358588C; Fri, 4 Feb 2022 17:15:11 +0000 (UTC) To: Jacob Kroon Subject: Re: Debugging ld.so in 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> Date: Fri, 04 Feb 2022 18:15:09 +0100 In-Reply-To: <06f726f4-855e-239b-fd2c-8d0d57f45131@gmail.com> (Jacob Kroon's message of "Fri, 4 Feb 2022 18:11:10 +0100") Message-ID: <878ruqo8o2.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Florian Weimer via Gdb Reply-To: Florian Weimer Cc: Jacob Kroon via Gdb Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" * Jacob Kroon: >> Interesting. Can you figure out where *rpo points right before things >> go wrong? If the debuginfo doesn't work, this should do it: >>=20 >> print (void *)$rax - 8 >>=20 > > This is what I get: > >> (gdb) record goto 225037 >> Go backward to insn number 225037 >> #0 dfs_traversal (rpo=3Drpo@entry=3D0x7fffffffd3b0, map=3D0x7ffff7fad59= 0, do_reldeps=3Ddo_reldeps@entry=3D0x0) at dl-sort-maps.c:175 >> 175=09 **rpo =3D map; >> (gdb) print *rpo >> $13 =3D (struct link_map **) 0x7fffffffd2c8 >> (gdb) print (void *)$rax - 8 >> $14 =3D (void *) 0x7fffffffd2c8 I wonder where 0x7fffffffd2c8 is located. Maybe on the minimal malloc heap? >> 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-( >>=20 > > And this: > >> (gdb) print map->l_name=20 >> $15 =3D 0x7ffff7fad500 "/tmp/ramdisk/jacob-linux-master-glibc/work/x86_6= 4-linux/icedtea7-native/2.1.3-r1.0/icedtea-2.1.3/build/openjdk.build-boot/l= ib/amd64/libjava.so" > > I couldn't find the other variables, maybe I need to get more acquainted > with the sourcecode here. I think you have to enter =E2=80=9Cup=E2=80=9D a couple of times. I suspect we are writing beyond the start of the array passed to _dl_sort_maps. Thanks, Florian