SUSE Support

Here When You Need Us

Using gdb to get a backtrace of a failing application

This document (7001690) is provided subject to the disclaimer at the end of this document.

Environment

Application or component failure in any of our Linux products.
SUSE Linux Enterprise Desktop (SLED), Server (SLES), or openSUSE

Situation

An application or component is crashing or having some other critical failure and a backtrace is required by engineering to debug the problem.

Resolution

First install the debug version of the troubled package.  These can be difficult to track down.  There is usually a debug (or debuginfo) package available for the latest version of the application so it may be required to install the latest version before getting the backtrace.  Occasionally the newer package will fix the problem so be sure to verify that the problem still happens.

You can run the application directly with gdb or you can attach to an already running process. To run directly do the following:

gdb <command>

Then start the application when at the "gdb>" prompt by running:

gdb> run

To attach to an already running process do the following:

ps aux | grep <app-name>
     (get the PID)
gdb –pid=<PID>
gdb> continue

When the failure occurs enable logging and get the backtrace by doing the following:

set logging file backtrace.txt
set logging on
thread apply all bt full
set logging off

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7001690
  • Creation Date: 21-Oct-2008
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.