Linux crash analysis

What is the best way to analyze Linux crashes?

We plan to create software and provide a version for testers. Testers may not remember how to reproduce the accident, or the accident may be completely intermittent. They will also not have a development environment on their machines. The software is written in C / C ++ and compiled into native machine code for distribution.

+7
c ++ c linux crash
source share
5 answers

I believe what you are looking for: How to generate stacktrace when my gcc c ++ application crashes

+6
source share

If you have disk space, let the application create it coredump when it works.

ulimit -c unlimited 

You can later debug it using GDB.

+7
source share

In addition to the initial and stack traces, as already noted, make sure that you can easily determine which versions of your executable users are running, and be able to answer which version of each source file goes to which binary version (i.e. spend some time with your source code management system and build scripts). Otherwise, neither the main file nor the stack trace will help.

+3
source share

Kernel dumps are useful, but they do not always tell you everything you want to know about how you ended up in an error state.

Logging activities, inputs and events can be very helpful. If you can record every run of your program so that in the event of a failure, the developer can access the log and repair this error, it can be very useful.

If possible, you should create your programs with the maximum debug symbols generated, and then separate them if you do not want or cannot let your release versions have them, but keep a copy of each released version using debug symbols that you can connect to the main file if you need to debug a crash.

+3
source share

In addition to generating a stacktrace in the SIGSEGV handler and / or creating a core dump , it can also be useful to find where the C ++ exception thrown is thrown .

+1
source share

All Articles