Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Sometimes it happen that some application crash without give no output error (conky in my case, probably is one of my configuration that is incorrect).

Is there somewhere a error log that I can check to understand why it is crashed?

share|improve this question
add comment

5 Answers

up vote 7 down vote accepted

Depends on the application. Different applications have different logging systems; there's no one central log that contains all the output from all the programs that run on your system.

That being said, a lot of programs do put their log files in the directory /var/log. The file /var/log/messages, in particular, contains output from the "system logger", which is a service made available by the system that programs can use (if they choose to) for logging. But not all programs use it. Mostly, you'll find messages from low-level system services in that file, not the graphical applications you probably use normally.

share|improve this answer
add comment

crash files go into /var/log/crashes/ for use with apport to report bugs. You can extract a core dump with apport-unpack, put that core dump through gdb, and find out what's causing the program to crash.

This is all assuming you're a programmer. If you're not...well, you can't fix the crash anyway!

share|improve this answer
    
"This is all assuming you're a programmer. If you're not...well, you can't fix the crash anyway!" with open-source we all can try to solve our problems, at our own risk obviously ;) –  Strae Aug 19 '10 at 8:46
    
@DaNiel: Not really! If you are not a programmer and you don't have a good understanding of the applications code, the more you mess with the code the buggier with will probably get :) –  AntonioCS Aug 19 '10 at 9:22
1  
Even if you're not a programmer sometimes looking a core dump can give you idea about the problem. For example, it seems like it's crashing in some kind of graphics routine--maybe I should updated my display driver... –  user1242 Aug 19 '10 at 15:14
    
..and it helps describing the errors in bug reports/forums ;) –  Strae Aug 19 '10 at 15:45
    
Do you know non-programmers who can use gdb? I'm a programmer and can get as far as bt full "oh look a backtrace...with missing symbols...guess I need to install debug symbols and try to reproduce the crash..." I once figured out how to set a breakpoint...that's the most advanced I've gotten with it though. –  maco Aug 19 '10 at 16:02
add comment

For conky it could also be that there are entries in $HOME/.xsession-errors.

share|improve this answer
add comment

you can go to /var/log/messages or crashes then you can run the grep command on those and search for the application your looking for the files can get pretty big sometimes. It will return information relevant to your applicaton. :)

share|improve this answer
add comment

Some applications have flags that can be used to turn on debugging, such as -d, -D, --debug, etc. Check the application's man page (man [my-app]) or run the app with the -h flag to see if it has such an option.

Many GUI apps write into $HOME/.xsession-errors so that's a good place to check for output.

maco's right that apport is probably the most sure-fire way to get good debug info. Sometimes it doesn't capture the crash, though.

If all else fails, you can also force the info out of it by running the app in gdb. It'd be something like:

$ gdb my-app

(gdb) run

... do whatever is needed to get it to crash ...

(gdb) bt full

and go from there.

If you go the gdb route you'll also want to install symbols, as mentioned previously. See https://wiki.ubuntu.com/DebuggingProgramCrash for handholding advice.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.