From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5676C385770A; Fri, 29 Sep 2023 15:42:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5676C385770A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1696002146; bh=zNc8+ydj6P3bE87ZzPlQMfYH+p/Fvhj8ijnStgrNNo8=; h=From:To:Subject:Date:From; b=qQJa7HVfHj0S6T0PrEK8BQQSotPMqTcRWfvChdi+GbQkOmWcuMgE0Avfo1+qh5nLl EzKv9lWIPa/iEQFIc/6TVWZQX+9j+G22vRs1Bewy7o8BL+PvLOJXscif/bucsIB1Sg LSzUV1hg7nrCYu+apq9dhLlM8bKdf0hZ+Mezbgkw= From: "simon.marchi at polymtl dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/30920] New: Improve error message when failing to load core file Date: Fri, 29 Sep 2023 15:42:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at polymtl dot ca X-Bugzilla-Status: NEW 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30920 Bug ID: 30920 Summary: Improve error message when failing to load core file Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simon.marchi at polymtl dot ca Target Milestone: --- Here is some user feedback we received from an internal user, that is relev= ant for the upstream community. The specific error message suggestion below is quite specific to Linux and MPI environments, but the idea is good I think.= =20 --- When GDB fails on loading a core file, it currently gives an error like: > "filename.core" is not a core dump: file format not recognized This can appear if the core dump is truncated, e.g. due to system limits set with `ulimit` on Linux systems. This generated some confusion when the ulim= it was set to a limit that resulted in a truncated corefile (as opposed to a fully-written core dump that was corrupted in some other way). The users who hit this had some suggestions to improve the error reporting: 1. perhaps GDB can recognize and specify if the core dump is truncated, or = if it's corrupted in a different way; 2. if that's not possible, improve the current error message.=20 User request: > If GDB fails to load a core file - can it distinguish between a "corrupt"= core and a "truncated" one. If it can, that makes the error reporting bett= er, but the tool could always say: > "filename.core" is not a core dump: This core dump is either corrupt or t= runcated. The core file may be truncated if the system imposes a size limit= on the core size, which can be viewed by running ulimit -c. You can tempor= arily override this limit (in some cases) by using ulimit -c unlimited. Be = aware that core files can be large - contact your system administrator if y= ou need to generate core dumps for a large MPI-based program Steps to generate error: 1. debug some program with GDB 2. dump core file with `generate-core-file` 3. manually truncate core file, for instance with `truncate -s 10M core` 4. open the truncated core file in GDB. GDB will likely spit out the error: "core" is not a core dump: file format not recognized --=20 You are receiving this mail because: You are on the CC list for the bug.=