Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

3 improvements in GDB 16's core file loading

February 10, 2025
Andrew Burgess
Related topics:
C, C#, C++Developer tools
Related products:
Developer Toolset

    A core file is a dump of the memory and registers of a process at a specific point in time, usually at the moment that a process crashes. The default action for some signals, for example SIGSEGV (segmentation fault), is to generate a core file. A core file can be loaded into tools like GDB in order to understand why the process crashed.

    Core files created from the process image don't contain any debug information for the executable or shared libraries. When the GNU Debugger (GDB) loads a core file, it needs access to the original executable to find the required debug information. Combining the debug information with the contents of the core file allows GDB to examine the state of the process at the moment it crashed.

    The recently released GDB 16 contains improvements to how GDB reads the executable name, arguments, and environment from the core file. GDB's ability to automatically locate the executable corresponding to a core file has also been improved. In this article, we will examine three of those improvements.

    Improved discovery of executable and arguments

    The first improvement in GDB 16 core file loading is better discovery of executable and arguments. Along with the memory and registers, each core file contains additional notes. These notes are structured data that describe additional properties of the process. One of these notes is called NT_PRPSINFO. This note contains the executable filename and arguments used to start the process. Unfortunately, there are only 80 characters available within NT_PRPSINFO to store the executable name and arguments, so the information is truncated. Additionally, the executable name and arguments are stored in a single string, so it is not possible to know where the executable name ends and the command arguments begin.

    In GDB 16, the executable and argument information is now found using a different core file note, NT_AUXV. It is more descriptive and not limited to 80 characters. This means that the full executable name and argument list should be visible, as seen in the Core was generated by ... line in the following session:

    (gdb) core-file core.419153 
    [New LWP 419153]
    Reading symbols from /tmp/this_is_a_directory_with_a_very_long_name_that_would_usually_be_truncated_due_to_its_length/gen-core...
    Core was generated by `/tmp/this_is_a_directory_with_a_very_long_name_that_would_usually_be_truncated_due_to_its_length/gen-core aaa bbb ccc'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  0x0000000000401111 in foo () at gen-core.c:6
    6	  return *p;
    (gdb) 

    Viewable arguments and environment

    The second core file-related improvement in GDB 16 is viewable arguments and environment. Now that GDB knows the full argument list, these arguments can be viewed using the show args command, as follows:

    (gdb) show args
    Argument list to give program being debugged when it is started is "aaa bbb ccc".
    (gdb) 

    This is useful if you have a long debug session and the original Core was generated by ... line has scrolled off the terminal.

    In addition to being able to read the full arguments from the core file, GDB is also able to read the original environment of the crashing process. Prior to GDB 16, the show environment command would show the environment in which GDB was started. This is usually different from the environment that was in place when the core file was created. It is fixed, and GDB now shows the environment that was stored in the core file. 

    Consider this example of running a test program called gen-core and using env to start with an almost empty environment:

    $$ env -i FOO=hello $PWD/gen-core aaa bbb ccc
    Segmentation fault (core dumped)
    $$ gdb -q
    (gdb) core-file core.422146 
    [New LWP 422146]
    Reading symbols from /tmp/this_is_a_directory_with_a_very_long_name_that_would_usually_be_truncated_due_to_its_length/gen-core...
    Core was generated by `/tmp/this_is_a_directory_with_a_very_long_name_that_would_usually_be_truncated_due_to_its_length/gen-core aaa bbb ccc'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  0x0000000000401111 in foo () at gen-core.c:6
    6	  return *p;
    (gdb) show environment 
    FOO=hello
    (gdb) 

    This will be useful when debugging a process that is affected by changes in its environment.

    Better auto-loading of the executable

    The third core file-related improvement in GDB 16 is something that we've already been using in the previous sessions. GDB 16 is better at locating and auto-loading the executable corresponding to a core file. Prior to GDB 16, GDB did have support for auto-loading the executable for a core file, but it was limited to locating system binaries. So, if an executable installed by your package manager crashed, and you opened the core file, there was a good chance GDB would be able to find the corresponding executable. But for non-system executables, GDB almost certainly would fail to auto-load the executable. In both of our previous sessions, we relied on this feature to auto-load the gen-core executable when we opened the core file.

    There are still a few limitations. You need to compile with build-id support by passing the --build-id flag to the linker. GDB doesn't auto-load an executable unless it can find a matching build-id. This ensures that GDB doesn't load an executable that has changed since the creation of the core file. Similarly, the executable must be in its original location or in the same directory as the core file.

    If the auto-loading fails, then it is still possible to tell GDB which executable matches the core file using the file command, just as you could with older versions of GDB. Likewise, if you use the file command to set the executable before loading the core file, then GDB will not try to auto-load a different executable.

    Learn more about GDB 16 core files

    Learn more about how core dumps are created with the man core command. On systems that use systemd, like Red Hat Enterprise Linux (RHEL) and Fedora, systemd manages core files by default. You can retrieve them with the coredumpctl command and get more details with the man coredumpctrl command. Review all GDB 16 improvements found in the release announcement.

    Related Posts

    • Remote debugging with GDB

    • Extending gdbserver to support an strace client

    • Continuous integration with GDB Buildbot

    • Printf-style debugging using GDB, Part 1

    • C/C++ library upgrades and opaque data types in process shared memory

    • The joys and perils of C and C++ aliasing, Part 1

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

    Writing “Hello, World” hasn’t gotten any harder—but running it has. Download our developer’s guide to developer portals to learn how engineering teams can reduce friction and boost productivity using internal developer portals (IDPs).

    Get the e-book
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI