public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30920] New: Improve error message when failing to load core file
@ 2023-09-29 15:42 simon.marchi at polymtl dot ca
  0 siblings, 0 replies; only message in thread
From: simon.marchi at polymtl dot ca @ 2023-09-29 15:42 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30920

            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 relevant
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. 

---

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 ulimit
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. 

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 better, but the tool could always say:

> "filename.core" is not a core dump: This core dump is either corrupt or truncated. 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 temporarily override this limit (in some cases) by using ulimit -c unlimited. Be aware that core files can be large - contact your system administrator if you 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

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-29 15:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 15:42 [Bug gdb/30920] New: Improve error message when failing to load core file simon.marchi at polymtl dot ca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).