From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E1F53893C68; Sun, 27 Jun 2021 05:27:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E1F53893C68 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: Sun, 27 Jun 2021 05: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: Sun, 27 Jun 2021 05:27:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28014 --- Comment #8 from Simon Marchi --- I investigated a little bit why GDB fails to get the exec displacement for = your program, and found that program header validation here fails: https://gitlab.com/gnutools/gdb/-/blob/f1fa7a3d88561cef54dd5cf9422c29a802af= 6ce3/gdb/solib-svr4.c#L2625-2628 The program headers read from the core is all zeroes. The address of the P= HDR in your core is: $ eu-readelf -n qemu_gdb_20210625-192829_18450.core | grep PHDR PHDR: 0x4000000040 The corresponding LOAD in the core, for that address, is: $ eu-readelf -l qemu_gdb_20210625-192829_18450.core Type Offset VirtAddr PhysAddr FileSiz= =20 MemSiz Flg Align LOAD 0x005000 0x0000004000000000 0x0000000000000000 0x000000 0xa04000 R E 0x1000 FileSiz =3D=3D 0 hints that this section of memory was not dumped in the co= re. I then found that bit 4 of /proc/$pid/coredump_filter controls that, as documented in the core(5) man page. I tried flipping that bit off, generat= ed a core, and also got a core with FileSiz =3D=3D 0. Is it possible that your = system does not include that information in the code dumps? Simon --=20 You are receiving this mail because: You are on the CC list for the bug.=