Details UNIX Environment Process exception exit

Source: Internet
Author: User
Keywords Unix environment process exception exit
Tags continued debug default environment environment process exit functionality help

I hope that after reading this article, the reader has a deeper understanding of the process exception exit problem, a more systematic comb, can also help debug such process crashes, write more stable, more reliable software.

Process Exception exit

Process exit means the end of the process lifecycle, system resources are reclaimed, and processes are destroyed from the operating system environment. A process exception exit is when a process terminates unexpectedly during run, causing the task that the process should have continued to fail to complete.

A process exception exit may have the following negative effects on the software User:

The software loses some or all of its functionality and cannot complete its assigned tasks. If the process is processing data, it can cause data corruption. If it is a key software service, it will inevitably lead to service abnormal termination, resulting in unpredictable losses. A process exception exits or a process crashes, causing panic and confusion to software users.

Process exception exit is a frequently encountered problem in production environment, it will cause many negative effects to software users, so http://www.aliyun.com/zixun/aggregation/6434.html "> Software developers should avoid this problem." But the scenarios and reasons that cause the process to exit unexpectedly are varied and even elusive.

This article boils down to two classes of all the reasons that may cause the process to exit unexpectedly. Systematically classify them so that readers can have a clear understanding of such problems. Detailed discussion of each type of situation, analysis of the root causes, and then analyze the relationship between the two types of situations, that is, signal and process abnormal exit close relationship. I hope that after you have read this, you will have a more comprehensive and in-depth understanding of this type of problem, and will be helpful in debugging such problems, writing more reliable, more stable, more robust software.

First, let's look at the two types of situations that cause the process to exit unexpectedly:

Class One: Sending a signal to a process causes the process to exit unexpectedly;

Class One: Sending a signal to a process causes the process to exit unexpectedly

Signal:

A signal in a UNIX system is an event that the system responds to certain conditions and is a way of interprocess communication. A signal can be sent to another process by a process or sent to a process.

Signal Processing Program:

Signal processing program is the process of receiving the signal, the system response to the signal. According to the meaning of the specific signal, the corresponding default signal processing program will take different signal processing mode:

Terminates the process and produces a core dump file. Terminates the process from running. Ignoring the signal, the process continues to execute. Suspend the process from running. If the process has been paused, the rescheduling process continues to execute.

The first two ways will cause the process to exit unexpectedly, which is the scope of this article. In fact, most default signal handlers terminate the running of the process.

After the process receives the signal, if the process has already bound the custom signal handler, the process executes the custom signal handler in the user state, otherwise the kernel executes the default signal program to terminate the process, causing the process to exit unexpectedly.

Figure 1. Default signal handler terminates process run

Therefore, by sending a signal to the process, the default signal handler can be triggered and the default signal handler terminates the process. In the UNIX environment 11545.html "> We have three ways to send the signal to the target process, causing the process to exit unexpectedly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.