I know when a program crashes, some files creating in
/var/crash/. But I don't know what these files are!
Is that error logs?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
No, they are crash dumps of the kernel, i.e. files that contains useful information to recover the state of the kernel when it was crashing. These files are for your kernel what core dumps are for ordinary executables. There exists an utility that can be used to analyze those files : crash.
Filesystem Hierarchy Standard (FHS) quote
For directory function questions for Linux, you should also check the FHS: /var/crash : System crash dumps (optional) | linuxfoundation.org
/var/crash : System crash dumps (optional)
This directory holds system crash dumps. As of the date of this release of the standard, system crash dumps were not supported under Linux but may be supported by other systems which may comply with the FHS.
But as others mentioned, Debian has extended the standard for user space crashes as well via corekeeper.
In Ubuntu 14.04, it is Apport | Ubuntu Wiki instead of corekeeper that puts user space crashes there (corekeeper is not installed by default, but available on the repositories). Apport is the cause for the (in)famous "System problem detected" startup popup generated by the Apport program: System always start with "System program problem detected" dialog | Ask Ubuntu