From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 050723861C73; Sat, 26 Jun 2021 04:27:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 050723861C73 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug threads/28014] gdb coredumps when remote+kgdbing a system that OOMs too hard Date: Sat, 26 Jun 2021 04:27:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: threads X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 04:27:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28014 --- Comment #5 from Simon Marchi --- It dug a little bit. I checked why GDB couldn't see any shared library, I think there's a little bug in the MIPS-specific code where GDB uses a MIPS-specific auxv entry to locate the base of the runtime loader. It does= n't take into account the main executable's runtime address. With the hack below, I can get a shared library list. I then idenfitied th= at the current PC was in libc, so I downloaded and extracted libc6_2.31-12_mips64el.deb in my sysroot. The backtrace becomes a bit bett= er: (gdb) bt #0 0x0000004003148b4c in raise () from /tmp/investigation/lib/mips64el-linux-gnuabi64/libc.so.6 #1 0x000000400312fa50 in abort () from /tmp/investigation/lib/mips64el-linux-gnuabi64/libc.so.6 Backtrace stopped: frame did not save the PC To get further, we would need libc's debug info. I tried to find debug info for libc.so.6 but can't find it. It's supposed to be in the libc6 package, which I think should be found here: http://debug.mirrors.debian.org/debian-debug/pool/main/g/glibc/ But I can't find the debug package corresponding to libc6_2.31-12_mips64el.= deb. The libc's build-id is 59aa6ff984aff00883acda7feef7613cce475991, I can't fi= nd that in any of the packages. Do you have an idea? >>From a52228d3bb10cc6d1f6d748d22ee8a4cabff3304 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 26 Jun 2021 00:16:55 -0400 Subject: [PATCH] fix Change-Id: I0d90e5432a5a998840dae7446bfcdb8995cf0297 --- gdb/solib-svr4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index a8a7d1171dc6..d60427cd46bc 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -798,7 +798,7 @@ elf_locate_base (void) pbuf =3D (gdb_byte *) alloca (pbuf_size); /* DT_MIPS_RLD_MAP_REL contains an offset from the address of the DT slot to the address of the dynamic link structure. */ - if (target_read_memory (dyn_ptr + dyn_ptr_addr, pbuf, pbuf_size)) + if (target_read_memory (dyn_ptr + dyn_ptr_addr + 0x4000000000, pbuf, pbuf_size)) return 0; return extract_typed_address (pbuf, ptr_type); } --=20 2.32.0 --=20 You are receiving this mail because: You are on the CC list for the bug.=