Improving Software Configuration Troubleshooting with Causality Analysis

Software misconfigurations are time-consuming and frustrating to troubleshoot. The focus of this thesis is to reduce the time and human effort needed to troubleshoot software misconfigurations by automating the diagnosis process. The core idea of this thesis is to automate misconfiguration diagnosis by using causality analysis to detennine specific inputs to an application that cause that application to produce an undesired output. This thesis shows that we can leverage these causal relationships to determine the root cause of misconfigurations. Further, we demonstrate that it is feasible to automatically infer such relations by analyzing the execution of the application and the interactions between the application and the operating system. Based on the idea of causality analysis, we designed and developed three misconfiguration diagnosis tools: SigConf, ConfAid, and X-ray. SigConf uses coarse-grained causality analysis to diagnose problems. The focus of SigConf is on misconfigurations that are known, i.e., the problem has been previously reported to a misconfiguration database. This database can be maintained by the developers or the users of an application. Thus, the problem of diagnosing an unknown bug on a sick computer can be reduced to identifying that the sick computer is in a state similar to a buggy state in the database. SigConf deduces the state of the sick computer by running predicates that test system correctness and generating signatures based on the execution path of each predicate. SigConf generates these signatures by recording the causal dependencies of the predicate execution. For example, reading a file makes the execution causally dependent on the content of the file. SigConf compares these signatures against the signatures recorded in the database to diagnose the problem at hand. Our second tool, ConfAid, uses a fine-grained causality analysis to diagnose misconfigurations. Compared to SigConf, ConfAid considers a narrower set of root causes, i.e. tokens in the configuration files. However, it does not require outside help to diagnose problems, and it can diagnose previously unknown misconfigurations. As the program executes, ConfAid instruments the program binaries and uses dynamic information flow analysis to extract causal dependencies introduced through data and control flow. It then uses these dependencies to link an erroneous behavior to specific configuration tokens that caused it. While SigConf and ConfAid focus on problems that manifest as incorrect outputs, X-ray, our final tool, tackles misconfigurations that lead to performance problems. The goal of X-ray is to not only determine what events happened during a performance anomaly, but also infer why these events occurred. Similar to ConfAid, X-ray employs a fine-grained causality analysis, and it considers root causes in software configuration files, as well as input requests. X-ray introduces the technique of performance summarization to diagnose misconfigurations. Performance summarization first attributes performance costs to fine-grained events, such as individual instructions and system calls. It then uses dynamic information flow to determine the probable root causes for the execution of each event. The cost of each event is assigned to root causes according to the relative probability of the causes leading to the execution of that event. Finally, the total cost for each root cause is calculated by summing the per-cause costs of all events. The root cause with the highest cost is the biggest contributor to the performance anomaly.