A process can be terminated abnormally for a number of reasons. Ultimately, all of these reasons will result in a signal's being set on the process. A signal is something that can interrupt the flow of your threads at any time. The default action for most signals is to terminate the process.
Here are some of the reasons that a process might be terminated abnormally:
To get the kernel to display some diagnostics whenever a process terminates abnormally, configure procnto with multiple -v options. If the process has fd 2 open, then the diagnostics are displayed using (stderr); otherwise; you can specify where the diagnostics get displayed by using the -D option to your startup. For example, the -D as used in this buildfile excerpt will cause the output to go to a serial port:
[virtual=x86,bios +compress] .bootstrap = {
startup-bios -D 8250..115200
procnto -vvvv
}
You can also have the current state of a terminated process written to a file so that you can later bring up the debugger and examine just what happened. This type of examination is called postmortem debugging. This happens only if the process is terminated due to one of these signals:
| Signal | Description |
|---|---|
| SIGABRT | Program-called abort function |
| SIGBUS | Parity error |
| SIGEMT | EMT instruction (emulation trap)
Note that SIGEMT and SIGDEADLK (mutex deadlock; see SyncMutexEvent() ) use the same signal number. |
| SIGFPE | Floating-point error or division by zero |
| SIGILL | Illegal instruction executed
One possible cause for this signal is trying to perform an operation that requires I/O privileges. To request these privileges:
|
| SIGQUIT | Quit |
| SIGSEGV | Segmentation violation |
| SIGSYS | Bad argument to a system call |
| SIGTRAP | Trace trap (not reset when caught) |
| SIGXCPU | Exceeded the CPU limit |
| SIGXFSZ | Exceeded the file size limit |
The process that dumps the state to a file when the process terminates is called dumper , which must be running when the abnormal termination occurs. This is extremely useful, because embedded systems may run unassisted for days or even years before a crash occurs, making it impossible to reproduce the actual circumstances leading up to the crash.